Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
Python->Rust divergence: Rust Azure OCR performs no URL-to-data-URI conversion
Medium-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.
Cross-language parity finding for MIR-007. The Python AzureAIOCRConfig.transform_ocr_request / async_transform_ocr_request (litellm/llms/azure_ai/ocr/transformation.py:155,212) convert a non-data document_url or image_url to a base64 data URI before delegating to the Mistral body build (SW-REQ-260801-F0AH sync, SW-REQ-260801-ACB9 async), because Azure AI OCR has no internet access. The Rust AzureAiOcrConfig::transform_ocr_request (litellm-rust/crates/core/src/providers/azure_ai/ocr/transformation.rs:288) delegates straight to MISTRAL_OCR_CONFIG.transform_ocr_request with NO URL conversion and has no async transform. Hostile/degenerate input: a caller passing a plain https document_url. Outcome under the Rust path: the un-converted URL is forwarded to Azure AI, which cannot fetch it. The F0AH/ACB9 conversion cells have no Rust counterpart and are exempted per-cell on MIR-007.
[Redacted: refers to a finding withheld pending disclosure.]
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.
- Azure AI OCR: Python -> RustMIR-007Not yet ported to RustPython → 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
Where it is
The code the issue lives in — peek the affected function inline to see it in context.
- providers::azure_ai::ocr::transformation::AzureAiOcrConfig::transform_ocr_request (Rust) vs AzureAIOCRConfig.transform_ocr_request/async_transform_ocr_request (Python)
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: markercargo test -p litellm-core --lib providers::azure_ai::ocr::transformation::tests::azure_ai_ocr_plain_url_forwarded_without_data_uri_conversion (characterizes the missing conversion - a plain https document_url is forwarded verbatim, not inlined as a data-URI; passes now, flips once the Rust transform fetches and base64-encodes the URL like the Python path)
Reproduction steps
Technical steps for your engineers to confirm the issue by hand.
cargo test -p litellm-core --lib providers::azure_ai::ocr::transformation::tests::azure_ai_ocr_plain_url_forwarded_without_data_uri_conversion (characterizes the missing conversion - a plain https document_url is forwarded verbatim, not inlined as a data-URI; passes now, flips once the Rust transform fetches and base64-encodes the URL like the Python path)
What protects you, and the fix
What limits your exposure today, and the planned remediation.
What protects you now
Fetch and convert non-data document/image URLs to base64 data URIs in the Rust Azure OCR transform (or upstream of the Rust bridge) so plain URLs resolve.
The fix
Implement sync (and, if the async path is added) URL-to-data-URI conversion in the Rust Azure OCR config equivalent to _convert_url_to_data_uri_sync/_async, then add a Rust test asserting a plain URL is converted.
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 2 requirements · 2 code files · 0 tests.
- transformation.rs
- 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.