Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-112958 Overview
CVE-2026-112958 is a stored cross-site scripting (XSS) vulnerability in ApostropheCMS, an open-source Node.js content management system. The flaw affects versions prior to 4.34.0. A project-defined free-form widget style field can carry an editor-controlled quote into an inline style attribute because the wrapper serializer does not apply HTML-attribute encoding. An attacker with editor privileges can terminate the style attribute and inject executable attributes. The payload executes when published content, or an affected draft, is rendered to a higher-privileged user. The issue is fixed in version 4.34.0 and tracked as [CWE-79].
Critical Impact
An authenticated editor can inject executable HTML attributes that run in the browser of any user viewing the rendered content, including higher-privileged administrators.
Affected Products
- ApostropheCMS versions prior to 4.34.0
- Projects using free-form widget style fields
- Sites rendering drafts to higher-privileged reviewers
Discovery Timeline
- 2026-10-20 - CVE-2026-112958 published to NVD
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-112958
Vulnerability Analysis
The vulnerability resides in the ApostropheCMS widget wrapper serializer. When a project defines a free-form widget style field, the serializer writes editor-supplied values directly into an inline style="..." attribute on the rendered HTML element. The serializer does not apply HTML-attribute encoding to the value.
An editor who supplies a double-quote character inside the style value closes the attribute early. Any text following the quote is parsed by the browser as additional HTML attributes on the same element. This enables injection of event-handler attributes such as onmouseover or onload, which execute arbitrary JavaScript in the viewing user's session.
The attack requires editor-level privileges and user interaction to view the rendered content. Because the scope changes from the editor's session to the viewer's session, this is a scope-changing stored XSS impacting administrators and other reviewers.
Root Cause
The wrapper serializer path responsible for emitting inline style attributes omits HTML-attribute encoding. HTML-attribute context requires escaping of ", ', <, >, and & to prevent attribute termination and tag confusion. The missing encoder allows an editor-controlled quote to break out of the attribute value.
Attack Vector
An authenticated editor crafts a widget whose free-form style value contains a terminating quote followed by an event-handler attribute and JavaScript payload. The content is saved as a draft or published. When a reviewer or administrator renders the page, the browser parses the injected attributes and executes the payload in their context.
// Patch excerpt from packages/apostrophe/modules/@apostrophecms/area/index.js
// Source: https://github.com/apostrophecms/apostrophe/commit/40b989b1a9dd23d30029b8ce7668634265cfe5ea
//
// The fields the user may not view (`viewPermission`) are removed
// from the documents first (see `apos.doc.removeForbiddenFieldsDeep`).
async renderDocsAreas(req, within, { inline = false } = {}) {
within = Array.isArray(within) ? within : [];
self.apos.doc.removeForbiddenFieldsDeep(req, within);
let index = 0;
// Loop over the docs in the array passed in.
for (const doc of within) {
// Patch excerpt from packages/apostrophe/modules/@apostrophecms/color-field/index.js
// Source: https://github.com/apostrophecms/apostrophe/commit/40b989b1a9dd23d30029b8ce7668634265cfe5ea
//
// TinyColor finds functional notations like rgb() anywhere in the string,
// so the whole value must also have the shape of a color
const colorShape = /^\s*(?:#?[0-9a-f]{3,8}|[a-z]+|(?:rgba?|hsla?|hsva?|cmyk)[\s(][-+0-9.%,\s/]*\)?)\s*$/i;
Detection Methods for CVE-2026-112958
Indicators of Compromise
- Widget documents containing double-quote characters (") or HTML event-handler names (onerror, onmouseover, onload, onclick) inside stored style field values.
- Rendered pages whose inline style attributes contain unexpected trailing tokens outside valid CSS syntax.
- Draft or published documents created or modified by editor-role accounts shortly before administrator session anomalies.
Detection Strategies
- Query the ApostropheCMS content store for widget records where free-form style fields contain ", <, >, or on[a-z]+= patterns.
- Review web server access logs for requests to pages that render affected widgets, correlated with administrator or reviewer sessions.
- Inspect browser Content Security Policy (CSP) violation reports for inline script or event-handler executions from CMS-rendered pages.
Monitoring Recommendations
- Monitor the ApostropheCMS audit trail for widget edits by editor-role accounts, particularly changes to style-related fields.
- Alert on administrator or reviewer session activity immediately following draft or publish events from lower-privileged editors.
- Track outbound requests from reviewer browsers to unexpected domains after rendering CMS content.
How to Mitigate CVE-2026-112958
Immediate Actions Required
- Upgrade ApostropheCMS to version 4.34.0 or later as published in the ApostropheCMS 4.34.0 release.
- Audit existing widget content for style field values containing quote characters or HTML event-handler syntax, and remove or sanitize them.
- Review the editor account roster and revoke access for accounts no longer required to limit the attack surface.
Patch Information
The fix is included in ApostropheCMS 4.34.0. Technical details and the patch commits are published in the ApostropheCMS Security Advisory GHSA-7jg5-frgc-c67w. Relevant code changes are available in commit 40b989b and commit 06e4b37.
Workarounds
- Remove free-form widget style fields from project schemas until the upgrade is applied.
- Restrict editor permissions to trusted users only, since exploitation requires authenticated editor access.
- Deploy a strict Content Security Policy that disables inline event-handler execution on CMS-rendered pages.
# Upgrade ApostropheCMS to the patched release
npm install apostrophe@4.34.0
npm audit
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

