Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft input whose text length equals truncation length
-
DeliverySubmit to app using truncatechars_html in HTML attribute
-
ExploitUnescaped final segment breaks out of attribute
-
ExecutionVictim loads page and renders injected markup (UI:R)
-
ImpactScript executes in victim browser, scope change
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the target application to invoke the truncatechars_html template filter or django.utils.text.Truncator.chars() with html=True on attacker-controllable input, where that input's text length matches the configured truncation length, and the truncated output is subsequently rendered inside an HTML attribute - the fix commit confirms the final text segment was appended without HTML-escaping. Limiting factors: this is not a flaw in default Django behavior but depends on a developer explicitly using this specific filter/method in an attribute context; the length of the text must equal the truncation length; and successful attack requires victim user interaction (UI:R) to render the page. Only supported branches were assessed and are fixed in 6.1.4, 6.0.11, and 5.2.20; unsupported series 5.1.x, 5.0.x, and 4.2.x were not evaluated and may also be affected. |
| Impact | This is a moderate-severity stored/reflected XSS (CWE-79) carrying a vendor CVSS 3.1 score of 6.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N) - network vector, low complexity, no privileges, but requiring user interaction (UI:R) and yielding only limited confidentiality/integrity impact with a changed scope typical of XSS executing in the victim's browser. Django itself rates the severity 'moderate' per its security policy. No EPSS score, KEV listing, or confirmed working exploit is present in the supplied data, so there is no signal of active or widespread exploitation; the vuln.today decision label is 'this_month' (a patch-this-cycle priority, not act_now/emergency). The practical risk is substantially gated by application-specific conditions: the flaw only manifests when a developer uses the truncatechars_html filter or Truncator.chars(html=True) on attacker-influenced data, the input's text length matches the truncation length, and the result is rendered inside an HTML attribute - so real exposure is far narrower than the AV:N/PR:N metrics alone suggest. Net assessment: a legitimate but low-urgency fix-this-cycle issue rather than a drop-everything emergency, with real-world impact depending entirely on whether an application exercises the vulnerable filter in an attribute context. |
| Exploit ScenarioDerived | An attacker supplies a string (for example one containing quote characters) whose text length exactly matches the truncation length to a page that passes it through truncatechars_html or Truncator.chars(html=True) and emits the result inside an HTML attribute. Because the final text segment was appended without escaping, the crafted characters break out of the attribute and inject markup that executes in the victim's browser when they view the page (UI:R). No public weaponized exploit is identified in the supplied data, though the vendor fix commit includes a regression test demonstrating the unescaped output. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Dec 02, 2026
Cross-site scripting in Django's truncatechars_html template filter and the django.utils.text.Truncator.chars() method when called with html=True: when the supplied text length exactly matches the configured truncation length and the truncated result is later rendered inside an HTML attribute, the final text segment is emitted without HTML-escaping, allowing injected markup to break out of the attribute context. Affected are Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20; older unsupported series (5.1.x, 5.0.x, 4.2.x) were not evaluated and may also be affected. The flaw is unauthenticated over the network (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N, vendor score 6.1, moderate per Django's security policy) but requires victim user interaction and a developer-chosen attribute rendering context; no public exploit was identified at time of analysis, and fixed releases 6.1.4, 6.0.11, and 5.2.20 are available.
RemediationAI
Upgrade to Django 6.1.4, 6.0.11, or 5.2.20 respectively - the vendor-released patch for each supported branch (fix commits 454f44fc8f52d0b925a7661b9809061f257eeac9, 7cf220a2486a7c5944893818bad9a6bbaebc48df, aaf82df0c772d98a71b740a331fccc0accb818a3, and 781dd5f5d53b6848dce649582d30bef4f0f94f67, documented at https://docs.djangoproject.com/en/dev/releases/security/ and https://www.djangoproject.com/weblog/2026/dec/02/security-releases/). Installations on unsupported 5.1.x, 5.0.x, or 4.2.x must move to a supported, patched branch, since those series were not evaluated and no fix was issued for them. If upgrading cannot be scheduled immediately, audit templates and code for truncatechars_html and Truncator.chars(..., html=True) applied to user-controlled values and pipe the result through escape/force_escape before placing it in an attribute - this restores neutralization but adds a second escaping layer that must be reviewed for double-escaping in HTML body contexts. Alternatively, avoid rendering truncated values inside attribute contexts (use them only as text nodes, where Django autoescaping applies) or switch to plain truncatechars with manual escaping, accepting that raw tags in the input will no longer be stripped.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Django's truncatechars_html template filter is backed by django.utils.text.Truncator, whose chars(length, html=True) mode performs HTML-aware truncation: an internal HTML parser subclass walks the input, tracks open tags so they can be re-balanced and truncated safely, and accumulates the retained character data. The root cause is CWE-79 (improper neutralization of input during web page generation): in the parser's process() accumulation step, text segments were appended verbatim (self.output.append(data)) rather than escaped. Under normal page-body rendering Django's autoescaping masks this, but when the truncated value is placed inside an HTML attribute the unescaped segment can terminate the attribute and inject event handlers or new attributes. The upstream fix changes that single line to self.output.append(escape(data)), and the accompanying regression test asserts Truncator('"ab"').chars(4, html=True) now yields "ab". The trigger is thus narrow and developer-dependent - it requires explicit use of this filter or Truncator.chars() with html=True on attacker-influenced data, a length coincidence between the input text and the truncation length, and insertion into an attribute context. Affected package identity is cpe:2.3:a:djangoproject:django, tagged XSS/Python/Django.
Know when Django gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Network-reachable reflected/stored XSS needing victim interaction (UI:R); the length-matching input is attacker-controlled so AC:L; executes in the victim's browser context giving S:C with limited C:L/I:L and no availability impact.
Primary rating from Vendor (DSF).
CVSS VectorVendor: DSF
Lifecycle Timeline
2DescriptionCVE.org
An issue was discovered in Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20. The truncatechars_html template filter and the django.utils.text.Truncator.chars() method (with html=True) are subject to a potential cross-site scripting (XSS) attack when certain inputs whose text length matches the truncation length are processed and rendered in an HTML attribute. Earlier, unsupported Django series (such as 5.1.x, 5.0.x, and 4.2.x) were not evaluated and may also be affected. Django would like to thank JoeCyberTech for reporting this issue.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
The package python/cpython from 0 and before 3.6.13, from 3.7.0 and before 3.7.10, from 3.8.0 and before 3.8.8, from 3.9
In Django 1.10.x before 1.10.8 and 1.11.x before 1.11.5, HTML autoescaping was disabled in a portion of the template for
An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. Rated critical severity (CVSS 9.8), this vulne
Django 3.1.x before 3.1.13 and 3.2.x before 3.2.5 allows QuerySet.order_by SQL injection if order_by is untrusted input
Django before 1.11.27, 2.x before 2.2.9, and 3.x before 3.0.1 allows account takeover. Rated critical severity (CVSS 9.8
An authentication/authorization bypass in the djust Python live-view framework (versions prior to 1.0.7) lets unauthenti
Unauthenticated arbitrary Python module import in djust before 1.0.7 lets any client that can reach the WebSocket or SSE
Django 1.11 before 1.11.29, 2.2 before 2.2.11, and 3.0 before 3.0.4 allows SQL Injection if untrusted data is used as a
Cross-site scripting (XSS) vulnerability in the dismissChangeRelatedObjectPopup function in contrib/admin/static/admin/j
Forged content modification in django-page-cms through 2.0.13 lets unauthenticated remote attackers exploit five CSRF-ex
Cross-site request forgery in djust's Server-Sent-Events transport affects all versions prior to 1.0.7 and allows a cros
Unauthenticated remote attackers can read live Django view and session state and invoke server-side handlers through dju
EUVD-2026-141379
GHSA-2q44-jvmf-fqjp
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB