← Back to CVE Explorer

CVE-2026-48158

Full vulnerability record from the local CVENow database.

Description

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.

Severity
CRITICAL
CVSS score
9.3 (v4.0)
Vulnerability status
Deferred
Source identifier
Published
2026-08-10 16:19:48.117000
Last modified
2026-10-23 20:10:00.160000
View original CVE JSON
{
  "id": "CVE-2026-48158",
  "sourceIdentifier": "[email protected]",
  "published": "2026-08-10T16:19:48.117",
  "lastModified": "2026-10-23T20:10:00.160",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "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\n`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."
    },
    {
      "lang": "es",
      "value": "use-context-selector es un hook de React useContextSelector en el espacio de usuario. Entre el 18-05-2026 15:57:18 y el 19-05-2026 15:24:34, la rama predeterminada contenía commits maliciosos 9d8481a513b7b0d1c0941b220c69b25de748641b hasta 6f2dae054ca014068bdbbb4db96006424d674124 que ejecutaban código remoto controlado por el atacante en máquinas de desarrolladores durante ’npm install’. Los commits fueron eliminados mediante un ’force-push’, pero los clones locales, las bifurcaciones y las URL de SHA directas aún pueden contenerlos, y ’npm install’ contra una copia afectada aún ejecutará el código hoy. El paquete no fue publicado en npm. ’src/install.js’ fue añadido y conectado al script ’postinstall’. Recuperó una carga útil de JavaScript de un punto final HTTPS controlado por el atacante (configurable mediante una variable de entorno), deshabilitó la verificación TLS y evaluó la respuesta como código con ’require’ disponible. La ejecución fue omitida deliberadamente en entornos de CI y de nube/sin servidor, apuntando a estaciones de trabajo de desarrolladores. La carga útil de segunda etapa fue alojada por el atacante y no puede ser reconstruida. Asuma un compromiso total de cualquier cosa accesible desde un proceso de Node con los permisos del usuario. Aquellos que ejecutaron ’npm install’ contra una copia afectada en una máquina de desarrollador el o después del 18-05-2026 15:57:18 deben tratar la máquina como comprometida, rotar cada credencial a la que la máquina pudo acceder, auditar la actividad de la cuenta desde el 18-05-2026 15:57:18, y limpiar los clones locales."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "dai-shi",
          "product": "use-context-selector",
          "versions": [
            {
              "version": ">= 9d8481a513b7b0d1c0941b220c69b25de748641b, <= 6f2dae054ca014068bdbbb4db96006424d674124",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV40": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "4.0",
          "vectorString": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
          "baseScore": 9.3,
          "baseSeverity": "CRITICAL",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "attackRequirements": "NONE",
          "privilegesRequired": "NONE",
          "userInteraction": "NONE",
          "vulnConfidentialityImpact": "HIGH",
          "vulnIntegrityImpact": "HIGH",
          "vulnAvailabilityImpact": "HIGH",
          "subConfidentialityImpact": "NONE",
          "subIntegrityImpact": "NONE",
          "subAvailabilityImpact": "NONE",
          "exploitMaturity": "NOT_DEFINED",
          "confidentialityRequirement": "NOT_DEFINED",
          "integrityRequirement": "NOT_DEFINED",
          "availabilityRequirement": "NOT_DEFINED",
          "modifiedAttackVector": "NOT_DEFINED",
          "modifiedAttackComplexity": "NOT_DEFINED",
          "modifiedAttackRequirements": "NOT_DEFINED",
          "modifiedPrivilegesRequired": "NOT_DEFINED",
          "modifiedUserInteraction": "NOT_DEFINED",
          "modifiedVulnConfidentialityImpact": "NOT_DEFINED",
          "modifiedVulnIntegrityImpact": "NOT_DEFINED",
          "modifiedVulnAvailabilityImpact": "NOT_DEFINED",
          "modifiedSubConfidentialityImpact": "NOT_DEFINED",
          "modifiedSubIntegrityImpact": "NOT_DEFINED",
          "modifiedSubAvailabilityImpact": "NOT_DEFINED",
          "Safety": "NOT_DEFINED",
          "Automatable": "NOT_DEFINED",
          "Recovery": "NOT_DEFINED",
          "valueDensity": "NOT_DEFINED",
          "vulnerabilityResponseEffort": "NOT_DEFINED",
          "providerUrgency": "NOT_DEFINED"
        }
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-08-11T01:55:43.542457Z",
          "id": "CVE-2026-48158",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "yes"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-506"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/dai-shi/use-context-selector/security/advisories/GHSA-7h6v-mwq6-jhm8",
      "source": "[email protected]"
    }
  ]
}