Skip to main content

use-context-selector CVE-2026-48158

| EUVDEUVD-2026-55661 CRITICAL
Embedded Malicious Code (CWE-506)
2026-08-10 GitHub_M
9.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Poison default branch with malicious commits
  2. Delivery
    Developer clones/forks affected checkout
  3. Exploit
    Run npm install triggers postinstall
  4. Execution
    install.js fetches payload over TLS-disabled HTTPS
  5. Persist
    Evaluate second-stage code as user
  6. Impact
    Harvest 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 npm install (or any install that triggers the postinstall hook) against it. Additional required condition: outbound HTTPS reachability from the Node process to the attacker-controlled payload endpoint. Key LIMITING factors: the malicious code deliberately does NOT execute on CI or cloud/serverless environments (it targets interactive developer workstations only), the code was never published to npm so registry installs are safe, and the commits were force-removed from upstream so a fresh default-branch clone is not affected - meaning a non-default source (retained/forked history or pinned SHA) is a hard prerequisite.

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 npm install use-context-selector from the registry or a fresh default-branch clone is NOT affected - exploitation now requires possessing a checkout, fork, or direct-SHA URL that still contains the malicious SHAs and then running an install against it, which in practice means user action and a non-default source. There is no CISA KEV listing and no reconstructable public exploit (the second stage was attacker-hosted and is gone), so this is not evidence of broad active exploitation; risk is concentrated among the specific set of developers who cloned/forked during the ~24-hour window. Anyone who did run npm install against an affected checkout on or after 2026-05-18 15:57:18 UTC should treat the workstation as fully compromised - even a small mid-sized operator or dev team fitting that profile should treat cleanup and credential rotation as urgent - because a single infected developer machine can pivot to source repos, cloud keys, and CI secrets.

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 npm install. The postinstall hook silently fetches and evaluates the attacker's second-stage payload with the developer's privileges, which then harvests SSH keys, cloud tokens, and npm credentials and can pivot into source repositories and cloud accounts - with no public POC to reproduce since the second stage is no longer hosted.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

use-context-selector 9d8481a513b7b0d1c0941b220c69b25de748641b, ≤ 6f2dae054ca014068bdbbb4db96006424d674124

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

Vendor (GitHub_M) PRIMARY 9.3 CRITICAL
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
vuln.today AI 7.5 HIGH

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.

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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.

Executive ViewAI

Why It Matters

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.

Business Impact: Severe
Compensating Controls

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

EPSS Score
0.4%
Top 67% exploitable
Prevalence
Medium
popular React state library, but compromised state confined to short git window
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy