CVE-2020-27666
Description
Strapi before 3.2.5 has stored XSS in the wysiwyg editor's preview feature.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
strapi-plugin-content-managernpm | < 3.2.5 | 3.2.5 |
Affected products
2- Strapi/Strapidescription
Patches
Vulnerability mechanics
Root cause
"The WYSIWYG preview feature rendered Markdown to HTML without sanitizing the output, allowing stored cross-site scripting via injected HTML/JavaScript."
Attack vector
An attacker with access to the Strapi content manager can inject malicious HTML/JavaScript into a WYSIWYG field's content. When another user (such as an admin) views the preview of that content, the unsanitized Markdown-rendered HTML is executed in their browser, leading to stored cross-site scripting [CWE-79]. The attack requires the attacker to be able to create or edit content that uses the WYSIWYG editor, and the victim must open the preview for that content.
Affected code
The vulnerability is in the WYSIWYG editor's preview feature within `packages/strapi-plugin-content-manager/admin/src/components/PreviewWysiwyg/index.js`. The fix adds a call to `sanitizeHtml()` on the rendered Markdown output before it is injected into the DOM, and introduces a new utility file `satinizeHtml.js` that configures the `sanitize-html` library with an allowlist of tags and attributes.
What the fix does
The patch introduces the `sanitize-html` library (version 2.1.1) as a dependency and creates a utility function `clean()` that passes rendered Markdown through `sanitizeHtml()` with a strict allowlist of allowed tags and attributes. The preview component now calls `sanitizeHtml(md.render(data))` instead of directly rendering the Markdown output. This prevents malicious HTML or JavaScript from being executed in the preview by stripping or escaping any content that does not match the configured allowlist.
Preconditions
- authThe attacker must be able to create or edit content that uses the WYSIWYG editor in Strapi
- inputThe victim must view the preview of the attacker-controlled content
Generated on Jun 20, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/advisories/GHSA-qvp5-mm7v-4f36ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-27666ghsaADVISORY
- github.com/strapi/strapi/pull/8440ghsax_refsource_MISCWEB
- github.com/strapi/strapi/releases/tag/v3.2.5ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.