Skip to content
Fencer Vulns
medium 6.1

CVE-2026-40186 json

ApostropheCMS: sanitize-html allowedTags Bypass via Entity-Decoded Text in nonTextTags Elements

published 2026-04-15 6 mo ago modified 2026-10-26 13 d ago also EUVD-2026-23110 , GHSA-9mrh-v2v3-xpfm

cvss
6.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.2%
EPSS 0.2% chance of exploitation in 30 days, percentile 16%
public exploits
0
none known

Summary

ApostropheCMS is an open-source Node.js content management system. A regression introduced in commit 49d0bb7, included in versions 2.17.1 of the ApostropheCMS-maintained sanitize-html package bypasses allowedTags enforcement for text inside nonTextTagsArray elements (textarea and option). ApostropheCMS version 4.28.0 is affected through its dependency on the vulnerable sanitize-html version. The code at packages/sanitize-html/index.js:569-573 incorrectly assumes that htmlparser2 does not decode entities inside these elements and skips escaping, but htmlparser2 10.x does decode entities before passing text to the ontext callback. As a result, entity-encoded HTML is decoded by the parser and then written directly to the output as literal HTML characters, completely bypassing the allowedTags filter. An attacker can inject arbitrary tags including XSS payloads through any allowed option or textarea element using entity encoding. This affects non-default configurations where option or textarea are included in allowedTags, which is common in form builders and CMS platforms. This issue has been fixed in version 2.17.2 of sanitize-html and 4.29.0 of ApostropheCMS.

Patch / fix

  • npm sanitize-html 2.17.3
  • apostrophecms apostrophecms 4.29.0
  • apostrophecms sanitize-html 2.17.2

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2026-40186 updated cvss 6.1

sanitize-html: ApostropheCMS: sanitize-html allowedTags Bypass via Entity-Decoded Text in nonTextTags Elements

  • Red Hat Multicluster Engine for Kubernetes multicluster-engine/console-mce-rhel9 Red Hat Advanced Cluster Management for Kubernetes 2 rhacm2/console-rhel9 Red Hat OpenShift AI (RHOAI) rhoai/odh-mlflow-rhel9 Red Hat OpenShift Container Platform 4 openshift4/ose-console, openshift4/ose-console-rhel9, openshift4/ose-agent-installer-ui-rhel9 Red Hat OpenShift Container Platform 5 openshift5/ose-console-rhel9, openshift5/ose-agent-installer-ui-rhel9
    affected: workaround, no fix available “Fix deferred”
  • Red Hat OpenShift Dev Spaces devspaces/dashboard-rhel9
    affected: workaround, no fix planned “Out of support scope”
  • Red Hat OpenShift Virtualization 4 container-native-virtualization/kubevirt-console-plugin-rhel9 Red Hat Quay 3 quay/quay-rhel8, quay/quay-rhel9 Red Hat Satellite 6 nodejs-sanitize-html, satellite/iop-advisor-frontend-rhel9, satellite/iop-vulnerability-frontend-rhel9, satellite/iop-host-inventory-frontend-rhel9
    affected: workaround, no fix available “Fix deferred”

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
no
Technical impact
partial
Assessed
6 mo ago

Exploit prediction

0.25% chance of exploitation in the next 30 days, higher than 16% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-9mrh-v2v3-xpfm referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 6.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHub 3.1 6.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected packages

ecosystem package affected fixed in
npm sanitize-html
>=2.17.2, <2.17.3
2.17.3

Affected products

  • apostrophecms apostrophe
  • apostrophecms sanitize-html

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.