CVE-2026-40186

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.
Configurations

Configuration 1 (hide)

cpe:2.3:a:apostrophecms:apostrophecms:4.29.0:*:*:*:*:*:*:*

Configuration 2 (hide)

cpe:2.3:a:apostrophecms:sanitize-html:*:*:*:*:*:node.js:*:*

History

26 Oct 2026, 21:10

Type Values Removed Values Added
Summary
  • (es) ApostropheCMS es un sistema de gestión de contenido de código abierto basado en Node.js. Una regresión introducida en el commit 49d0bb7, incluida en las versiones 2.17.1 del paquete sanitize-html mantenido por ApostropheCMS, omite la aplicación de allowedTags para el texto dentro de los elementos nonTextTagsArray (textarea y option). La versión 4.28.0 de ApostropheCMS se ve afectada a través de su dependencia de la versión vulnerable de sanitize-html. El código en packages/sanitize-html/index.js:569-573 asume incorrectamente que htmlparser2 no decodifica entidades dentro de estos elementos y omite el escape, pero htmlparser2 10.x sí decodifica entidades antes de pasar el texto a la devolución de llamada ontext. Como resultado, el HTML codificado por entidad es decodificado por el analizador y luego se escribe directamente en la salida como caracteres HTML literales, omitiendo completamente el filtro allowedTags. Un atacante puede inyectar etiquetas arbitrarias, incluyendo cargas útiles de XSS, a través de cualquier elemento option o textarea permitido utilizando codificación de entidades. Esto afecta a configuraciones no predeterminadas donde option o textarea están incluidos en allowedTags, lo cual es común en constructores de formularios y plataformas CMS. Este problema ha sido solucionado en la versión 2.17.2 de sanitize-html y 4.29.0 de ApostropheCMS.

25 Apr 2026, 18:15

Type Values Removed Values Added
CPE cpe:2.3:a:apostrophecms:apostrophecms:4.29.0:*:*:*:*:*:*:*
cpe:2.3:a:apostrophecms:sanitize-html:*:*:*:*:*:node.js:*:*
First Time Apostrophecms
Apostrophecms apostrophecms
Apostrophecms sanitize-html
References () https://github.com/apostrophecms/apostrophe/commit/7ca2d16237c72718ef7e5c7ae0458e6027ac4f64 - () https://github.com/apostrophecms/apostrophe/commit/7ca2d16237c72718ef7e5c7ae0458e6027ac4f64 - Patch
References () https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-9mrh-v2v3-xpfm - () https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-9mrh-v2v3-xpfm - Exploit, Vendor Advisory

15 Apr 2026, 21:17

Type Values Removed Values Added
New CVE

Information

Published : 2026-04-15 21:17

Updated : 2026-10-26 21:10


NVD link : CVE-2026-40186

Mitre link : CVE-2026-40186

CVE.ORG link : CVE-2026-40186


JSON object : View

Products Affected

apostrophecms

  • apostrophecms
  • sanitize-html
CWE
CWE-79

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')