MediumCVE-2026-112958

    ApostropheCMS: Stored XSS via Unescaped Widget Style Attribute Serialization (CVE-2026-112958)

    Published Last modified Sources: Hersteller, CVE.org

    What is affected, what to do

    Update Apostrophe to version 4.34.0.

    Affected
    • Apostrophe lt *..4.34.0
    Fixed in
    • Apostrophe 4.34.0

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    5.4

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: Vendor (CNA), CVSS v3

    5.4

    CVSS v3

    Severity Medium on the scale from 0 to 10.

    Source: Hersteller, CVE.org

    0.3 %

    EPSS score

    Low — model estimates < 1% exploitation likelihood.

    Source: FIRST EPSS, percentile 21.8

    Show all metrics
    Severity
    Medium
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    57.00 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    no public PoC known
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    5.4 Methodology
    CVSS v3

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    5.4
    EPSS score

    The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.

    Read in glossary
    0.3 %
    Low — model estimates < 1% exploitation likelihood.
    EPSS percentile

    The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.

    Read in glossary
    21.8
    Elevated — this CVE ranks above at least 10% of all CVEs scored today.
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    —
    Published
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-79

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    Handle the vulnerability in regular vulnerability handling under Art. 21(2)(e) NIS2.
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    Summary

    ApostropheCMS widget styles support project-defined schema fields. If a project defines a free-form string style field with a CSS property and no selector, an editor-controlled value is rendered as an inline CSS declaration. The resulting declaration is then inserted into the widget wrapper's style="..." attribute without HTML-attribute escaping.

    An attacker who can edit the widget can include a double quote in the style value, terminate the style attribute, and inject new HTML event-handler attributes. The payload is stored with the widget and executes in the Apostrophe site origin whenever the affected published page is rendered.

    This is a sibling of CVE-2026-33889 / GHSA-97v6-998m-fp4g. The earlier issue escaped from a <style> element through a malicious color value. This variant reaches a different sink related to the automatically generated widget wrapper's inline style and class attributes.

    Details

    Root Cause 1: Free-form string style values retain HTML metacharacters

    The standard string field converter uses launder.string() and length validation. This performs type normalization, not output encoding for an HTML attribute context:

    packages/apostrophe/modules/@apostrophecms/schema/lib/addFieldTypes.js:296-333

    self.addFieldType({
      name: 'string',
      // ...
      convert(req, field, data, destination) {
        destination[field.name] = self.apos.launder.string(data[field.name]);
        destination[field.name] = checkStringLength(
          destination[field.name],
          field.min,
          field.max
        );
      }
    });
    

    Quotes therefore remain in a value supplied through a style field.

    Root Cause 2: The value is converted into inline CSS without value validation

    For a field with property but no selector or media query, renderScopedStyles() selects inline rendering. The generic extractor concatenates the configured property and editor-controlled value:

    packages/apostrophe/modules/@apostrophecms/styles/ui/apos/universal/render.mjs:171-228

    packages/apostrophe/modules/@apostrophecms/styles/ui/apos/universal/render.mjs:598-647

    rule = `${property}: ${normalized.value}${normalized.unit}`;
    
    // ...
    
    if (isInline) {
      return {
        css: '',
        classes: [ ...storage.classes ],
        inline: stringifyRules(storage.styles, true)
      };
    }
    

    For example, the value below becomes part of a font-family declaration:

    serif" tabindex="0" autofocus onfocus="document.body.dataset.inline='executed'
    

    Root Cause 3: Attribute values are serialized without HTML escaping

    getWidgetAttributes() places the inline CSS into an attribute tuple, then concatenates every tuple into key="value" without encoding &, <, >, ', or ":

    packages/apostrophe/modules/@apostrophecms/styles/lib/methods.js:251-322

    if (styleParts.length) {
      attrs.push(
        [ 'style', `${styleParts.join(';')};` ]
      );
    }
    
    if (options.asObject) {
      return Object.fromEntries(attrs);
    }
    
    return attrs
      .map(([ key, value ]) => `${key}="${value}"`)
      .join(' ');
    

    The same raw serializer also makes a project-defined free-form string style with class: true a potential sibling path, because the string is added to classes and later serialized into class="...". The inline-property path was the path dynamically verified.

    Root Cause 4: The unsafe string is used by the automatic public wrapper

    Styled widgets use getWidgetAttributes() to create a wrapper around the rendered widget:

    packages/apostrophe/modules/@apostrophecms/widget-type/index.js:448-457

    if (hasStyles && self.options.stylesWrapper !== false) {
      const styles = self.apos.styles.prepareWidgetStyles(widget);
      const styleTag = self.apos.styles
        .getWidgetElements(styles, { scene: req.scene });
      const wrapperAttrs = self.apos.styles.getWidgetAttributes(styles);
    
      return `${styleTag}<div${wrapperAttrs ? ' ' + wrapperAttrs : ''}>${markup}</div>`;
    }
    

    Consequently, the injected attribute is present on normal public page renders, not only in the editor UI.

    Why the CVE-2026-33889 defense does not prevent this variant

    The sibling advisory led to a defense in getWidgetElements() that rewrites </ before CSS is inserted into a <style> element:

    css = css.replaceAll('</', '<\\/');
    

    This protects the style-element boundary. The vulnerable path above produces inline output instead of css, so it never reaches that replacement.

    Affected Configurations and Versions

    The verified configuration has all of the following properties:

    • A widget defines a style field with a free-form type such as string.
    • The field uses property without a selector, causing inline-style rendering, or uses class: true with an unrestricted string value.
    • The attacker has permission to edit a widget containing the field.
    • The malicious content is published, or a higher-privileged user views the affected draft.

    Standard range, select, and color presets do not directly provide an unrestricted quote-containing value and were not demonstrated as affected by this variant.

    Proof of Concept

    Step 1: Configure a widget with a free-form inline style

    Add a style field similar to the following to a widget module:

    module.exports = {
      extend: '@apostrophecms/widget-type',
      options: {
        label: 'Style Attribute Test'
      },
      styles: {
        add: {
          customFont: {
            type: 'string',
            label: 'Custom Font',
            property: 'font-family'
          }
        }
      }
    };
    

    The absence of selector makes the generated declaration inline.

    Step 2: Store the payload

    As a user who may edit this widget, enter the following value in customFont and save the widget:

    serif" tabindex="0" autofocus onfocus="document.body.dataset.inline='executed'
    

    Publish the page, or have another user view the affected draft.

    Step 3: Reproduce the renderer output directly

    The vulnerable data flow can also be reproduced using the real renderer and serializer from a checked-out, dependency-installed repository:

    const methodsFactory = require(
      './packages/apostrophe/modules/@apostrophecms/styles/lib/methods.js'
    );
    
    (async () => {
      const { renderScopedStyles } = await import(
        './packages/apostrophe/modules/@apostrophecms/styles/ui/apos/universal/render.mjs'
      );
    
      const payload =
        'serif" tabindex="0" autofocus ' +
        'onfocus="document.body.dataset.inline=\'executed\'';
    
      const styles = renderScopedStyles(
        [ {
          name: 'customFont',
          type: 'string',
          property: 'font-family'
        } ],
        { customFont: payload }
      );
    
      Object.assign(styles, {
        styleId: 'audit-inline',
        widgetId: 'widget-1'
      });
    
      const attrs = methodsFactory({}, {}).getWidgetAttributes(styles);
      console.log('inline:', styles.inline);
      console.log('attributes:', attrs);
    })();
    

    Step 4: Observe the unsafe HTML

    The current renderer produced:

    inline: font-family: serif" tabindex="0" autofocus onfocus="document.body.dataset.inline='executed';
    

    The serializer then produced an attrib

    Source: GitHub Security Advisories, NVD (NIST), cvelistv5

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    VendorProductAffected versionsFixed in
    apostrophecmsapostrophe
    • < 4.34.0
    • 4.34.0
    npmapostrophe
    • < 4.34.0
    • 4.34.0

    Weakness classes (CWE)

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

      Base

      The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

      Entry at MITRE CWE-79

    References & sources

    • github.comapostrophecms/apostrophe/commit/06e4b377f3c360f9e89c32dccd7e505…x_refsource_MISC
    • github.comapostrophecms/apostrophe/commit/40b989b1a9dd23d30029b8ce7668634…x_refsource_MISC
    • github.comapostrophecms/apostrophe/releases/tag/apostrophe@4.34.0x_refsource_MISC
    • github.comapostrophecms/apostrophe/security/advisories/GHSA-7jg5-frgc-c67wx_refsource_CONFIRM

    Reanalysis & status changes

    Chronological NVD audit events for this CVE — reanalyses, CVSS updates, CPE diffs.

    1. New CVE Receivedsecurity-advisories@github.com

      • Description: after ApostropheCMS is an open-source Node.js content management system. 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. The quote can terminate the style attribute and inject executable attributes when published content, or an affected draft viewed by a higher-privileged user, is rendered. This issue is fixed in version 4.34.0.
      • CVSS V3.1: after AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
      • CWE: after CWE-79
      • Affected: after New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/112xxx/CVE-2026-112958.json">CVE-2026-112958</a>
    2. CVE Modified134c704f-9b21-4f2e-91b3-4a467353bcc0

      • Reference: after https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-7jg5-frgc-c67w
      • SSVC: after {"id":"CVE-2026-112958","role":"CISA Coordinator","options":[{"exploitation":"poc"},{"automatable":"no"},{"technicalI…
    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2026-112958
    <a href="https://intel.neosec.eu/en/cve/CVE-2026-112958"><img src="https://intel.neosec.eu/badge/cve/CVE-2026-112958.svg?lang=en" alt="CVE-2026-112958 – NEOSEC Intel" height="20"></a>