CVE-2026-40186

Source
https://cve.org/CVERecord?id=CVE-2026-40186
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40186.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-40186
Aliases
Published
2026-04-15T20:15:12.333Z
Modified
2026-07-15T01:49:15.136619907Z
Severity
  • 6.1 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N CVSS Calculator
Summary
ApostropheCMS: sanitize-html allowedTags Bypass via Entity-Decoded Text in nonTextTags Elements
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-79"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40186.json",
    "cna_assigner": "GitHub_M"
}
References

Affected packages

Git / github.com/apostrophecms/apostrophe

Affected ranges

Type
GIT
Repo
https://github.com/apostrophecms/apostrophe
Events
Database specific
{
    "extracted_events": [
        {
            "introduced": "4.28.0"
        },
        {
            "fixed": "4.29.0"
        },
        {
            "introduced": "2.17.1"
        },
        {
            "fixed": "2.17.2"
        }
    ],
    "source": "AFFECTED_FIELD"
}

Affected versions

4.*
4.29.0
@apostrophecms/ai-helper@1.*
@apostrophecms/ai-helper@1.0.0-beta.11
@apostrophecms/apostrophe-astro@1.*
@apostrophecms/apostrophe-astro@1.10.0
@apostrophecms/apostrophe-astro@1.9.0
@apostrophecms/cli@3.*
@apostrophecms/cli@3.6.0
@apostrophecms/form@1.*
@apostrophecms/form@1.5.3
@apostrophecms/import-export@3.*
@apostrophecms/import-export@3.5.3
@apostrophecms/seo@1.*
@apostrophecms/seo@1.4.1
@apostrophecms/sitemap@1.*
@apostrophecms/sitemap@1.3.0
apostrophe@4.*
apostrophe@4.28.0
postcss-viewport-to-container-toggle@2.*
postcss-viewport-to-container-toggle@2.3.0
sanitize-html@2.*
sanitize-html@2.17.1
sanitize-html@2.17.2
uploadfs@1.*
uploadfs@1.26.1

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40186.json"