Advisory

PYSEC-2026-161

Also known as: CVE-2026-48710, GHSA-86qp-5c8j-p5mr, X41-2026-002

Summary

BadHost: Missing Host header validation poisons request.url.path, bypassing path-based security checks

Details

Starlette reconstructs the requested URL based on the HTTP Host request header and requested path, but does not perform any validation of the Host header value. This allows attackers to inject paths into the host part, prepending the actual path. However, routing in Starlette is based on the actual request path. This inconsistent interpretation of HTTP requests may lead to issues such as authentication bypass when the authentication depends on the reconstructed URL’s path.

Severity

Not rated by the source.

Dates

Published
2026-05-22 13:10 UTC
Modified
2026-05-26 15:41 UTC

Affected packages and fixes

starlette

PyPI · All systems

Affected

  • introduced 0, fixed 1.0.1 (ecosystem)

Fixed versions

1.0.1

Fix

  • Fixed version 1.0.1
    pip install --upgrade starlette==1.0.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences