CVE-2026-48060

Litestar: HTML Injection Through CSRF Token

Published Jul 28, 2026 CVSS 3.1 · 8.1 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Litestar is an asynchronous server gateway interface framework that allows developers to build event‑driven web applications. Versions earlier than 2.20.0 are affected when a template engine is combined with CSRF protection. In these configurations, the value of the CSRF cookie is inserted into rendered templates without the template engine applying the usual escaping rules, creating an HTML injection flaw that can be promoted to cross‑site scripting; untrusted cookie content can generate arbitrary script or markup within the user’s browser. When an attacker can influence the CSRF cookie value—typically by compromising the victim’s browser context—this flaw enables attackers to execute scripts in the victim’s context, leading to data leakage, session hijacking, or other exploitation outcomes.

Affected Systems

The affected product is the Litestar ASGI framework from litestar‑org. Versions prior to 2.20.0 are vulnerable, where the combination of a template engine and CSRF protection is enabled per official configuration guidance. No other vendors or products are listed as affected.

Risk and Exploitability

The CVSS score of 8.1 marks this as a major vulnerability, while an EPSS score of less than 1% indicates a very low current exploitation probability. The flaw is not catalogued in the CISA KEV list. Because the flaw is triggered by user‑controllable content placed in a CSRF cookie, the attack vector likely requires the attacker to set a malicious CSRF cookie for the victim, which can be achieved only if the attacker can influence the victim’s browser context—such as via a separate XSS or phishing vector. When enabled, the malicious payload is rendered by the client’s browser, exposing the user to potential data theft or session compromise.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Litestar to version 2.20.0 or newer, which contains the patch that ensures CSRF cookie values are properly escaped before template rendering.
  • If upgrading immediately is not feasible, review the template configuration and apply manual escaping to the CSRF cookie value when it is included in templates.
  • Temporarily disable automatic inclusion of the CSRF cookie value in any inline template rendering until a patched version is deployed.

Generated by OpenCVE AI on August 4, 2026 at 12:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-542p-wvx7-72m4 Litestar has HTML Injection Through its CSRF Token
History
Type Values Removed Values Added
First Time appeared Litestar-org
Litestar-org litestar
Vendors & Products Litestar-org
Litestar-org litestar
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Litestar: HTML Injection Through CSRF Token
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 28, 2026, 7:39 PM
Reserved
May 20, 2026, 6:25 PM
Status
Deferred
Published
Jul 28, 2026, 8:17 PM
Modified
Oct 23, 2026, 11:10 PM