Repository navigation
Conversation
fastapi 0.115.12 capped starlette<0.47, holding the lite image on three fixable HIGH CVEs: CVE-2025-62727 (fixed 0.49.1), CVE-2026-48818 (fixed 1.1.0) and CVE-2026-54283 (fixed 1.3.1). 0.133.0 is the oldest FastAPI that drops the <1.0 cap ("Add support for Starlette 1.0.0+"). Since it no longer bounds Starlette, pin it explicitly to 1.7.0 (no advisories after 1.3.1; the version FastAPI's own CI moved to). Starlette 1.0 removed on_startup/on_shutdown, on_event, and the Starlette-level route/middleware/exception_handler decorators. The app already uses lifespan, and app.middleware/app.exception_handler are FastAPI's own methods, so no code changes are needed. uvicorn 0.28.0 and httpx 0.28.1 (TestClient) work unchanged; anyio resolves to 4.x as Starlette 1.7 requires. Verified in Dockerfile.lite: 385 passed / 1 skipped, and Trivy reports 0 fixable CRITICAL/HIGH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0.133.0 was only the oldest FastAPI without the starlette<1.0 cap. It shipped before Starlette 1.0 final and was never tested upstream against the pinned starlette 1.7.0, which FastAPI 0.142.3+ CI runs against. Nothing in 0.134-0.143 affects this app: the router-tree refactor (0.137) only matters to code reading router.routes (none here), and the native OpenTelemetry support (0.142) has exporter setup opt-in since 0.143. fastapi>=0.142 requires opentelemetry-api>=1.44, which mistralai 2.6.0 blocked through its opentelemetry-semantic-conventions<0.61 cap. 2.10 drops that cap. The 2.7-2.10.1 breaking changes are limited to the evaluations/workflows/campaigns APIs, not OCR. Verified in Dockerfile.lite: pip check clean, 385 passed / 1 skipped, Trivy 0 fixable CRITICAL/HIGH. Also ran a smoke test of the real mistralai 2.10.1 OCR surface (Mistral(server_url=...), ocr.process with document_url/image_url, response .pages[].markdown) against a mocked transport, since the unit tests stub the SDK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #15. Merge that first; GitHub will retarget this PR to
main.Why
With #15 in place, the lite image still had 3 fixable HIGH CVEs, all in Starlette.
fastapi==0.115.12held it atstarlette<0.47:request.form()limits ignored for urlencoded)Changes (
requirements.txtandrequirements.lite.txt)fastapi0.115.12 → 0.143.1starlette→ 1.7.0, now pinned explicitly because FastAPI ≥0.133 sets no upper bound. FastAPI's own CI runs against 1.7.0, and Starlette has no known vulnerabilities newer than 1.3.1.mistralai2.6.0 → 2.10.1. FastAPI ≥0.142 requiresopentelemetry-api>=1.44. mistralai 2.6.0 blocked that through itsopentelemetry-semantic-conventions<0.61cap, which 2.10 removes. The breaking changes in mistralai 2.7–2.10.1 are in the evaluations, workflows and campaigns APIs, not OCR.No app code changes:
on_startup/on_shutdown/on_event; the app already useslifespan.app.middleware/app.exception_handlerdecorators, but the ones the app calls are FastAPI's own methods.BaseHTTPMiddleware, CORS andUploadFilework unchanged.TestClient) need no change.Behaviour change to be aware of
Since FastAPI 0.132, JSON requests without a JSON
Content-Typeheader are rejected. LibreChat sendsapplication/json(axios default), and uploads are multipart. Any other client that posts JSON without the header would now be rejected.FastAPI(strict_content_type=False)restores the old behaviour if needed.Verification (Dockerfile.lite)
docker build -f Dockerfile.litesucceeds andpip checkis clean.OPENAI_API_KEY=test_key python -m pytest: 385 passed, 1 skipped (same as before).--severity CRITICAL,HIGH --ignore-unfixed): 0.Mistral(server_url="https://api.eu.mistral.ai")withocr.processsent bothdocument_urlandimage_urlrequests to/v1/ocr, and.pages[].markdownread back correctly.Not done: a live OCR call with a real key, and a build of the full
Dockerfile(its extra packages don't constrain Starlette or OpenTelemetry).🤖 Generated with Claude Code