/

CVE-2026-44990

Severity:

CRITICAL RISK

(9.3)

Stored XSS (CWE-79) via xmp Sanitizer Bypass in Node.js

CVE-2026-44990

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to client-side code execution

Severity:

CRITICAL RISK

(9.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A sanitizer bypass in sanitize-html allows content wrapped in a disallowed xmp tag to be reinterpreted as active HTML or JavaScript after sanitization.

When applications trust the library's default configuration and render sanitized output back to users, attacker-controlled payloads can become stored cross-site scripting (XSS) in ApostropheCMS and other Node.js applications.

Affected context

The vulnerability appears in Node.js applications that rely on sanitize-html (prior to 2.17.4) with the default disallowedTagsMode: 'discard' behavior to clean user-supplied HTML content.

It is most relevant to content management systems like ApostropheCMS and any other platforms that:

  • Accept rich text or HTML input from users
  • Sanitize this input server-side using sanitize-html
  • Store and later render the sanitized content in browsers

The issue specifically involves attacker-controlled content placed within an xmp element, which can be transformed into live markup or script when output is rendered.

Exploit preconditions

  • Attack surface: Web application interfaces that accept and later display user-generated HTML or rich text content (e.g., CMS fields, comments, posts).
  • Required access: Ability to submit or edit content that is sanitized by sanitize-html and subsequently stored (any authenticated or anonymous contributor role with such permissions).
  • Trigger point: Rendering of the sanitized content in a user's browser, where the xmp-wrapped payload is interpreted as active HTML or JavaScript.
  • Why exploitation is possible: The sanitizer's default handling of disallowed tags in disallowedTagsMode: 'discard' fails to neutralize content inside xmp, allowing the inner payload to bypass filtering and execute when the page is viewed.

Why this happens

The underlying issue is a sanitization logic flaw aligned with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).

sanitize-html's default behavior for disallowed elements assumes that discarding the tag itself is sufficient to neutralize unsafe content. However, the xmp tag behaves differently from typical elements: its contents can be treated as raw text and later reinterpreted as markup when the tag is removed or mishandled.

Because the sanitizer does not fully account for these semantics, attacker-controlled data inside xmp can survive the sanitization step and become active HTML or script on output, undermining the trust boundary between untrusted input and rendered content.

Potential impact

  • Execution of arbitrary JavaScript in victims' browsers when they view affected pages
  • Theft of session tokens or other sensitive data accessible via the DOM
  • Performance of actions on behalf of logged-in users (e.g., content changes, administrative actions, or configuration updates)
  • Defacement of site content or injection of malicious UI elements and phishing flows
  • Use of compromised pages as a launchpad for further client-side attacks within the same origin

General mitigation guidance

Mitigation focuses on strengthening HTML sanitization boundaries and reducing trust in library defaults:

  • Treat all user-supplied HTML as untrusted and ensure sanitization logic explicitly handles edge-case tags like xmp, template, and similar raw-text elements.
  • Prefer an allowlist-based sanitization model with minimal permitted tags and attributes, adding new ones only when strictly required.
  • Enforce contextual output encoding on top of sanitization, especially for dynamic content inserted into HTML, attributes, or script-related contexts.
  • Limit where rich HTML is allowed; use plain text fields with escaping for most user input and reserve HTML only for tightly controlled roles.
  • Apply strict privilege separation so that untrusted or semi-trusted users cannot introduce complex markup that relies solely on sanitizer behavior for safety.

How teams detect issues like this

Detection strategies generally combine code-level inspection and behavioral testing:

  • Review server-side and middleware code for usage of sanitize-html, noting the configured disallowedTagsMode and any reliance on default options.
  • Use static analysis or grep-based checks to inventory all sanitization points, then verify they do not assume that discarding disallowed tags is sufficient for safety.
  • Develop security test cases that submit payloads within xmp (and other special tags) to see whether stored content reappears as executable HTML or JavaScript when rendered.
  • Incorporate automated security testing (e.g., SAST/DAST tools) into CI pipelines to flag suspicious sanitization patterns and unencoded dynamic content.
  • During manual code review, treat trust in third-party sanitization libraries as a red flag and verify that layered defenses (sanitization plus encoding) are in place.

Sources

SourceLink
github.comgithub.com/apostrophecms/apostrophe/security/advisories/GHSA-rpr9-rxv7-x643
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36882
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36883
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40262
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41031
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41055
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41064
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41066
access.redhat.comaccess.redhat.com/errata/RHSA-2026:42146
access.redhat.comaccess.redhat.com/errata/RHSA-2026:42796
access.redhat.comaccess.redhat.com/errata/RHSA-2026:43052
access.redhat.comaccess.redhat.com/errata/RHSA-2026:46598
access.redhat.comaccess.redhat.com/errata/RHSA-2026:46685
access.redhat.comaccess.redhat.com/errata/RHSA-2026:46885
access.redhat.comaccess.redhat.com/errata/RHSA-2026:46903
access.redhat.comaccess.redhat.com/errata/RHSA-2026:47735
access.redhat.comaccess.redhat.com/errata/RHSA-2026:47737
access.redhat.comaccess.redhat.com/errata/RHSA-2026:48124
access.redhat.comaccess.redhat.com/errata/RHSA-2026:51196
access.redhat.comaccess.redhat.com/errata/RHSA-2026:51197
access.redhat.comaccess.redhat.com/errata/RHSA-2026:51349
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-44990
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2488565
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44990.json

Frequently asked

questions

Yes. If a web application exposes a field that uses sanitize-html to process and later render user input, a remote attacker can submit a crafted payload and cause script execution in the browsers of other users who view that content.

The attacker needs any level of access that allows them to supply HTML or rich text content processed by sanitize-html and stored or reused by the application. This could be an anonymous commenter, a low-privileged CMS author, or any role with content submission capabilities.

The safest pattern is to harden sanitization by using a strict allowlist configuration, ensuring special tags like xmp are handled correctly, and then applying context-appropriate output encoding when rendering sanitized content. Reducing reliance on complex HTML input from untrusted users further lowers risk.

Future prevention involves treating sanitization libraries as one layer of defense, not the only one: enforce defense-in-depth with sanitization plus encoding, regularly review and test sanitizer configurations, keep security-sensitive dependencies updated, and include XSS-focused test cases for unusual tags and browser parsing behaviors in QA and security testing.

Find out what's already
exploitable in your codebase.