New MCP server — Bring vulnerability intelligence into your AI
Back to feed

CVE-2024-47061

NVDCIRCLENISA

EUVD-2024-2743 · Published Sep 20, 2024

Plate allows arbitrary DOM attributes in element.attributes and leaf.attributes

Impact

One longstanding feature of Plate is the ability to add custom DOM attributes to any element or leaf using the attributes property. These attributes are passed to the node component using the nodeProps prop.

Note: The attributes prop that is typically rendered alongside nodeProps is unrelated.

[{
  type: 'p',
  attributes: { 'data-my-attribute': 'This will be rendered on the paragraph element' },
  children: [{
    bold: true,
    attributes: { 'data-my-attribute': 'This will be rendered on the bold leaf element' },
    text: 'Bold text',
  }],
}]
const ParagraphElement = ({ attributes, nodeProps, children }) => (
  <p
    {...attributes}
    {...nodeProps} // Arbitrary DOM attributes are injected here
  >
    {children}
  </p>
);

const BoldLeaf = ({ attributes, nodeProps, children }) => (
  <strong
    {...attributes}
    {...nodeProps} // Arbitrary DOM attributes are injected here
  >
    {children}
  </strong>
);

It has come to our attention that this feature can be used for malicious purposes, including cross-site scripting (XSS) and information exposure (specifically, users' IP addresses and whether or not they have opened a malicious document).

Note that the risk of information exposure via attributes is only relevant to applications in which web requests to arbitrary URLs are not ordinarily allowed. Plate editors that allow users to embed images from arbitrary URLs, for example, already carry the risk of leaking users' IP addresses to third parties.

All Plate editors using an affected version of @udecode/plate-core are vulnerable to these information exposure attacks via the style attribute and other attributes that can cause web requests to be sent.

In addition, whether or not a Plate editor is vulnerable to cross-site scripting attacks using attributes depends on a number of factors. The most likely DOM attributes to be vulnerable are href and src on links and iframes respectively. Any component that spreads {...nodeProps} onto an <a> or <iframe> element and does not later override href or src will be vulnerable to XSS.

<a
  href={sanitizedHref}
  {...attributes}
  {...nodeProps} // Definitely vulnerable to XSS since `href` can be overridden
>
<a
  {...attributes}
  {...nodeProps} // Probably not vulnerable to XSS via `href`
  href={sanitizedHref}
>
<a
  {...attributes}
  {...nodeProps} // May be vulnerable to XSS via `href` if `href` is sometimes omitted from `sanitizedLinkProps`
  {...sanitizedLinkProps}
>

React does not allow passing a string to event handler props like onClick, so these are unlikely (but not impossible) to be vulnerable.

The attack surface is larger for users running older browsers, which may be vulnerable to XSS in DOM attributes that are less dangerous (although still vulnerable to information exposure) in modern browsers such as style or background.

Potential attack vectors for delivering malicious Slate content to users include:

  • Opening a malicious document stored on the server
  • Pasting a malicious Slate fragment into a document
  • Receiving malicious Slate operations on a collaborative document

Patches

In patched versions of Plate, we have disabled element.attributes and leaf.attributes for most attribute names by default, with some exceptions including target, alt, width, height, colspan and rowspan on the link, image, video, table cell and table header cell plugins.

If this is a breaking change for you, you can selectively re-enable attributes for certain plugins as follows. Please carefully research and assess the security implications of any attribute you allow, as even seemingly innocuous attributes such as style can be used maliciously.

Plate >= 37

For custom plugins, specify the list of allowed attribute names in the node.dangerouslyAllowAttributes plugin configuration option.

const ImagePlugin = createPlatePlugin({
  key: 'image',
  node: {
    isElement: true,
    isVoid: true,
    dangerouslyAllowAttributes: ['alt'],
  },
});

To modify an existing plugin, use the extend method.

const MyImagePlugin = ImagePlugin.extend({
  node: {
    dangerouslyAllowAttributes: ['alt'],
  },
});

Plate < 37

Note that the patch has been backported to versions @udecode/plate-core@21.5.1 and @udecode/plate-core@36.5.9 only.

For custom plugins, specify the list of allowed attribute names in the dangerouslyAllowAttributes plugin configuration option.

const createImagePlugin = createPluginFactory({
  key: 'image',
  isElement: true,
  isVoid: true,
  dangerouslyAllowAttributes: ['alt'],
});

To modify an existing plugin, pass dangerouslyAllowAttributes to the plugin factory.

createImagePlugin({
  dangerouslyAllowAttributes: ['alt'],
});

Workarounds

If you are unable to upgrade to any of the patched versions, you should use a tool like patch-package or yarn patch to remove the logic from @udecode/plate-core that adds attributes to nodeProps.

This logic can be found in the getRenderNodeProps function and looks something like this. The entire if statment can safely be removed.

  if (!newProps.nodeProps && attributes) {
    newProps.nodeProps = attributes;
  }

After applying the patch, be sure to test its effectiveness by rendering a Slate value containing an attributes property on some element.

[{
  type: 'p',
  attributes: { 'data-vulnerable': true },
  children: [{ text: 'My paragraph' }],
}]

If the patch was successful, the data-vulnerable="true" attribute should not be present on any DOM element when the Plate editor is rendered in the browser.

Technologies

Udecode Plate-Core

Weaknesses

CWE-79

CVSS scores

  • v3.18.3CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L

MITRE ATT&CK

Inferred

Where this vulnerability fits in an attack

Initial Access

References

Potentially impacted assets

See if this affects your attack surface

Latest trending attack

Criticalyesterday

Google Brotli decoder - Remote Code Execution via compressed requests (Exploitation Check)

This control is the second step of the Patrowl response to CVE-2026-111497 (Node2Shell). It complements the first control of 22 October 2026, which focused on the Node.js runtime, and does not replace it. Why a second control CVE-2026-111497 is an out-of-bounds write in the Google Brotli decoder, the library that decompresses Brotli ("br") data. It was first published as a Node.js vulnerability, because Node.js bundles this decoder. Later publications showed that the flaw is in the library itself. Every product that embeds an affected version of the decoder is concerned, whatever its language or vendor. A public proof of concept demonstrates code execution. Any server that decompresses request bodies sent with "Content-Encoding: br" exposes the decoder to unauthenticated attackers. Known cases include Express 5 and NestJS 11 on Node.js, Koa and Fastify setups, Bun, Envoy and Istio with request decompression enabled, and any application or reverse proxy that decodes Brotli request bodies with an affected library. The flaw also works in the other direction. A malicious server can compromise an unpatched client that decodes a Brotli response, for example Node.js fetch(), Python clients (requests, httpx, aiohttp, Scrapy) with the Brotli or brotlicffi package, or libcurl builds with Brotli support. What this control checks Patrowl sends small, valid Brotli-compressed requests to each asset and observes whether the server decodes them. The check does not depend on the technology: it detects the behaviour, whatever the stack behind it. These requests are what any legitimate client could send. They never reach the vulnerable code path and cannot affect the availability of the service. How to read the result Potentially impacted means the asset decodes Brotli request bodies: the attack surface is exposed. It does not confirm that the asset is vulnerable. The version of the Brotli decoder in use is not visible from the outside. This check covers applications that parse request bodies on their root path. A Not impacted result does not rule out exposure on other routes, nor on the client side. Checking the versions on the servers remains the only exhaustive verification. Two situations are possible. When the decoding is done by your own application or reverse proxy, identify the component and update it. If an update is not possible right away, reject requests with "Content-Encoding: br" at the reverse proxy or WAF. When the asset is hosted on a managed platform or behind a CDN (for example Platform.sh, Upsun or Fastly), the decoding may be done by the provider's edge router, in front of your application. You cannot patch it yourself, but this router handles all the traffic of your site. Ask your provider to confirm that its edge components are patched against CVE-2026-111497. Assets hosted on a managed platform or behind a CDN carry the tag "paas: platform.sh" or "cdn: fastly" in the asset view: for these assets, the Brotli decoding is done by the provider's edge router, in front of your application, and only the provider can patch it. Affected and fixed versions Google Brotli 1.0.3 to 1.2.0 are affected, fixed in 1.0.10, 1.1.1 and 1.2.1. Fixed releases of the main products embedding it: Node.js 22.23.4, 24.22.1 and 26.12.1 (end-of-life lines 20.x and older and 25.x receive no fix), Bun 1.4.4, Envoy 1.37.8, 1.38.6, 1.39.3 and 1.40.0, Istio 1.29.9, 1.30.6 and 1.31.2, Python Brotli 1.2.1 and brotlicffi 1.2.1.0. Products that link against the system library depend on the Brotli package of the Linux distribution. Recommendations Update every component that embeds the Brotli decoder (only real fix). Start with the assets flagged by this control. Restart the processes after the update. Rebuild containers, single-executable applications and appliances that bundle an affected runtime or library. Reduce the exposure until the update is deployed. Reject requests with "Content-Encoding: br" at the reverse proxy, load balancer or WAF, case-insensitively and including lists such as "gzip, br". On Envoy and Istio, disable request decompression for Brotli. Contact your edge provider about the status of the pathing (Fastly / Plateform.sh) Review outbound calls. List the features that fetch content from servers you do not control, and patch the services that host them first.

Take 15 minutes to discover our platform with our experts

PatrowlIntel platform screenshot