Skip to main content

Django CVE-2026-115868

| EUVDEUVD-2026-141379 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-12-02 DSF GHSA-2q44-jvmf-fqjp
5.1
CVSS 4.0 · Vendor: DSF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft input whose text length equals truncation length
  2. Delivery
    Submit to app using truncatechars_html in HTML attribute
  3. Exploit
    Unescaped final segment breaks out of attribute
  4. Execution
    Victim loads page and renders injected markup (UI:R)
  5. Impact
    Script 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

Django 6.1 <6.1.4
Django 6.0 <6.0.11
Django 5.2 <5.2.20

Affected Packages

euvd django fix: 5.2.20, 6.0.11, 6.1.4

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 &quot;ab&quot;. 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

Vendor (DSF) PRIMARY 5.1 MEDIUM
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
vuln.today AI 6.1 MEDIUM

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.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (DSF).

CVSS VectorVendor: DSF

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
Dec 02, 2026 - 14:22 NVD
6.1 (MEDIUM) 5.1 (MEDIUM)
CVE Published
Dec 02, 2026 - 13:20 cve.org
MEDIUM 6.1

DescriptionCVE.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

EPSS Score
0.5%
Top 53% exploitable
Prevalence
High
Django is a very widely deployed Python web framework across enterprises
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Django

View all
CVE-2021-23336 MEDIUM POC
5.9 Feb 15

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

CVE-2017-12794 MEDIUM POC
6.1 Sep 07

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

CVE-2022-34265 CRITICAL POC
9.8 Jul 04

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

CVE-2021-35042 CRITICAL POC
9.8 Jul 02

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

CVE-2019-19844 CRITICAL POC
9.8 Dec 18

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

CVE-2026-61594 CRITICAL POC
9.1 Sep 16

An authentication/authorization bypass in the djust Python live-view framework (versions prior to 1.0.7) lets unauthenti

CVE-2026-61599 HIGH POC
8.8 Sep 16

Unauthenticated arbitrary Python module import in djust before 1.0.7 lets any client that can reach the WebSocket or SSE

CVE-2020-9402 HIGH POC
8.8 Mar 05

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

CVE-2016-6186 MEDIUM POC
6.1 Aug 05

Cross-site scripting (XSS) vulnerability in the dismissChangeRelatedObjectPopup function in contrib/admin/static/admin/j

CVE-2026-93456 HIGH POC
8.4 Sep 18

Forged content modification in django-page-cms through 2.0.13 lets unauthenticated remote attackers exploit five CSRF-ex

CVE-2026-61593 HIGH POC
8.1 Sep 16

Cross-site request forgery in djust's Server-Sent-Events transport affects all versions prior to 1.0.7 and allows a cros

CVE-2026-61590 HIGH POC
7.4 Sep 16

Unauthenticated remote attackers can read live Django view and session state and invoke server-side handlers through dju

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy