Skip to content

django CMS: Stored XSS in edit-mode plugin exception rendering

Moderate severity GitHub Reviewed Published Jul 10, 2026 in django-cms/django-cms • Updated Aug 20, 2026

Package

pip django-cms (pip)

Affected versions

>= 5.0.8, < 5.0.9

Patched versions

5.0.9

Description

Summary

When plugin rendering fails in edit mode, django CMS renders a cms-rendering-exception block so editors can see that a placeholder could not be rendered. Older code built that block's heading by interpolating the exception message, placeholder/source strings, and the failing plugin's short description directly into an HTML string, then returned the placeholder output as safe markup.

If an editor could store HTML in data used by a plugin's get_short_description() (or in other values interpolated into the exception message), and that plugin later raised during edit-mode rendering, the payload was parsed as HTML in the staff user's browser. This is a stored XSS condition in the CMS editing context.

Impact

The vulnerable path is only reached when placeholder rendering catches a plugin rendering exception:

try:
    placeholder_content = "".join(plugin_content)
except Exception as e:
    context["exc_info"] = sys.exc_info()
    placeholder_content = self.render_exception("rendering placeholder", context, placeholder, editable)

render_exception() constructs a message from values that can include stored content:

  • value - the exception message.
  • placeholder - the placeholder string representation.
  • placeholder.source - the source object string representation, such as page content.
  • instance.get_short_description() - plugin-provided summary text, often derived from plugin model fields.

In the vulnerable implementation, that message was embedded directly into an HTML heading. The final placeholder content was later returned through mark_safe, so Django template autoescaping did not protect the heading.

settings.DEBUG does not mitigate the issue: it only controls whether Django's traceback HTML is appended. The custom heading is rendered in edit mode regardless of DEBUG.

Patch

Escape the custom exception heading before returning it as safe placeholder markup. The current fixed code uses format_html, which escapes message before inserting it into the heading:

heading = format_html('<h2 class="cms-rendering-exception-title">{}</h2>', message)

The traceback HTML from ExceptionReporter.get_traceback_html() should remain separate from django CMS's custom heading; Django's traceback escaping does not protect additional HTML assembled by django CMS.

Workarounds

Until patched, reduce exposure by ensuring only fully trusted staff can edit plugins whose stored fields are included in get_short_description(), and fix or disable plugins that can be made to raise during edit-mode rendering. This is only a partial mitigation because the escaping bug is in the shared exception-rendering path.

References

  • cms/plugin_rendering.py - ContentRenderer.render_placeholder
  • cms/plugin_rendering.py - ContentRenderer.render_exception
  • Fixed code: heading = format_html('<h2 class="cms-rendering-exception-title">{}</h2>', message)
  • Regression tests:
    cms.tests.test_plugin_renderers.TestExceptionCatchers.test_exception_in_plugin_render_escapes_user_content_in_edit_mode,
    cms.tests.test_plugin_renderers.TestLegacyRendererExceptionCatcher.test_exception_in_plugin_render_escapes_user_content_in_edit_mode

References

@fsbraun fsbraun published to django-cms/django-cms Jul 10, 2026
Published to the GitHub Advisory Database Aug 20, 2026
Reviewed Aug 20, 2026
Last updated Aug 20, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(6th percentile)

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

CVE ID

CVE-2026-75526

GHSA ID

GHSA-hvq6-2r72-p2x7

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.