LiteLLM SQLi via spend logs (CVE-2024-5225)
SQL submitted through LiteLLM’s spend-log endpoint can change the database query executed by the service. Update the affected installation to protect spend data and the database operations available to the service.
Public CVE record · Source and API bundle
| Field | Value |
|---|---|
| Affected component and versions | See the advisory for the affected versions of each product or package: berriai/litellm, litellm |
| Fixed release | See the advisory for product-specific fixes |
| Severity | CVSS 6.4 |
| Evidence status | Lab comparison recorded |
| Test environment | Lab fixture or affected build documented in the evidence below |
| Eden release and module version | 1.103.0 · module 1.0.0 |
| Tested at | 2026-11-11 UTC |
| First publicly published | 2026-11-12T02:29:06Z |
cve.now entry. Product: LiteLLM
(lab: gabriel-litellm-app).
Eden terminates the HTTP connection to the affected product, evaluates a declarative policy and — in tier 2 — a separately compiled native Rust module under signed module authority, before any byte reaches the application. It does not patch the affected component; the vendor's fixed release remains the durable repair.
Status: Remediated (tier 1 + tier 2), live-proven 2026-11-11T16:48:23Z on the
installed eden-product-release:1.103.0 lab container.
The vulnerability
The LiteLLM spend-logs endpoint (/global/spend/logs) interpolates a
caller-supplied query value into SQL. The fixture (make_litellm) reproduces
the shape: a body carrying a quote-or tautology (id' or 1=1) records a
SQLi mark.
The Eden patch
Tier 1 — declarative policy (blunt, fail-closed): deny every request under
/global/spend/logs, ordinary log queries included — false positives measured
below.
Tier 2 — native Rust module gabriel_litellm_v1 (surgical): refuses
bodies carrying SQL quote-or tautology fragments (' or, 1=1, case
insensitive); ordinary log queries pass unchanged.
Implement the remediation
The commands are operator examples for the recorded scope. Compare fixture routes and software selectors with the intended deployment before use. See deployment prerequisites.
- Prepare the target. Verify the loaded product and version against the advisory. Use a compatible Eden HTTP interlay and an authenticated operator with Configure permission. Open the deployment example and API instructions. The bundle identifies module
gabriel_litellm_v1version1.0.0and the SDK revision in patch.toml. Run the policy extraction from the adapter directory. - Apply the declarative policy. Scope the policy to
/global/spend/logsand descendants (all methods,deny). SetINTERLAYto the target interlay UUID in the authenticated Eden CLI. Run an authenticatedGET /api/v1/interlays/{interlay}withX-Eden-Verbose: true. Save its complete current settings object ascurrent-settings.jsonand retain the prior remediation declaration for recovery. SetIDEMPOTENCY_KEYto a fresh key for this intended mutation.
jq -e '.tier1' deployment.json > remediation.json
jq -e --slurpfile policy remediation.json \
'.remediation = $policy[0] | {settings: .}' current-settings.json \
> interlay-update.json
eden api request PATCH "/api/v1/interlays/$INTERLAY" \
--header "Idempotency-Key:$IDEMPOTENCY_KEY" \
--body-file interlay-update.json --content-type application/json --confirm
- Verify the serving policy. Read back the interlay.
eden api request GET "/api/v1/interlays/$INTERLAY" \
--header 'X-Eden-Verbose:true'
Check that remediation_status.state is ready and both desired and effective SHA-256 values match the intended declaration. Replay the benign and marked requests in the recorded comparison on an isolated target. Check the recorded response and backend outcome for each probe. Use the request and expected-status table in the linked API example alongside the observed comparison.
4. Restore the previous policy. Coordinate the change with any other operator updating this interlay. Read current settings again and merge the saved remediation field into them. If the prior settings had no remediation field, omit it in the replacement. Send the same PATCH with a fresh idempotency key, then read back the intended state. Repeat the verification probes. Keep the affected route isolated if restoring the prior settings reopens exposure.
Native module gabriel_litellm_v1
- Prepare the archive. Use the version 1.0.0 bundle for source, target, and build profile. Configure independent host approval for the installed Eden release. Use the authenticated principals required by the native authority contract. Set
PATCH_ARCHIVEto the exact schema-2 package andPACKAGE_SHA256to its expected archive digest. Verify and import it using the same target interlay.
printf '%s %s\n' "$PACKAGE_SHA256" "$PATCH_ARCHIVE" | sha256sum --check &&
eden api request PUT "/api/v1/interlays/$INTERLAY/patch-packages/$PACKAGE_SHA256" \
--body-file "$PATCH_ARCHIVE" \
--content-type application/vnd.eden.patch-package.v2+tar --confirm
- Approve and activate. Enroll the publisher key, attest host software inventory, and inspect the configuration returned by import. Obtain independent host approval. Sign the typed statement with the matching SDK. Send the admit action followed by activate for the prepared operation. Use the applicable typed payload for each action in
authority-action.json.
eden api request POST "/api/v1/interlays/$INTERLAY/native-authority" \
--body-file authority-action.json --content-type application/json --confirm
- Verify the operation. Read the receipt through the same endpoint. Confirm
serving_nowand the full expected shard acknowledgment. Repeat the report’s benign and marked probes and check the backend observations. - Revoke or restore. Send revoke with the exact operation UUID. Mandatory protection can refuse traffic until a compatible operation is approved and activated. Verify the restored receipt and repeat the probes.
Vendor update. Use the advisory and its product-specific vendor references to select the fixed release for the exact installed product or package and release line. Follow its update instructions and confirm the version actually loaded by the service.
Measured comparison (fixtures9, run 2026-11-11)
| Probe | Baseline | Tier 1 | Tier 2 (module) | Backend effect |
|---|---|---|---|---|
benign log query {"key":"val"} | 200 | 403 (false positive) | 200 | none |
attack: SQLi {"q":"id' or 1=1"} | 200 (sqli3 recorded) | 403 | 403 | blocked at tier 2 |
Performance trace (Eden telemetry, live 2026-11-11)
Measured with Eden's built-in request telemetry (gateway.request.baseline
spans, read back through /api/v1/analytics/telemetry?signal=traces), not
client wall-clock. Latency Eden introduces per remediation arm for this case:
| Arm | n | mean | p50 | p95 | min–max |
|---|---|---|---|---|---|
| Tier 1 — declarative policy, blocked request (403) | 15 | 27 µs | 22 µs | 56 µs | 14 µs–56 µs |
| Tier 2 — native module, benign passes through (200) | 21 | 402 µs | 372 µs | 523 µs | 324 µs–619 µs |
| Tier 2 — native module, attack refused (403) | 14 | 131 µs | 128 µs | 181 µs | 107 µs–181 µs |
Eden-added latency for the tier-2 remediation: benign requests complete in 402 µs mean (p50 372 µs, p95 523 µs) in-product, module evaluation included. Honest scope: lab fixtures on one host, fresh connection per measured request, warm requests only; module reactivated shards 2/2 with a fresh signed statement per measurement; spans carry the full authority lineage (module SHA-256, operation, publication). Not the EDEN-3640 performance qualification contract.
Tested against: eden-product-release:1.103.0-single (image sha256:809293e1f0b525ac…, build target
eden_service_single, tooling revision 81a0724a…). Raw data:
module2/telemetry-ab/litellm-telemetry.json and module2/tier1-ab/litellm-tier1.json.
Authority lifecycle and negatives
Import 201, activation: explicit_required; publisher enroll_key, host
inventory + approve, reader inspect refused 403; tampered-statement admit
400; invalid-signature admit 403; admit prepared (not serving), activate
→ receipt serving_now, applied shards 2/2. Revoke → the identical attack
gets 503 (fail-closed); re-approve + re-activate → 403 again. All recorded
in the evidence JSON.
Honest scope
The fixture reproduces the interpolation shape, not the full LiteLLM API
surface. Bypass variants (comment tricks, encoding, alternate parameters) are
not bypass-tested; the rule is a lab-grade partial. Module binary SHA-256
02ea5e3d…, source modules/gabriel_litellm_v1.rs.
Cost record
Run window 16:48:23Z → 16:48:33Z (per-CVE ledger, marginal session cost).
Evidence appendix
- Fixture:
gabriel-2026-11-11/fixtures9.py(make_litellm, port 18308) - Evidence:
gabriel-2026-11-11/module2/evidence/litellm-module.json - Module source:
docs/case-studies/modules/gabriel_litellm_v1.rs