PT-2026-80281 · Pypi · Django Cms

Published

2026-08-20

·

Updated

2026-08-20

CVSS v3.1

4.4

Medium

VectorAV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N

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

Fix

XSS

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

GHSA-HVQ6-2R72-P2X7

Affected Products

Django Cms