Malicious postinstall RCE in use-context-selector
CVE-2026-48158 is a software supply-chain compromise affecting the default branch of the use-context-selector project during a limited time window in May 2026. Malicious commits introduced a postinstall execution path that caused npm install against an affected source checkout to run attacker-controlled code on developer workstations. The implanted logic added an install script that retrieved a second-stage JavaScript payload from an attacker-controlled HTTPS source, disabled TLS certificate verification, and evaluated the returned code with Node.js module loading capabilities available. The malicious logic was designed to avoid execution in CI and cloud or serverless environments, indicating deliberate targeting of interactive developer systems. Although the malicious commits were later removed from the default branch, affected local clones, forks, and direct commit-based checkouts can still contain the implant and remain dangerous if dependency installation is performed. The package was not published to the npm registry.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation results in arbitrary remote code execution in the context of the user running npm install on an affected checkout. Because the second-stage payload was attacker-hosted and is not recoverable, the practical impact must be treated as full compromise of the developer machine and any assets reachable with that user’s permissions from the Node.js process. This can include theft of source code, credentials, tokens, SSH material, cloud access, browser-stored secrets, and other local or network-accessible data, as well as installation of persistence or follow-on tooling. The selective avoidance of CI and cloud environments suggests the attack was optimized for compromising developer endpoints rather than build infrastructure.
If you can’t patch tonight, do this now.
Until clean source provenance is confirmed, avoid running npm install or any lifecycle scripts against historical or untrusted checkouts of the project. Disable or restrict execution of package lifecycle scripts where operationally feasible, especially for source-based evaluations of third-party repositories. Enforce repository integrity verification, pin to trusted release artifacts rather than mutable branch heads, and monitor for unexpected install-time script additions in dependency reviews. Developer workstations should use least-privilege access, segmented credentials, and secret isolation to reduce blast radius from install-time code execution.
Patch, then assume compromise.
Remove and replace any affected local clones, forks, or source checkouts that may still contain the malicious commits. Re-clone only from a known-clean repository state. Any system on which npm install was executed against an affected checkout during or after the exposure window should be treated as compromised and rebuilt or otherwise remediated according to incident-response standards for full workstation compromise. Rotate all credentials, tokens, keys, and secrets that were accessible from the affected machine, and review account and infrastructure activity beginning from the start of the exposure period. Validate repository history and dependency installation scripts before restoring developer workflows.
No public exploits tracked yet. Mallory keeps watching.
2 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.