Repository navigation
Security: Pillow 13 (56 advisories), dependency patch bumps, webhook secret fail-closed - #395
Merged
Merged
Conversation
- Pillow 11.3 -> 13.0 (fixes 55 CVEs + 1 GHSA reported by pip-audit) - Patch/minor bumps: alembic, SQLAlchemy 2.0.55, pydantic, pydantic-settings, sentry-sdk, beautifulsoup4, python-telegram-bot, telethon, dev tooling - Prefect server image 3.6.28 -> 3.6.29 (matches resolved client) - GitHub Actions checkout/setup-python v4/v5 -> v7 - Webhook secret check fails closed when unset; constant-time compare - Bind language_code parameter instead of string interpolation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CVEs fixed
pip-auditon a fresh resolution ofrequirements/requirements.txt(and onprod.txt,dev.txtandrequirements-e2e.txtone by one) found issues in Pillow only.CVE list
CVE-2026-112390, CVE-2026-112391, CVE-2026-112392, CVE-2026-112393, CVE-2026-112394, CVE-2026-112395, CVE-2026-112396, CVE-2026-112397, CVE-2026-112398, CVE-2026-112399, CVE-2026-112400, CVE-2026-112401, CVE-2026-112402, CVE-2026-112403, CVE-2026-112404, CVE-2026-112406, CVE-2026-112891, CVE-2026-112892, CVE-2026-112893, CVE-2026-112894, CVE-2026-112895, CVE-2026-112896, CVE-2026-112897, CVE-2026-112899, CVE-2026-112900, CVE-2026-112901, CVE-2026-114501, CVE-2026-25990, CVE-2026-40192, CVE-2026-42308, CVE-2026-42309, CVE-2026-42310, CVE-2026-42311, CVE-2026-54058, CVE-2026-54059, CVE-2026-54060, CVE-2026-55379, CVE-2026-55380, CVE-2026-55798, CVE-2026-59197, CVE-2026-59198, CVE-2026-59199, CVE-2026-59200, CVE-2026-59204, CVE-2026-59205, CVE-2026-96636, CVE-2026-96637, CVE-2026-96638, CVE-2026-96639, CVE-2026-96640, CVE-2026-96641, CVE-2026-96642, CVE-2026-96643, CVE-2026-96644, CVE-2026-96778, GHSA-78g4-xqwv-q3g8
This is a major-version bump because a CVE requires it. The code uses only current Pillow APIs (
textbbox,Image.Resampling.LANCZOS,ImageStat,alpha_composite), and the watermark and image-hash tests pass. After the update,pip-auditreports no known vulnerabilities.Other bumps (minor/patch)
requirements-e2e.txtraised to>=1.45.0)prefecthq/prefectserver image 3.6.28 → 3.6.29 (matches the client thatprefect==3.6.*resolves to)actions/checkoutv4 → v7,actions/setup-pythonv5 → v7 (both first-party; there are no third-party actions)python:3.14-slim-bookwormis a floating tag that picks up the latest patch on rebuild, so it is unchanged. Moving to trixie would change the distro and is skipped.Skipped (no CVE requires them)
Code-level security pass
Fixed in this PR:
validate_webhook_secretcompared the header toTELEGRAM_BOT_WEBHOOK_SECRETwith==. If the secret was unset,None == Nonelet header-less requests reach/tgbot/webhook. It now rejects requests when the secret is unset or the header is missing, and compares withsecrets.compare_digest. Production hasTELEGRAM_BOT_WEBHOOK_SECRETconfigured. If the value there were empty, webhook updates would now be rejected (403), so check bot logs after deploy. New test:tests/tgbot/test_webhook_secret.py.get_users_with_languagebuilt its query by interpolatinglanguage_codeinto a string. It is now a bound parameter. The only caller passes the constant"ru", so this could not be exploited, but it closes a footgun.Reviewed with no issue found:
/admin/*requiresADMIN_API_TOKEN(fails closed with 503, usescompare_digest)./healthcheckis the only unauthenticated route.exclude_meme_ids_sql_filterusesANY(:param)).scripts/redaction_audit.pyclean).Not fixed (follow-ups):
Dockerfile.prodruns as root:useradd appexists but there is noUSER app. Switching needs a check of the./:/srcbind mount and file permissions in prod.docker-compose.prod.ymlbind-mounts the repo (./:/src) into prod containers and publishes port9898on all host interfaces.Tests
pytest tests/against disposable Postgres 14 and Redis 6.2: 596 passed, 2 skippedruff checkandruff format --check: cleanscripts/redaction_audit.py: cleanDockerfile.prodlocally;import src.main, scripts.serve_flowsworks in the image (Pillow 13.0.0, Prefect 3.6.29)pip-auditafter the update: no known vulnerabilitiesDeploy note
Not merged by the author. Production deploys are Coolify docker-compose builds that auto-deploy on push to
production. The compose file uses fixedcontainer_names and has no health checks, so containers are recreated in place and a deploy is not zero-downtime. The webhook and Prefect runner restart briefly.