LiveActive security incident?Get immediate response
CVE Record

CVE-2021-39199: Cross site scripting via unsafe defaults in remark-html

remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.

CriticalCVSS 10Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

remark-html was documented as safe by default, but affected versions passed user-supplied HTML through when converting Markdown to HTML. If an application renders untrusted Markdown, an attacker could cause stored or reflected cross-site scripting in that application.

Executive priority

Prioritize remediation where Markdown input comes from customers, public users, or semi-trusted contributors. The business risk is account compromise or data exposure through browser-based attacks, especially in admin or support workflows that view submitted content.

Technical view

CVE-2021-39199 affects remarkjs remark-html versions before 13.0.2 and 14.0.0 before 14.0.1. The unsafe default allowed arbitrary HTML through without sanitization, creating CWE-79 XSS risk. Fixed versions make remark-html safe by default; older deployments can opt into sanitization.

Likely exposure

Exposure is most likely in Node.js applications that use remark-html to render Markdown from users, customers, contributors, CMS content, comments, tickets, or documentation. Applications rendering only trusted, controlled Markdown have lower practical exposure, but should still update because the default behavior contradicted documentation.

Exploitation context

The source bundle does not identify active exploitation, and this CVE is not listed as KEV. Practical exploitation depends on an application accepting untrusted Markdown and displaying the generated HTML to other users or administrators.

Researcher notes

The key issue is unsafe default behavior versus documentation, not a parser memory bug. Validate the actual rendering pipeline, because risk requires untrusted Markdown reaching remark-html output and then a browser context. Evidence supports fixed versions and the sanitize option, but not active exploitation.

Mitigation direction

  • Upgrade remark-html to 13.0.2, 14.0.1, or later supported versions.
  • If upgrade is not possible, enable sanitize: true on older affected versions.
  • Treat all user-supplied Markdown as untrusted input before rendering.
  • Review downstream HTML rendering paths for missing sanitization controls.
  • Monitor vendor advisories and npm dependency alerts for remark-html.

Validation and detection

  • Review package manifests and lockfiles for affected remark-html versions.
  • Identify application paths that render Markdown from external or low-trust users.
  • Confirm sanitization is enabled when affected versions remain deployed.
  • Verify generated HTML does not preserve unsafe user-supplied HTML.
  • Add regression tests covering untrusted Markdown rendering behavior.
Prepared
Confidence
high
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-79: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-39199 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Critical
CVSS
10 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
10CVSS 3.1CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N3.95.8Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

10Critical
CVSS 3.1 vector shape for CVE-2021-39199Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
remarkjsremark-html>= 14.0.0, < 14.0.1, < 13.0.2Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.