Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPoison default branch with malicious commits
-
DeliveryDeveloper clones/forks affected checkout
-
ExploitRun npm install triggers postinstall
-
Executioninstall.js fetches payload over TLS-disabled HTTPS
-
PersistEvaluate second-stage code as user
-
ImpactHarvest credentials and pivot to reachable systems
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Code review, malicious code detection
|
| Exploitation Conditions | Exploitation requires obtaining and installing a git checkout that still contains the malicious commits 9d8481a…748641b through 6f2dae0…674124 - specifically a local clone, fork, mirror, or direct-commit-SHA URL captured while the default branch was poisoned (2026-05-18 15:57:18 to 2026-05-19 15:24:34 UTC) - and then running |
| Impact | This is a genuine high-priority event, not a paper-high-CVSS issue, but its real-world blast radius is bounded by an unusual delivery path. The published CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N, VC/VI/VA:H, score 9.3) reflects full confidentiality/integrity/availability loss on the victim host, which is accurate given arbitrary code execution as the developer. However AC:L/UI:N overstates ease: the malicious commits were force-pushed out of the default branch within ~24 hours and the package was never on npm, so a normal |
| Exploit ScenarioDerived | A developer clones a fork or opens a direct-SHA URL of use-context-selector captured during the compromise window, or a CI/dev script pins an affected commit, and runs |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 10, 2026
Supply-chain compromise of the use-context-selector React library (npm package dai-shi/use-context-selector) planted attacker-controlled malicious code that runs during npm install. Between 2026-05-18 15:57:18 and 2026-05-19 15:24:34 UTC the GitHub default branch carried malicious commits (9d8481a through 6f2dae0) that added src/install.js, wired it into the postinstall hook, fetched a second-stage JavaScript payload from an attacker HTTPS endpoint with TLS verification disabled, and evaluated it with require available - but only on developer workstations (execution was deliberately skipped on CI and cloud/serverless). The commits were force-pushed out and the package was never published to npm, so there is no public exploit or CISA KEV entry, but any local clone, fork, or direct-SHA checkout retaining those commits will still execute the code on npm install today.
RemediationAI
The malicious commits were already removed from the upstream default branch by force-push (upstream fix available via git history rewrite; no tagged patched release version is applicable since the package was never published compromised), so the primary action is to purge affected checkouts rather than upgrade a version number: delete and re-clone any local clone/fork of dai-shi/use-context-selector, or git fetch and hard-reset to the current clean default branch, and verify that src/install.js and any postinstall entry referencing it are absent from package.json before installing. Any developer machine that ran npm install against an affected checkout on or after 2026-05-18 15:57:18 UTC must be treated as fully compromised: rotate every credential reachable from that host (SSH keys, cloud/API tokens, npm tokens, git credentials, browser-stored secrets), audit account and repository activity since 2026-05-18 15:57:18 UTC, and rebuild or forensically clean the machine. As a preventive compensating control, run installs with npm install --ignore-scripts to block postinstall execution (trade-off: packages that legitimately need build scripts will not compile and may require manual builds), and consider network egress restrictions so build environments cannot reach arbitrary attacker HTTPS endpoints. Details: https://github.com/dai-shi/use-context-selector/security/advisories/GHSA-7h6v-mwq6-jhm8.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The affected asset is use-context-selector, a userland React hook implementing selective Context subscriptions (useContextSelector) to avoid unnecessary re-renders - a build-time/developer dependency in the Node.js/npm ecosystem (CPE cpe:2.3:a:dai-shi:use-context-selector:*). The root cause is CWE-506 (Embedded Malicious Code): a deliberately introduced backdoor rather than a coding defect. It abuses npm's postinstall lifecycle hook, which npm executes automatically and with the installing user's full privileges. The malicious src/install.js performed a remote code fetch over HTTPS with certificate validation disabled (allowing trivial MITM/redirection of the payload source, which was also environment-variable configurable) and dynamically evaluated the returned code with require in scope, granting the fetched payload full Node module and filesystem/network access. The environment-gating logic (skip on CI, cloud, serverless) is a classic evasion technique to avoid sandbox/detection pipelines and concentrate impact on high-value developer machines holding credentials and source.
Know when Use Context Selector gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
AC:H and UI:R because the victim must obtain a non-default checkout retaining the force-removed commits and actively run npm install; full C/I/A loss as code runs with the developer's privileges.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
use-context-selector is a React useContextSelector hook in userland Between 2026-05-18 15:57:18 and 2026-05-19 15:24:34, the default branch contained malicious commits 9d8481a513b7b0d1c0941b220c69b25de748641b through 6f2dae054ca014068bdbbb4db96006424d674124 that executed remote attacker-controlled code on developer machines during npm install. The commits were removed by force-push, but local clones, forks, and direct-SHA URLs may still contain them, and npm install against an affected checkout will still execute the code today. The package was not published to npm. src/install.js was added and wired into the postinstall script. It fetched a JavaScript payload from an attacker-controlled HTTPS endpoint (configurable via an environment variable), disabled TLS verification, and evaluated the response as code with require available. Execution was deliberately skipped on CI and cloud/serverless environments, targeting developer workstations. The second-stage payload was attacker-hosted and cannot be reconstructed. Assume full compromise of anything reachable from a Node process with the user's permissions. Those who ran npm install against an affected checkout on a developer machine on or after 2026-05-18 15:57:18 should treat the machine as compromised, rotate every credential the machine could reach, audit account activity** since 2026-05-18 15:57:18, and clean local clones.
Articles & Coverage 1
Executive ViewAI
The dai-shi/use-context-selector React library was compromised with malicious code injected into its GitHub repository between May 18-19, 2026, executing on developer machines during npm install; while no public exploit has been confirmed, any local checkout of the affected commits remains vulnerable. Development teams who cloned the repository or referenced the compromised commits during this window face material risk of credential exposure and machine compromise. Organizations should immediately audit whether their development infrastructure accessed these commits and review the security posture of all systems those developers interact with.
No vendor-released patch identified at time of analysis. Interim mitigations include: (1) audit all Git repositories for references to commits 9d8481a-6f2dae0 and update to clean versions; (2) pin use-context-selector to pre-May 18, 2026 releases or discontinue use; (3) configure npm install to always use --ignore-scripts flag; (4) conduct forensic analysis of developer machines for compromise indicators; (5) implement mandatory commit signing and postinstall script execution restrictions.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
EUVD-2026-55661
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB