VYPR
Moderate severityNVD Advisory· Published Oct 22, 2020· Updated Aug 4, 2024

CVE-2020-27666

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.

PackageAffected versionsPatched versions
strapi-plugin-content-managernpm
< 3.2.53.2.5

Affected products

2

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

News mentions

0

No linked articles in our index yet.