Python
CVE-2026-34231
MEDIUM
Severity by source
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Lifecycle Timeline
3Blast Radius
ecosystem impact- 4 pypi packages depend on slippers (4 direct, 0 indirect)
Ecosystem-wide dependent count for version 0.6.3.
DescriptionGitHub Advisory
Summary
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.simple_tag(), which automatically applies conditional_escape() when autoescape is on, custom Node.render() methods receive no automatic escaping and are fully responsible for sanitising their output. attr_string() fails to do this:
def attr_string(key: str, value: Any):
if isinstance(value, bool):
return key if value else ""
key = key.replace("_", "-")
return f'{key}="{value}"'
# value is not escapedAttack scenario
Given a template that uses {% attrs %} with a user-supplied value:
{% load slippers %}
<input {% attrs type placeholder %}>render(request, "search.html", {"placeholder": request.GET.get("q", "")})An attacker crafting a request with q=" onmouseover="alert(document.cookie)" x=" produces:
<input type="text" placeholder="" onmouseover="alert(document.cookie)" x="">Impact
Any template that passes values derived from user input, database content, or other untrusted sources to {% attrs %} is vulnerable. Successful exploitation can lead to session hijacking, credential theft, arbitrary actions on behalf of the victim, and page defacement.
Remediation
Replace the f-string in attr_string() with format_html(), which escapes both key and value:
from django.utils.html import format_html
def attr_string(key: str, value: Any):
if isinstance(value, bool):
return key if value else ""
key = key.replace("_", "-")
return format_html('{}="{}"', key, value)Until a patch is available, sanitise untrusted values before passing them to {% attrs %}, for example with django.utils.html.escape() in the view layer.
AnalysisAI
Cross-site scripting (XSS) in the slippers Django package's {% attrs %} template tag allows unauthenticated remote attackers to inject arbitrary HTML and JavaScript by passing untrusted context variables containing quote characters and event handler attributes. The vulnerability affects templates that pass user-supplied or database-derived values to {% attrs %} without prior escaping. Vendor-released patch version 0.6.3 is available.
Technical ContextAI
The slippers package provides a custom Django template tag {% attrs %} implemented as a Node subclass registered via register.tag(). Unlike Django's register.simple_tag(), which automatically applies conditional escaping when autoescape is enabled, custom Node subclasses receive no automatic output sanitization and bear full responsibility for escaping their render() output. The vulnerability exists in the attr_string() function, which constructs HTML attribute strings using an unescaped f-string: f'{key}="{value}"'. When a context variable containing a double quote followed by malicious HTML (such as onmouseover="alert(...)" x=") is passed as a value, the f-string interpolates it directly into the attribute without escaping, allowing attribute context breakout and arbitrary HTML/JavaScript injection. The root cause maps to CWE-79 (Improper Neutralization of Input During Web Page Generation). The affected product is the slippers Python package (CPE: pkg:pip/slippers) used in Django applications.
RemediationAI
Vendor-released patch: upgrade slippers to version 0.6.3 or later. The fix replaces the unescaped f-string in the attr_string() function with format_html('{}="{}"', key, value) from django.utils.html, which automatically escapes both key and value for safe HTML attribute insertion. Until patching is possible, apply a workaround by sanitizing untrusted values before passing them to {% attrs %} using django.utils.html.escape() in the view layer. See the vendor security advisory at https://github.com/mixxorz/slippers/security/advisories/GHSA-w7rv-gfp4-j9j3 and the fix commit at https://github.com/mixxorz/slippers/commit/16cc4ef4fa8ad2f7aee30798f16c3e7b653423b2 for implementation details.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-w7rv-gfp4-j9j3