Medium, CVSS 6.1PyPIAmendedPublished
Slippers Vulnerable to Cross-Site Scripting (XSS) in attrs Template Tag
CVE-2026-34231 · GHSA-w7rv-gfp4-j9j3
- Affected
- PyPI slippers <= 0.6.2
- Fixed in
- 0.6.3· Vendor fix available
- Issue
- A Cross-site Scripting (XSS) vulnerability exists in the {% attrs %} template tag of the slippers Django package. When a context variable containing untrusted data is passed to {% attrs %}, the value is interpolated into an HTML attribute string without escaping, allowing an attacker to break out of the attribute context and inject arbitrary HTML or JavaScript into the rendered page. Vulnerability details Root cause AttrsNode is a custom Node subclass registered via register.tag(). Unlike register.simpletag(), which automatically applies conditionalescape() when autoescape is on, custom Node.render() methods receive no automatic escaping and are fully responsible for sanitising their output. attrstring() fails to do this: Attack scenario Given a template that uses {% attrs %} with a user-supplied value: An attacker crafting a request with q=" onmouseover="alert(document.cookie)" x=" produces: Impact Any template that passes values derived from user input, database content, or…
Recommended action: Upgrade to 0.6.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.