# Node.js Windows Module Resolution Privilege Escalation via C:\node_modules Planting (CVE-2026-0775, CVE-2026-0776)

> Node.js's module resolution algorithm on Windows traverses up to the filesystem root and treats C:
ode_modules as a legitimate search location. Because unprivileged Windows users can create this directory, a local low-privileged attacker can plant a malicious module there to gain code execution in the context of a higher-privileged user when a vulnerable application with missing/optional dependencies launches. npm CLI (prior to v11.2.0, CVE-2026-0775) and Discord desktop client (CVE-2026-0776) are confirmed affected; Discord remains unpatched as of publication.

- **Published:** 2026-04-08T00:00:00Z
- **Last reviewed:** 2026-04-08T00:00:00Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-1548
- **Card image:** https://intel.threadlinqs.com/og/threat/threat-intel-npm-cli-windows-node-modules-lpe-tl-2026-1548.webp?v=5b7f6150 (Threadlinqs threat intel: CVE-2026-0775 npm CLI Windows Privesc: Detection & IOCs (TL-2026-1548) — High severity, 15 IOCs, 9 detection rules.)
- **ID:** TL-2026-1548
- **Severity:** HIGH (CVSS 7.8)
- **Category:** VULNERABILITY
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 15
- **CVEs:** CVE-2026-0775, CVE-2026-0776

## Description

Node.js's CommonJS module resolution algorithm walks the directory tree upward from the requiring module's location, checking each ancestor directory for a node_modules folder, until it reaches the filesystem root. On POSIX systems the root-level /node_modules directory requires superuser privileges to create, which effectively closes off this final search location as an attack surface. On Windows, however, any unprivileged, standard user account can create C:\node_modules without elevation, because Windows does not restrict directory creation at the drive root the way UNIX restricts writes to /. Node.js maintainers are aware of this behavior (tracked informally since 2013-2014) and have explicitly classified it as a non-vulnerability / working-as-intended design decision, stating that "Node.js trusts the file system in the environment accessible to it" and mapping the underlying weakness to CWE-427 (Uncontrolled Search Path Element) without committing to a runtime fix.

The practical exploitation vector is the widespread JavaScript pattern of "optional dependencies" — packages wrapped in try/catch blocks so that a missing package degrades gracefully rather than crashing the application. Node's require() call still walks the full search path (including C:\node_modules) before the exception is thrown and caught, meaning any planted module at that location is loaded and executed with the privileges of the process performing the require() — even though the developer's intent was for the missing-package case to be silently ignored.

CVE-2026-0775 affects the npm CLI (ZDI-26-043 / ZDI-CAN-25430, CVSS 7.8, CWE-732 Incorrect Permission Assignment for Critical Resource). npm's dependency 'promise-inflight' carries an optional dependency on 'bluebird', which is not bundled with the default Windows Node.js/npm installation. An attacker who first obtains low-privileged code execution (or simply an unprivileged account) can plant C:\node_modules\bluebird.js; any user who subsequently runs npm commands (npm install, npm -l, npm prune, etc.) on that host will execute the attacker's payload in their own user context — a classic local privilege escalation path when a higher-privileged user (e.g., a developer or admin running npm as part of a build/deploy process) is the one invoking npm. ZDI reported this to the npm/Node.js maintainers on 2024-11-13; the vendor acknowledged the report but deemed the behavior intentional. ZDI requested reconsideration on 2025-08-05, announced intent to publish as a 0-day on 2025-12-18, and published the advisory on 2026-01-12 (updated 2026-02-02). npm CLI 11.2.0 subsequently shipped a fix (tracked publicly in npm/cli issue #8939) removing/adjusting the vulnerable optional-dependency resolution path.

CVE-2026-0776 affects the Discord desktop client (ZDI-26-040 / ZDI-CAN-27057, CVSS 7.3, CWE-427). Discord's discord_rpc module depends on the 'ws' WebSocket library, which carries an optional dependency on 'utf-8-validate' for compatibility with older Node.js versions where native UTF-8 validation is unavailable. Because Discord auto-starts on user login by default and is one of the most widely installed consumer applications on Windows, an attacker who plants C:\node_modules\utf-8-validate.js achieves code execution in the victim's user context essentially every time Discord launches — including automatically at every login, without any further user interaction beyond the initial system compromise needed to write the file. ZDI reported this to Discord on 2025-07-08; Discord disputed the classification and reaffirmed on 2025-09-15 and 2025-12-10 that local-attack scenarios are out of scope for its bug bounty program. ZDI announced intent to publish as a 0-day on 2025-12-11 and released the public advisory on 2026-01-09, with the researcher publicly demonstrating exploitation via a proof-of-concept video showing calc.exe execution triggered purely by launching Discord. As of publication, Discord remains unpatched and has stated no fix is planned; the only mitigation is restricting/monitoring interaction with the product, or setting the WS_NO_UTF_8_VALIDATE environment variable to short-circuit the optional-dependency load path.

Beyond the two confirmed/published CVEs, ZDI's broader research (published as the blog post "Node.js Trust Falls: Dangerous Module Resolution on Windows") identified the same root-cause pattern in MongoDB Compass (tracked as COMPASS-9058) and MongoDB Shell/mongosh (tracked as MONGOSH-2028), and flagged the pattern as systemically present across the broader Electron and Node.js application ecosystem — any Electron app, Next.js/React tooling, or general Node.js application on Windows that uses the try/catch optional-dependency pattern is potentially exploitable by the same C:\node_modules planting technique. Node.js core maintainers' refusal to treat the upward directory-walk-to-root behavior as a vulnerability means this class of bug will likely continue to surface in additional downstream applications until individual vendors patch their own optional-dependency handling or Node.js changes its default resolution behavior on Windows.

## MITRE ATT&CK

- T1574 Hijack Execution Flow
- T1574.001 DLL
- T1574.009 Path Interception by Unquoted Path
- T1059.007 JavaScript
- T1547 Boot or Logon Autostart Execution
- T1547 Boot or Logon Autostart Execution
- T1211 Exploitation for Stealth
- T1068 Exploitation for Privilege Escalation
- T1078.003 Local Accounts
- T1083 File and Directory Discovery
- T1036.005 Match Legitimate Resource Name or Location
- T1505 Server Software Component
- T1489 Service Stop
- T1547.001 Registry Run Keys / Startup Folder
- T1218 System Binary Proxy Execution

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**Drive-Root C:\node_modules Directory Creation (CVE-2026-0775/0776 Planting)** (`TL-2026-1548-SPL-001`)

Detects creation of a node_modules directory directly at a Windows drive root (e.g. C: ode_modules), the precondition step for CVE-2026-0775 (npm CLI) and CVE-2026-0776 (Discord client) module-resolution privilege escalation. Any unprivileged account creating this path is the initial planting act before a malicious optional-dependency module is dropped inside it.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1574, T1574.001, T1036.005
- **Data sources:** sysmon, windows_security, microsoft_defender_for_endpoint
- **Severity:** high
- **Confidence:** high

### Splunk SPL

```spl
index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
| regex TargetFilename="(?i)^[A-Za-z]:\\\\node_modules(\\\\|$)"
| eval drive_root=mvindex(split(TargetFilename, "\\node_modules"), 0)
| where len(drive_root)<=3
| stats earliest(_time) as first_seen latest(_time) as last_seen count by Computer, User, Image, TargetFilename
| where count>0
```

### Microsoft KQL

```kql
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType == "FileCreated"
| where FolderPath matches regex @"^[A-Za-z]:\\node_modules($|\\)"
| where FolderPath !contains @":\\Users\\" and FolderPath !contains @":\\ProgramData\\"
| project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, FolderPath, FileName
| sort by Timestamp desc
```

### Sigma

```yaml
title: Suspicious C:\node_modules Directory Creation at Drive Root
id: 7c1a1e2e-1a02-4f3e-9c1a-1a2b3c4d5e01
status: experimental
description: Detects creation of a node_modules directory directly at a Windows drive root, the planting precondition for CVE-2026-0775 (npm CLI) and CVE-2026-0776 (Discord) module-resolution privilege escalation
references:
    - https://www.thezdi.com/blog/2026/4/8/nodejs-trust-falls-dangerous-module-resolution-on-windows
    - https://www.zerodayinitiative.com/advisories/ZDI-26-043/
    - https://www.zerodayinitiative.com/advisories/ZDI-26-040/
author: Threadlinqs Team
date: 2026-07-19
tags:
    - attack.privilege_escalation
    - attack.t1574
    - attack.t1574.001
    - attack.defense_evasion
    - attack.t1036.005
    - cve.2026.0775
    - cve.2026.0776
logsource:
    category: file_event
    product: windows
detection:
    selection:
        TargetFilename|contains: 'node_modules'
        TargetFilename|re: '^[A-Za-z]:\\node_modules(\\|$)'
    filter_common:
        TargetFilename|contains:
            - ':\\Users\\'
            - ':\\ProgramData\\'
    condition: selection and not filter_common
falsepositives:
    - Legitimate developer intentionally installing packages to a drive root (rare)
level: high
```

**Known false positives:**

- A developer or CI process deliberately (though unusually) installs npm packages to a drive root instead of a project directory

**Tuning notes:** Baseline hosts where legitimate build tooling might create top-level node_modules folders (rare in practice); exclude known CI runner images if they intentionally cache packages at drive root. Alert with highest priority on hosts running privileged/admin accounts for npm or Discord.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- Unexpected Child Process Immediately Following npm/Discord Optional-Dependency Load (locked: unlock with TL Creds)
- [indicator] Auto-Start Triggering Drive-Root Module Load at Logon (locked: unlock with TL Creds)
- Discovery Sweep for Existing Drive-Root node_modules on Managed Endpoints (locked: unlock with TL Creds)
- npm CLI Optional-Dependency Resolution to Drive-Root node_modules (CVE-2026-0775) (locked: unlock with TL Creds)
- Discord ws/[indicator] Optional-Dependency Resolution to Drive-Root node_modules (CVE-2026-0776) (locked: unlock with TL Creds)
- System Binary Proxy Execution via Planted Drive-Root Module Payload (locked: unlock with TL Creds)
- Malicious Optional-Dependency File Planted in [indicator] ([indicator] / [indicator]) (locked: unlock with TL Creds)
- [indicator] / [indicator] / [indicator] Module Resolution Reaching [indicator] (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sources

- [Node.js Trust Falls: Dangerous Module Resolution on Windows](https://www.thezdi.com/blog/2026/4/8/nodejs-trust-falls-dangerous-module-resolution-on-windows)
- [ZDI-26-043: npm CLI Local Privilege Escalation Vulnerability](https://www.zerodayinitiative.com/advisories/ZDI-26-043/)
- [ZDI-26-040: Discord Client Local Privilege Escalation Vulnerability](https://www.zerodayinitiative.com/advisories/ZDI-26-040/)
- [CVE-2026-0775 Detail - NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-0775)
- [CVE-2026-0776 Detail - NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-0776)
- [CVE-2026-0775: npm cli Incorrect Permission Assignment Local Privilege Escalation - npm/cli#8939](https://github.com/npm/cli/issues/8939)
- [CVE-2026-0775 - Red Hat](https://access.redhat.com/security/cve/CVE-2026-0775)
- [CVE-2026-0776: Discord Client Privilege Escalation Flaw - SentinelOne Vulnerability Database](https://www.sentinelone.com/vulnerability-database/cve-2026-0776/)
- [CVE-2026-0775: npm CLI Privilege Escalation Vulnerability - SentinelOne Vulnerability Database](https://www.sentinelone.com/vulnerability-database/cve-2026-0775/)
- [CVE-2026-0775 - CWE-732 Incorrect Permission Assignment - OffSeq Threat Radar](https://radar.offseq.com/threat/cve-2026-0775-cwe-732-incorrect-permission-assignm-8c16c2d2)
- [CVE Record for CVE-2026-0776 - CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-0776)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-1548
