web-js-env-patcher
Audited by Socket on Jun 23, 2026
7 alerts found:
Securityx3Anomalyx4No explicit malicious payload (no network exfiltration, credential theft, or process/file tampering) is visible in this fragment. The dominant supply-chain/security concern is the dynamic require(p) of an optional native addon from package-local candidate paths (and potentially from externally provided addon/path/candidates). If the native addon artifact is compromised or path selection can be influenced, the component can become a high-impact RCE vector. Additionally, Proxy-based interception and “undetectable”/NativeProtect themed behavior indicate capability to heavily manipulate runtime semantics, though intent to steal data is not proven by this code alone.
This fragment functions as a dual-use sandbox/tracing harness for running target JS under a mocked browser environment, recording interactions and reporting missing globals. It stubs fetch to prevent real network requests and does not show explicit exfiltration, credential theft, persistence, or system damage. The main risks are (1) executing arbitrary target scripts via vm, (2) using high-risk dynamic evaluation (Function/constructor.constructor) for a leakage/probe test, and (3) potential local sensitive-data exposure via trace/outputs because fixture cookies/storage can be accessed and potentially recorded.
The code is a powerful browser instrumentation/hooking template for authorized debugging of signature/encryption parameters. It does not implement explicit exfiltration or system compromise, but it substantially increases the chance of sensitive data exposure (tokens/signatures/fingerprints/cookies) and can disrupt application logic via `debugger`. If introduced into a production or untrusted context (e.g., via supply-chain tampering or unexpected execution), it could be repurposed for reconnaissance and secret harvesting from client-side data flows. Recommend treating as high-risk instrumentation code if shipped/enabled in unintended environments.
No clear malware indicators (no eval/new Function, no network activity, no credential handling, no filesystem modification) are present in this wrapper itself. The main security concern is high-impact by design: it can load and initialize a native .node binary whose path is influenced by CLI arguments, meaning native code will execute in the current environment if an attacker can supply an untrusted binary path. Additionally, it prints detailed error and path information to stdout/CI logs. Security assessment of malicious intent within the native loader cannot be confirmed from this file alone.