External risk intelligence

use-context-selector Malicious Commits Compromise Developer Machines During Install

CVE advisorySeverity: CRITICAL (CVSS 9.3)

CVE-2026-48158

This vulnerability is limited to local developer environments during the software development lifecycle. It requires the execution of 'npm install' on a developer machine using an affected local repository clone; it is not a public-facing service, network-reachable endpoint, or deployed application component.

Halo Surface Signal: 1 out of 5 — much less likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

A security issue was discovered in a React hook for managing context, where malicious code could be executed on developer machines during the installation process. This occurred through compromised commits that were later removed but could persist in local copies of the code. The vulnerability was designed to target developer workstations and bypass security checks in CI/CD environments.

  • Malicious code executed during installation on developer machines.
  • Targeted developer workstations, not deployed applications.
  • Confirm relevance and exposure in development environments.

Attack Path

How an attacker could exploit the issue

Attackers could compromise developer machines by injecting malicious code through a compromised package installation process. This attack starts when a developer clones a repository or uses a direct SHA URL containing malicious commits that alter the package's installation script. When `npm install` is run, it fetches and executes arbitrary code from an attacker-controlled server, potentially leading to a full compromise of the developer's machine.

  • Requires local repository clone.
  • Triggers via `npm install` script.
  • Results in full machine compromise.

Live Threat

Current exploitation, exposure, and threat context

This vulnerability could affect developer machines when they install the package from a compromised source. The malicious commits could lead to remote attacker-controlled code execution on these machines during the installation process.

  • Developer machine code execution.
  • Running `npm install` on affected code.
  • Full compromise of the machine.

Operational Fix

Recommended remediation, mitigation, and detection steps

This vulnerability impacts developer workstations through malicious commits to a userland React hook's default branch. The initial compromise occurs during `npm install` on affected local clones or forks, allowing remote code execution. The primary concern is the potential for full compromise of developer machines and any systems or credentials accessible from them.

  • Ownership: Application developers and security teams.
  • Verify: Affected local repository clones and developer machines.
  • Action: Rotate credentials and clean compromised machines.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is the use-context-selector package?

use-context-selector is a React library providing a hook to manage component state. Developers use it to optimize re-renders in applications by allowing components to subscribe to specific parts of a context rather than the entire object. While popular for frontend performance, this security issue specifically affects the underlying source code repository used by developers, rather than the library's functionality when deployed in a production web application.

What does CWE-506 mean for CVE-2026-48158?

CWE-506 refers to Embedded Malicious Code. In the context of this CVE, it means the repository's source code was intentionally modified by unauthorized actors to include a hidden backdoor. When a developer runs the package's installation commands, this malicious code silently runs in the background, executing commands on the machine with the developer's own access rights.

How is this malicious code triggered?

The exploit executes automatically when a developer runs 'npm install' within an affected local repository clone, fork, or specific SHA version of the code. The malicious script was designed to specifically look for developer workstations and intentionally avoids running if it detects a CI/CD, cloud, or serverless environment. Simply having the code on your machine is not enough; the installation process must be executed for the payload to trigger.

Is my production environment at risk?

According to Halo Surface Signal, this vulnerability is very unlikely to affect production systems because it is constrained to local developer environments during the software development lifecycle. It does not manifest as a public-facing service or a network-reachable endpoint. The primary risk is to the developer's local machine and any internal credentials or systems that the developer's account has permission to access.

What should I do if I ran npm install on affected code?

Treat the affected developer machine as fully compromised. You should immediately rotate every credential—such as SSH keys, API tokens, and passwords—that the machine could access. Conduct a thorough audit of account activity since May 18, 2026, to identify potential unauthorized actions, and ensure all local clones of the repository are deleted and replaced with clean, verified versions.

References