CVE-2025-34146: @nyariv/sandboxjs Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-9qm3-6qrr-c76m
CWE-1321
Published
Advisory Summary

CVE-2025-34146 is a HIGH remote code execution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @nyariv/sandboxjs libraries in the npm ecosystem. The issue involves @nyariv/sandboxjs has prototype pollution vulnerability that may lead to rce. Remediation is available by upgrading affected packages to version 0.8.24.

CVE-2025-34146 at a Glance

CVE Identifier CVE-2025-34146
GHSA Identifier GHSA-9qm3-6qrr-c76m
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @nyariv/sandboxjs
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-34146

To remediate this vulnerability, upgrade all affected @nyariv/sandboxjs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@nyariv/sandboxjs fixed: 0.8.24
npm install @nyariv/sandboxjs@0.8.24
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @nyariv/sandboxjs

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-34146, inspect your project dependencies using npm:

npm ls @nyariv/sandboxjs

Analyze the terminal output to locate any version of @nyariv/sandboxjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.24), your application is affected.

Note: The npm ls @nyariv/sandboxjs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @nyariv/sandboxjs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-34146 Affected @nyariv/sandboxjs Versions

1 component(s)
Fixed Versions:
0.8.24
Product / Package Ecosystem Affected Versions Fixed Version
@nyariv/sandboxjs
npm
< 0.8.24
0.8.24

References

Frequently Asked Questions

What is CVE-2025-34146?
CVE-2025-34146 is a security vulnerability in @nyariv/sandboxjs involving @nyariv/sandboxjs has Prototype Pollution vulnerability that may lead to RCE under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @nyariv/sandboxjs versions are affected?
Affected versions include releases prior to 0.8.24 across affected packages: @nyariv/sandboxjs.
What version fixes CVE-2025-34146?
Upgrading to 0.8.24 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nyariv/sandboxjs affected?
Yes, @nyariv/sandboxjs is affected in releases prior to 0.8.24. Upgrade your dependency to 0.8.24 or later.
What CWE is associated with CVE-2025-34146?
CVE-2025-34146 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2025-34146?
Run the dependency tree command: 'npm ls @nyariv/sandboxjs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9qm3-6qrr-c76m",
  "modified" : "2025-07-31T19:28:27Z",
  "published" : "2025-07-31T15:35:50Z",
  "aliases" : [ "CVE-2025-34146" ],
  "summary" : "@nyariv/sandboxjs has Prototype Pollution vulnerability that may lead to RCE",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nyariv/sandboxjs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.24"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-34146"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nyariv/SandboxJS/issues/31"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/Hagrid29/9df27829a491080f923c4f6b8518d7e3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nyariv/SandboxJS"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/@nyariv/sandboxjs"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/nyariv-sandboxjs-prototype-pollution-sandbox-escape-dos"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-31T19:28:27Z",
    "nvd_published_at" : "2025-07-31T15:15:36Z"
  }
}