Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
OCR transform forwards numeric parameters without in-module range validation
Low-severity issue, currently open.
How well is this finding proven?
- 1.Reported / candidate
Complete
- 2.Reproducer written
Complete
View reproducer - 3.Reproduces (recorded run)
Not yet established
View evidence - 4.Independently re-run
Not yet established
- 5.Meets quality standard
Not assessed
- 6.Validated for submission
Not assessed
Recorded runs show whether the issue reproduces. Independent re-runs are shown separately. A later review does not fill in a missing earlier step.
Description
The issue as recorded.
The transform module forwards numeric OCR parameters (image_limit, image_min_size, pages entries, and the effective timeout) to the provider without validating their natural domains (image_limit/image_min_size/page indices are non-negative counts; timeout is strictly positive). map_ocr_params only allowlist-filters by KEY; it does not check or clamp VALUES. There is no requirement constraining these ranges because the module does not enforce them, so modeling them as constrained variables would orphan. Recorded as a domain-documentation finding instead: the valid numeric domains exist in the Mistral API contract but are not validated in-module.
Affected requirements
The requirement(s) this issue violates — click through to the spec.
Port parity
How this finding relates to the port: whether the behaviour diverges, isn't ported yet, was fixed, or matches across both implementations.
- Mistral OCR: Python -> RustMIR-001Matches across bothPython → RustView in Mirrors
Severity, explained
Why this is rated the way it is — and the scoring signals behind the rating (each ⓘ explains the term).
- why this rating
- Risk-rated
- risk area
- Correctness
- CVE surface
- None
Where it is
The code the issue lives in — peek the affected function inline to see it in context.
- MistralOCRConfig.map_ocr_params / transform_ocr_request
Reproducer and evidence
The recorded reproducer and its evidence-run outcome. Inspect the test and source, or run the command to check the behavior yourself.
// Reproduces: markeruv run pytest tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py::TestOcrKnownIssueReproducers::test_out_of_domain_numeric_params_forwarded_unchanged
Reproduction steps
Technical steps for your engineers to confirm the issue by hand.
- Code observation (no runtime reproducer): 1) open litellm/llms/mistral/ocr/transformation.py; 2) in map_ocr_params observe the only guard is key-membership (if param in supported_params) with no check or clamp of parameter VALUES; 3) in transform_ocr_request observe numeric params are copied into the body via data.update(optional_params) unchanged. Conclusion: numeric OCR parameters are forwarded without in-module range validation.
uv run pytest tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py::TestOcrKnownIssueReproducers::test_out_of_domain_numeric_params_forwarded_unchanged
What protects you, and the fix
What limits your exposure today, and the planned remediation.
What protects you now
The provider rejects out-of-domain values; callers pass well-formed parameters.
The fix
Optionally add range validation/clamping for numeric OCR params before forwarding. AUDIT observation only; transformation.py is not modified.
Blast radius
If you touch this issue, what else may need re-checking — the requirements it affects and the code and tests that hang off them. Historical view: authored trace links only — automatically derived links aren't reconstructible for past runs.
Touch this finding and you re-check 1 requirements · 3 code files · 1 tests.
- transformation.rs
- transformation.py
- transformation.rs
- test_mistral_ocr_transformation.py
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Change history
Every recorded revision of this finding's source file — when it was added, edited, or re-classified, with the diff for each change.
Discussions
Discuss this with the proof team. Nothing changes in your audit automatically — you open a request and a staff member records any outcome inside the thread.