Medium

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

  • Disclosed: 20.08.2026
  • Updated: 11.10.2026 15:18

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:

python
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:

python
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

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) django-cms >= 5.0.8, < 5.0.9 5.0.9

References

CVSS score 4.4/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N
Weakness (CWE)
CWE-79
Platform
Python (PyPI)
Package
django-cms
Disclosed
20.08.2026
Updated
11.10.2026 15:18

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-3825 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-hvq6-2r72-p2x7 - CC BY 4.0

Vulnerability history: django-cms

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (10) in the archive
Total entries
10
First → latest
08.2017 08.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 2
  • Medium 8

Disclosures per year

  1. 2017: 1
  2. 2018: 0
  3. 2019: 0
  4. 2020: 0
  5. 2021: 0
  6. 2022: 1
  7. 2023: 0
  8. 2024: 1
  9. 2025: 0
  10. 2026: 7
Severity:
  1. High · 7.1 CVE-2026-54623 < 5.0.8 5.0.8
  2. django CMS: Stored XSS in edit-mode plugin exception rendering this entry
    Medium · 4.4 CVE-2026-75526 >= 5.0.8, < 5.0.9 5.0.9

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.