CVE-2025-34146: CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in nyariv sandboxjs
A prototype pollution vulnerability exists in @nyariv/sandboxjs versions <= 0.8.23, allowing attackers to inject arbitrary properties into Object.prototype via crafted JavaScript code. This can result in a denial-of-service (DoS) condition or, under certain conditions, escape the sandboxed environment intended to restrict code execution. The vulnerability stems from insufficient prototype access checks in the sandbox’s executor logic, particularly in the handling of JavaScript function objects returned.
AI Analysis
Technical Summary
CVE-2025-34146 identifies a prototype pollution vulnerability in the @nyariv/sandboxjs JavaScript sandboxing library, affecting all versions up to 0.8.23. Prototype pollution occurs when an attacker can inject or modify properties on JavaScript's Object.prototype, which is the base object from which most objects inherit. This vulnerability arises due to insufficient validation in the sandbox's executor logic, particularly in the handling of JavaScript function objects returned within the sandboxed environment. By crafting malicious JavaScript code, an attacker can manipulate the prototype chain, injecting arbitrary properties that affect all objects inheriting from Object.prototype. This can lead to denial-of-service (DoS) conditions by corrupting application logic or data structures relying on object properties. More critically, under certain conditions, the attacker may escape the sandbox restrictions, allowing execution of unauthorized code outside the intended isolated environment. The vulnerability requires local access (AV:L) but no privileges (PR:N) or user interaction (UI:N), making it easier to exploit in environments where sandboxjs is used to isolate untrusted code. The CVSS 4.0 vector indicates high impact on confidentiality and integrity (VI:H, VA:H), with low attack complexity (AC:L). No patches are currently linked, and no known exploits have been reported in the wild, but the risk remains significant due to the nature of prototype pollution and sandbox escapes. This vulnerability is categorized under CWE-1321, highlighting improper control over object prototype attributes. Organizations relying on sandboxjs for secure code execution should urgently review their usage and apply mitigations once available.
Potential Impact
The impact of CVE-2025-34146 is substantial for organizations using @nyariv/sandboxjs to sandbox untrusted JavaScript code. Prototype pollution can corrupt application logic, leading to denial-of-service conditions that disrupt service availability. More severe is the potential sandbox escape, which undermines the fundamental security guarantee of code isolation. This can lead to unauthorized code execution, data leakage, or privilege escalation within the host environment. Since sandboxjs is often used in development tools, CI/CD pipelines, or web applications that execute third-party scripts, exploitation could compromise the integrity and confidentiality of sensitive data and systems. The vulnerability’s local attack vector means attackers need some level of access to the environment running sandboxjs, but no elevated privileges or user interaction are required, increasing the risk in multi-tenant or shared environments. The absence of known exploits in the wild suggests limited current exploitation but does not diminish the urgency for mitigation, especially as exploit techniques for prototype pollution are well understood. Organizations globally that embed sandboxjs in their software stacks face risks of service disruption, data compromise, and broader security breaches if this vulnerability is exploited.
Mitigation Recommendations
To mitigate CVE-2025-34146, organizations should first monitor for and apply any official patches or updates from the @nyariv/sandboxjs maintainers once released. In the absence of patches, consider the following specific measures: 1) Restrict access to environments running sandboxjs to trusted users only, minimizing the risk of local exploitation. 2) Implement strict input validation and sanitization on any code or data passed into the sandbox to reduce the chance of malicious prototype pollution payloads. 3) Employ runtime monitoring to detect anomalous modifications to Object.prototype or unexpected behavior indicative of prototype pollution or sandbox escape attempts. 4) Use alternative sandboxing libraries with proven security track records if immediate patching is not feasible. 5) Isolate sandboxjs execution environments using containerization or virtualization to limit the blast radius of potential escapes. 6) Conduct thorough code audits focusing on prototype manipulation and sandbox boundary enforcement. 7) Educate developers and security teams about prototype pollution risks and secure coding practices related to JavaScript sandboxing. These targeted mitigations go beyond generic advice by focusing on containment, detection, and prevention specific to prototype pollution and sandbox escape vectors.
Affected Countries
United States, Germany, United Kingdom, France, Japan, South Korea, India, Canada, Australia, Netherlands
CVE-2025-34146: CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in nyariv sandboxjs
Description
A prototype pollution vulnerability exists in @nyariv/sandboxjs versions <= 0.8.23, allowing attackers to inject arbitrary properties into Object.prototype via crafted JavaScript code. This can result in a denial-of-service (DoS) condition or, under certain conditions, escape the sandboxed environment intended to restrict code execution. The vulnerability stems from insufficient prototype access checks in the sandbox’s executor logic, particularly in the handling of JavaScript function objects returned.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2025-34146 identifies a prototype pollution vulnerability in the @nyariv/sandboxjs JavaScript sandboxing library, affecting all versions up to 0.8.23. Prototype pollution occurs when an attacker can inject or modify properties on JavaScript's Object.prototype, which is the base object from which most objects inherit. This vulnerability arises due to insufficient validation in the sandbox's executor logic, particularly in the handling of JavaScript function objects returned within the sandboxed environment. By crafting malicious JavaScript code, an attacker can manipulate the prototype chain, injecting arbitrary properties that affect all objects inheriting from Object.prototype. This can lead to denial-of-service (DoS) conditions by corrupting application logic or data structures relying on object properties. More critically, under certain conditions, the attacker may escape the sandbox restrictions, allowing execution of unauthorized code outside the intended isolated environment. The vulnerability requires local access (AV:L) but no privileges (PR:N) or user interaction (UI:N), making it easier to exploit in environments where sandboxjs is used to isolate untrusted code. The CVSS 4.0 vector indicates high impact on confidentiality and integrity (VI:H, VA:H), with low attack complexity (AC:L). No patches are currently linked, and no known exploits have been reported in the wild, but the risk remains significant due to the nature of prototype pollution and sandbox escapes. This vulnerability is categorized under CWE-1321, highlighting improper control over object prototype attributes. Organizations relying on sandboxjs for secure code execution should urgently review their usage and apply mitigations once available.
Potential Impact
The impact of CVE-2025-34146 is substantial for organizations using @nyariv/sandboxjs to sandbox untrusted JavaScript code. Prototype pollution can corrupt application logic, leading to denial-of-service conditions that disrupt service availability. More severe is the potential sandbox escape, which undermines the fundamental security guarantee of code isolation. This can lead to unauthorized code execution, data leakage, or privilege escalation within the host environment. Since sandboxjs is often used in development tools, CI/CD pipelines, or web applications that execute third-party scripts, exploitation could compromise the integrity and confidentiality of sensitive data and systems. The vulnerability’s local attack vector means attackers need some level of access to the environment running sandboxjs, but no elevated privileges or user interaction are required, increasing the risk in multi-tenant or shared environments. The absence of known exploits in the wild suggests limited current exploitation but does not diminish the urgency for mitigation, especially as exploit techniques for prototype pollution are well understood. Organizations globally that embed sandboxjs in their software stacks face risks of service disruption, data compromise, and broader security breaches if this vulnerability is exploited.
Mitigation Recommendations
To mitigate CVE-2025-34146, organizations should first monitor for and apply any official patches or updates from the @nyariv/sandboxjs maintainers once released. In the absence of patches, consider the following specific measures: 1) Restrict access to environments running sandboxjs to trusted users only, minimizing the risk of local exploitation. 2) Implement strict input validation and sanitization on any code or data passed into the sandbox to reduce the chance of malicious prototype pollution payloads. 3) Employ runtime monitoring to detect anomalous modifications to Object.prototype or unexpected behavior indicative of prototype pollution or sandbox escape attempts. 4) Use alternative sandboxing libraries with proven security track records if immediate patching is not feasible. 5) Isolate sandboxjs execution environments using containerization or virtualization to limit the blast radius of potential escapes. 6) Conduct thorough code audits focusing on prototype manipulation and sandbox boundary enforcement. 7) Educate developers and security teams about prototype pollution risks and secure coding practices related to JavaScript sandboxing. These targeted mitigations go beyond generic advice by focusing on containment, detection, and prevention specific to prototype pollution and sandbox escape vectors.
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2025-04-15T19:15:22.564Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 688b891aad5a09ad00b91987
Added to database: 7/31/2025, 3:17:46 PM
Last enriched: 3/24/2026, 12:27:17 AM
Last updated: 3/25/2026, 1:29:45 AM
Views: 160
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.