Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

LiteLLM Python->Rust migration audit (proof mirroring).

Back to findings
Known issueKI-azure-ocr-rust-no-url-conversion

Python->Rust divergence: Rust Azure OCR performs no URL-to-data-URI conversion

OpenOpenMedium

Medium-severity issue, currently open.

How well is this finding proven?

  1. 1.Reported / candidate

    Complete

  2. 2.Reproducer written

    Complete

    View reproducer
  3. 3.Reproduces (recorded run)

    Not yet established

    View evidence
  4. 4.Independently re-run

    Not yet established

  5. 5.Meets quality standard

    Not assessed

  6. 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.

Reachability

[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-007
    Not yet ported to RustPython → Rust
    View in Mirrors

Severity, explained

Why this is rated the way it is — and the scoring signals behind the rating (each ⓘ explains the term).

MediumRated severity — the impact if this issue is exploited or hit.
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.

Recorded
Reproducer test
from // Reproduces: marker
Run it yourself
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)

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.

Tracing blast radius…

Touch this finding and you re-check 2 requirements · 2 code files · 0 tests.

Code files (2)
  • transformation.rs
  • transformation.py

Per-requirement evidence

For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.

Implementing code (2)
  • litellm-rust/crates/core/src/providers/azure_ai/ocr/transformation.rs
    AzureAiOcrConfig.transform_ocr_request
  • litellm/llms/azure_ai/ocr/transformation.py
Tests & evidence (2)
  • docs/requirements/azure_ocr.md
  • litellm-rust/crates/core/src/providers/azure_ai/ocr/transformation.rs
Proof obligations (3)
edge_case

Behavior for unusual but valid input combinations.

  • ✓nominal (required)
nominal

Happy-path behavior with valid inputs.

  • ✓nominal (required)
ssrf_protection

HTTP clients with user-influenced URLs shall enforce an allowlist of reachable destinations and reject internal-network targets.

  • ✓nominal (required)
  • ✓negative
Implementing code (2)
  • litellm-rust/crates/core/src/providers/azure_ai/ocr/transformation.rs
    AzureAiOcrConfig.transform_ocr_request
  • litellm/llms/azure_ai/ocr/transformation.py
Tests & evidence (2)
  • docs/requirements/azure_ocr.md
  • litellm-rust/crates/core/src/providers/azure_ai/ocr/transformation.rs
Proof obligations (3)
edge_case

Behavior for unusual but valid input combinations.

  • ✓nominal (required)
nominal

Happy-path behavior with valid inputs.

  • ✓nominal (required)
ssrf_protection

HTTP clients with user-influenced URLs shall enforce an allowlist of reachable destinations and reject internal-network targets.

  • ✓nominal (required)
  • ✓negative

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.

Sign in to discuss this with the proof team.Sign in