
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-34146 is a prototype pollution vulnerability in the @nyariv/sandboxjs npm package (versions <= 0.8.23) that allows attackers to inject arbitrary properties into Object.prototype via crafted JavaScript code, potentially causing a denial-of-service (DoS) condition or escaping the sandboxed execution environment. The vulnerability was discovered by researcher Hagrid29 and reported via a GitHub issue on April 12, 2025, with public disclosure and NVD publication on July 31, 2025. The patched version 0.8.24 was released concurrently with disclosure. It carries a CVSS v4.0 base score of 7.0 (High) (Github Advisory, VulnCheck).
The root cause is classified as CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes — Prototype Pollution). The flaw resides in the sandbox's executor logic (dist/node/executor.js), specifically in how it handles JavaScript function objects: when accessing "".sub.__proto__, the sandbox checks the prototype but incorrectly branches based on the type being function, causing hasOwnProperty of __proto__ to return false and bypassing the SandboxError check. A second bypass occurs because the payload {}.constructor.constructor("return true") is not matched by the regex used to detect and sandbox function declarations (dist/node/parser.js), allowing unsandboxed execution. A public PoC demonstrates the attack: "".sub.__proto__.__proto__.__defineGetter__('polluted', {}.constructor.constructor("return true")); executed within the sandbox successfully pollutes Object.prototype (Hagrid29 Gist, SandboxJS Issue #31).
Successful exploitation allows an attacker to inject arbitrary properties into Object.prototype, which affects all objects in the Node.js process sharing the same prototype chain. This can cause a denial-of-service condition by corrupting application logic that relies on prototype properties, and under certain conditions enables sandbox escape — potentially leading to remote code execution (RCE) in applications that use SandboxJS to safely execute untrusted JavaScript. Integrity of the vulnerable system is rated High, and availability is rated High, while confidentiality impact is assessed as None in the CVSS v4.0 scoring (Github Advisory, VulnCheck).
A public proof-of-concept is available via a GitHub Gist published by the discoverer (Hagrid29), demonstrating the prototype pollution payload (Hagrid29 Gist). There is no confirmed evidence of in-the-wild exploitation or threat actor attribution at this time (Github Advisory). The EPSS score is approximately 0.054% per Feedly data (1.459% per the GitHub Advisory, placing it at the 81st percentile), and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The vulnerability requires no privileges and no user interaction, lowering the bar for exploitation in any application that exposes SandboxJS to attacker-controlled input.
@nyariv/sandboxjs version <= 0.8.23 to execute user-supplied or attacker-controlled JavaScript code (e.g., a code sandbox, template engine, or scripting interface)."".sub.__proto__.__proto__.__defineGetter__('polluted', {}.constructor.constructor("return true"));sandbox.compile(code).run())."".sub.__proto__ (a function type) and does not detect {}.constructor.constructor(...) as a sandboxed function, allowing the payload to execute and inject the polluted property into Object.prototype.__defineGetter__/__defineSetter__ calls; error traces originating from dist/node/executor.js in the sandboxjs module.toString, valueOf, or custom properties), which may indicate Object.prototype has been polluted.Users should upgrade @nyariv/sandboxjs to version 0.8.24 or later, which contains the fix for this prototype pollution vulnerability (Github Advisory). As a workaround prior to patching, strictly validate and sanitize all JavaScript code submitted to the sandbox, and avoid exposing the sandbox to untrusted user input. Additionally, consider running the SandboxJS process in an isolated environment (e.g., a separate process or container) to limit the blast radius of a potential sandbox escape.
The vulnerability was assigned by VulnCheck and published to the GitHub Advisory Database on July 31, 2025, with the advisory noting the potential for RCE (Github Advisory). The original issue was filed by researcher Hagrid29 on the SandboxJS GitHub repository in April 2025, with a detailed technical write-up published as a public Gist (SandboxJS Issue #31). No significant broader media coverage or notable community debate has been observed beyond the technical disclosure.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."