Skip to content

fix(deps): upgrade PyJWT, starlette, fastapi + 4 more for HIGH CVEs - #833

Merged
manavgup merged 2 commits into
mainfrom
fix/cve-dependency-bumps
Jul 19, 2026
Merged

fix(deps): upgrade PyJWT, starlette, fastapi + 4 more for HIGH CVEs#833
manavgup merged 2 commits into
mainfrom
fix/cve-dependency-bumps

Conversation

@manavgup

Copy link
Copy Markdown
Owner

Problem

The Docker CVE scan (Trivy) started failing on every branch — including #832, which doesn't touch the image at all. Seven HIGH vulnerabilities were newly published against packages in uv.lock. The most serious is real for this app: PyJWT 2.12.1 authentication bypass via forged tokens (CVE-2026-48526) — WikiMind's entire auth layer verifies PyJWT-signed tokens.

Solution

Lockfile-only upgrade of the affected packages (all are >= pins in pyproject, so no constraint changes needed):

Package From To CVE
PyJWT 2.12.1 2.13.0 CVE-2026-48526 — auth bypass
joserfc 1.6.5 1.7.3 CVE-2026-49852 (+1) — empty HMAC key accepted
lxml-html-clean 0.4.4 0.4.5 CVE-2026-49825javascript: URLs not stripped
python-multipart 0.0.27 0.0.32 CVE-2026-53539 — DoS
starlette 0.52.1 1.3.1 CVE-2026-48818 — SSRF/NTLM; CVE-2026-54283 — form() limits ignored

Two co-upgrades were required to unblock starlette 1.x: fastapi 0.136.0 → 0.139.2 and prometheus-fastapi-instrumentator 7.1.0 → 8.0.2 (the 7.x line caps starlette<1.0.0). And lxml 6.1.0 → 6.1.1 because lxml-html-clean 0.4.5 requires it.

Verification

  • make verify passes locally on the upgraded stack: 2134 passed, 4 skipped — lint, format, typecheck, doc-sync all green. The starlette major bump (0.52 → 1.3) is the risk item; the full suite exercising 138 endpoints passes.
  • The Docker workflow on this PR is the end-to-end proof: Trivy scans the built image.

Notes

🤖 Generated with Claude Code

manavgup and others added 2 commits July 16, 2026 14:17
Trivy began failing every Docker build on 7 newly published HIGH
vulnerabilities in locked Python dependencies:

- PyJWT 2.12.1 -> 2.13.0        CVE-2026-48526 (auth bypass via forged token)
- joserfc 1.6.5 -> 1.7.3        CVE-2026-49852 (+1; empty HMAC key accepted)
- lxml-html-clean 0.4.4 -> 0.4.5 CVE-2026-49825 (javascript: URLs not stripped)
- python-multipart 0.0.27 -> 0.0.32  CVE-2026-53539 (DoS)
- starlette 0.52.1 -> 1.3.1     CVE-2026-48818 (SSRF/NTLM), CVE-2026-54283
                                 (form() limits ignored)

Unblocking starlette required two co-upgrades: fastapi 0.136.0 ->
0.139.2 and prometheus-fastapi-instrumentator 7.1.0 -> 8.0.2 (7.x
capped starlette <1.0). lxml 6.1.0 -> 6.1.1 (lxml-html-clean 0.4.5
requires it). Lockfile-only change; no pyproject constraints needed.

Full verify suite passes: 2134 tests, lint, typecheck, doc-sync.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A second Trivy run flagged cryptography 46.0.7 (HIGH, fixed in 48.0.1)
— the advisory landed in the vulnerability DB between scans. Full
verify suite passes: 2134 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@manavgup
manavgup merged commit b6780bd into main Jul 19, 2026
11 checks passed
@manavgup
manavgup deleted the fix/cve-dependency-bumps branch July 19, 2026 14:22
manavgup added a commit that referenced this pull request Jul 19, 2026
CVE-2026-52869 (HIGH, fixed in 1.27.2) was published after #833 went
green, failing the Trivy scan on main's post-merge Docker build — which
skipped the deploy — and on PR #832's rebased checks. Lockfile-only
bump; full verify passes (2134 tests).

Co-authored-by: manavgup <manavgup@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Jul 19, 2026
Three times in four days a freshly published advisory failed the Trivy
scan on code that was green at review time (#833's two rounds, then
CVE-2026-52869 against mcp blocking the post-#833 deploy and #832).
A hard fail-on-publish gate freezes every in-flight merge on findings
unrelated to the change being merged.

Add an OPA ignore policy: HIGH vulnerabilities published within the
last 7 days are ignored, leaving a window to bump the dependency in an
orderly PR. After 7 days the scan fails as before, so nothing can be
ignored indefinitely. CRITICAL findings are never ignored, and findings
without a parseable PublishedDate fail closed.

Verified locally with trivy 0.70: the 7-day window still reports old
HIGH CVEs on python:3.11-slim, and a test 10-year window suppresses
them — confirming the rule keys on Severity + PublishedDate.

Also add .trivyignore and .github/trivy/** to the workflow's path
filters so editing scan-ignore rules re-triggers the scan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
manavgup added a commit that referenced this pull request Jul 19, 2026
Three times in four days a freshly published advisory failed the Trivy
scan on code that was green at review time (#833's two rounds, then
CVE-2026-52869 against mcp blocking the post-#833 deploy and #832).
A hard fail-on-publish gate freezes every in-flight merge on findings
unrelated to the change being merged.

Add an OPA ignore policy: HIGH vulnerabilities published within the
last 7 days are ignored, leaving a window to bump the dependency in an
orderly PR. After 7 days the scan fails as before, so nothing can be
ignored indefinitely. CRITICAL findings are never ignored, and findings
without a parseable PublishedDate fail closed.

Verified locally with trivy 0.70: the 7-day window still reports old
HIGH CVEs on python:3.11-slim, and a test 10-year window suppresses
them — confirming the rule keys on Severity + PublishedDate.

Also add .trivyignore and .github/trivy/** to the workflow's path
filters so editing scan-ignore rules re-triggers the scan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
manavgup added a commit that referenced this pull request Jul 19, 2026
Three times in four days a freshly published advisory failed the Trivy
scan on code that was green at review time (#833's two rounds, then
CVE-2026-52869 against mcp blocking the post-#833 deploy and #832).
A hard fail-on-publish gate freezes every in-flight merge on findings
unrelated to the change being merged.

Add an OPA ignore policy: HIGH vulnerabilities published within the
last 7 days are ignored, leaving a window to bump the dependency in an
orderly PR. After 7 days the scan fails as before, so nothing can be
ignored indefinitely. CRITICAL findings are never ignored, and findings
without a parseable PublishedDate fail closed.

Verified locally with trivy 0.70: the 7-day window still reports old
HIGH CVEs on python:3.11-slim, and a test 10-year window suppresses
them — confirming the rule keys on Severity + PublishedDate.

Also add .trivyignore and .github/trivy/** to the workflow's path
filters so editing scan-ignore rules re-triggers the scan.

Co-authored-by: manavgup <manavgup@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant