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.
Update jinja2 to 3.1.3 if you use the affected versions. Test the change in a non-production environment first.
Local check
hol-guard supply-chain scanGHSA-h5c8-rqwp-cp95 affects jinja2 (pypi). Severity is high. 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.
AI coding agents often install or upgrade packages automatically in pypi. A high vulnerability in a dependency can be pulled into a project through a normal install or update without a human reviewing the change, expanding the blast radius from a single package to every agent workspace that depends on it.
| Package | Affected range | Fixed version |
|---|---|---|
| jinja2pypi | <3.1.3 |
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.
Update jinja2 to 3.1.3 if you use the affected versions. Test the change in a non-production environment first.
Local check
hol-guard supply-chain scanGHSA-h5c8-rqwp-cp95 affects jinja2 (pypi). Severity is high. 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.
AI coding agents often install or upgrade packages automatically in pypi. A high vulnerability in a dependency can be pulled into a project through a normal install or update without a human reviewing the change, expanding the blast radius from a single package to every agent workspace that depends on it.
| Package | Affected range | Fixed version |
|---|---|---|
| jinja2pypi | <3.1.3 |
| 3.1.3 |
Fixed versions are reported by the source feed; confirm compatibility before updating.
Reported by PyPI JSON (pypi).
HOL Guard can help your team review package activity against supported protection paths.
Explore HOL Guard| 3.1.3 |
Fixed versions are reported by the source feed; confirm compatibility before updating.
Reported by PyPI JSON (pypi).
HOL Guard can help your team review package activity against supported protection paths.
Explore HOL Guard