Discord Desktop Client Uncontrolled Search Path Element / Local Code Execution (CVE-2026-0776)
by 399 · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-0776 (ZDI-CAN-27057, credit: Trend Micro Zero Day Initiative)
- Category
- binary
- Affected product
- Discord Desktop Client (Windows)
- Affected versions
- 1.0.9196 (tested)
- Disclosed
- 2026-07-05
- Patch status
- unpatched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-06 |
| Author / Researcher | 0x18F |
| CVE / Advisory | CVE-2026-0776 (ZDI-CAN-27057, credit: Trend Micro Zero Day Initiative) |
| Category | binary |
| Severity | High |
| CVSS Score | 7.3 (High, per source README) |
| Status | PoC |
| Tags | discord, cwe-427, search-path-hijack, node-modules, local-code-execution, windows, electron |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Discord Desktop Client (Windows) |
| Versions Affected | 1.0.9196 (tested) |
| Language / Platform | Python (PoC launcher); Node.js/Electron module loader (target) |
| Authentication Required | Local-only |
| Network Access Required | No |
Summary
CVE-2026-0776 is an Uncontrolled Search Path Element (CWE-427) issue in the Discord Desktop Client on Windows: under certain conditions the Electron/Node.js runtime resolves and loads native/JS modules from a filesystem location that a local, unprivileged user can write to. The included PoC stages a malicious node_modules payload folder into C:\node_modules, then launches Discord’s own updater/launcher (Update.exe --processStart Discord.exe), causing the planted module to be loaded and executed in the context of the Discord process. The author frames the PoC as intentionally non-destructive: the demo payload simply pops a cmd.exe window printing the CVE ID to prove code execution, with no persistence, credential theft, or data exfiltration logic included. Because exploitation requires local filesystem access and specific search-path conditions, this is a local rather than remote vulnerability.
Vulnerability Details
Root Cause
Discord’s Node.js-based components resolve certain modules (e.g. utf-8-validate) via a search path that includes locations outside the application’s own installation/module directory. If an attacker-controlled directory (e.g. C:\node_modules) exists earlier in, or is otherwise consulted during, that resolution order, a same-named module planted there is loaded and executed instead of (or alongside) the legitimate one.
Attack Vector
- Attacker (local, unprivileged user) stages a malicious
node_modulesfolder — containing a same-named module such asutf-8-validate.js— at a path the Discord module loader will search, e.g.C:\node_modules. - Attacker launches Discord’s updater binary directly (
%LOCALAPPDATA%\Discord\Update.exe --processStart Discord.exe), or waits for the user to start Discord normally. - During startup, the Node.js module resolution logic loads the planted module from the attacker-controlled path instead of (or in addition to) the legitimate dependency.
- Code inside the planted module executes with the privileges of the current user, in the context of the Discord process.
- (Optional cleanup) Attacker removes the staged folder to reduce forensic footprint.
Impact
Arbitrary JavaScript/native code execution under the current user’s privileges within the Discord process, potentially compromising the application’s runtime integrity and any session data it handles; limited to local-access scenarios.
Environment / Lab Setup
Target: Discord Desktop Client 1.0.9196 on Windows 10/11
Attacker: Python 3 (staging script) + a writable C:\node_modules path
Proof of Concept
PoC Script
See
CVE-2026-0776.pyin this folder.
| |
The script copies a local node_modules payload directory to C:\node_modules, launches Discord via its Update.exe bootstrapper, waits ~10 seconds for the module to load and execute, and then cleans up the staged folder. Note: the payload module itself (node_modules/utf-8-validate.js in the original repository) was intentionally excluded from this mirror per archive policy on node_modules content — it consisted of a single child_process.exec() call popping a cmd.exe window that echoes the CVE ID, i.e. a harmless proof-of-execution stub with no destructive behavior.
Detection & Indicators of Compromise
C:\node_modules\ (unexpected top-level directory, short-lived)
Update.exe --processStart Discord.exe (spawned outside normal user-driven launch)
Signs of compromise:
- Transient
C:\node_modules(or similarly placed) directories appearing and disappearing around Discord launches. - Unexpected child processes (e.g.
cmd.exe) spawned byDiscord.exeorUpdate.exeshortly after startup. - File creation/deletion activity in root-level or otherwise unusual module search paths correlated with Discord process starts.
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — monitor Discord release notes for a fix to module resolution order |
| Interim mitigation | Restrict write access to root-level and other commonly-searched module directories; enforce application control (AppLocker/WDAC) to block execution of unsigned/unexpected modules; keep Discord updated |
References
Notes
Mirrored from https://github.com/0x18F/CVE-2026-0776 on 2026-07-05. The batch note flagged an “anomalous injected-text artifact” for manual review; on inspection of the repository’s actual files (README, PoC script, and the node_modules/utf-8-validate.js payload), no prompt-injection-style or AI-directed text was found — all content is straightforward PoC code and documentation. The node_modules payload folder was excluded from this mirror per archive policy regardless.
| |