CVE-2026-48060 Litestar: HTML Injection Through CSRF Token
Attackers can inject HTML or scripts via CSRF tokens in Litestar apps using template engines, potentially leading to XSS and account takeover.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-48060?
CVE-2026-48060 is a high-severity cross-site scripting vulnerability in litestar-org litestar, published on 28 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Litestar is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to version 2.20.0, Litestar instances which use a template engine in conjunction with CSRF protection are vulnerable to HTML Injection which can be escalated to Cross Site Scripting due to the contents of the CSRF cookie being excluded from automatic escaping by the template engine when configured inline with documentation recommendations. This issue has been patched in version 2.20.0.
Weakness: CWE-79
Which versions are affected by CVE-2026-48060?
3 open source packages ship an affected version, including litestar.
| Package | Affected | Fixed in |
|---|---|---|
litestar PyPI | All versions | 2.22.0 |
litestar PyPI | All versions | 2.22.0 |
litestar PyPI | All versions | 2.22.0 |
How do I fix CVE-2026-48060?
Upgrade litestar to 2.22.0 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-48060 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-48060 exists.
Public exploit code: 1 proofs of concept on GitHub.
Sources
Also known as GHSA-542p-wvx7-72m4, PYSEC-2026-2604.