PYSEC-2026-1473

See a problem?
Import Source
https://github.com/pypa/advisory-database/blob/main/vulns/jinja2/PYSEC-2026-1473.yaml
JSON Data
https://api.osv.dev/v1/vulns/PYSEC-2026-1473
Aliases
Published
2026-07-07T11:45:29.949639Z
Modified
2026-07-07T17:46:13.853151947Z
Severity
  • 5.4 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N CVSS Calculator
Summary
Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
Details

The xmlattr filter in affected versions of Jinja accepts keys containing spaces. XML/HTML attributes cannot contain spaces, as each would then be interpreted as a separate attribute. If an application accepts keys (as opposed to only values) as user input, and renders these in pages that other users see as well, an attacker could use this to inject other attributes and perform XSS. Note that accepting keys as user input is not common or a particularly intended use case of the xmlattr filter, and an application doing so should already be verifying what keys are provided regardless of this fix.

References

Affected packages

PyPI / jinja2

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.1.3

Affected versions

2.*
2.0rc1
2.0
2.1
2.1.1
2.2
2.2.1
2.3
2.3.1
2.4
2.4.1
2.5
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
2.6
2.7
2.7.1
2.7.2
2.7.3
2.8
2.8.1
2.9
2.9.1
2.9.2
2.9.3
2.9.4
2.9.5
2.9.6
2.10
2.10.1
2.10.2
2.10.3
2.11.0
2.11.1
2.11.2
2.11.3
3.*
3.0.0a1
3.0.0rc1
3.0.0rc2
3.0.0
3.0.1
3.0.2
3.0.3
3.1.0
3.1.1
3.1.2

Database specific

source
"https://github.com/pypa/advisory-database/blob/main/vulns/jinja2/PYSEC-2026-1473.yaml"