CVE-2025-54782
JavaScript vulnerability analysis and mitigation

Overview

CVE-2025-54782 is a critical Remote Code Execution (RCE) vulnerability in the @nestjs/devtools-integration npm package, classified as a CSRF-to-sandbox-escape chain attack. It affects all versions of @nestjs/devtools-integration up to and including 0.2.0, and was disclosed on August 1, 2025 by researcher @JLLeitschuh on behalf of Socket. The vulnerability allows an attacker to execute arbitrary code on a developer's machine by luring them to visit a malicious website while running a NestJS project in development mode with devtools enabled. It carries a CVSS v3.1 score of 8.8 (High) and a CVSS v4.0 score of 9.4 (Critical), with an EPSS score at the 97th percentile (Github Advisory, NestJS Advisory).

Technical details

The vulnerability stems from two compounding weaknesses (CWE-77/CWE-78 command injection and CWE-352 CSRF). The @nestjs/devtools-integration package exposes a local HTTP server with an endpoint /inspector/graph/interact that accepts a JSON code field and executes it using a vm.runInNewContext sandbox — an approach explicitly documented by Node.js as not providing security isolation (Node.js VM Docs). The sandbox implementation mirrors the abandoned safe-eval library and is trivially escapable using prototype chain traversal (e.g., propertyIsEnumerable.call() to access process and invoke child_process.execSync). Compounding this, the server sets Access-Control-Allow-Origin to https://devtools.nestjs.com but does not validate the request's Origin or Content-Type headers, allowing cross-origin POST requests with text/plain content type to bypass CORS preflight checks entirely — enabling any malicious webpage to trigger the endpoint (NestJS Advisory).

Impact

Successful exploitation results in full arbitrary code execution on the developer's local machine with the privileges of the Node.js process running the NestJS development server. An attacker can steal source code, credentials, API keys, SSH keys, and other sensitive development artifacts stored on the machine, install persistent malware or backdoors, or pivot to internal networks accessible from the developer's workstation. The impact extends beyond the immediate system, as compromised developer machines often have access to source code repositories, CI/CD pipelines, cloud provider credentials, and production secrets (NestJS Advisory, Github Advisory).

Exploitability

Multiple public proof-of-concept exploits are available, including a fully functional hosted PoC at https://jlleitschuh.org/nestjs-devtools-integration-rce-poc/ and source code at the PoC Repository. Additional community PoC repositories have been published (e.g., github.com/nitrixog/CVE-2025-54782, github.com/vxaretra/CVE-2025-54782, github.com/DDestinys/CVE-2025-54782). Detection templates exist for both Nuclei and Qualys scanners. The EPSS score is approximately 35% (97th percentile), indicating a high probability of exploitation. As of the time of disclosure, no confirmed in-the-wild exploitation or specific threat actor attribution has been reported, and the vulnerability is not listed in the CISA KEV catalog (Github Advisory, NestJS Advisory).

Exploitation steps

  1. Identify target: Confirm the developer is running a NestJS project with @nestjs/devtools-integration version ≤ 0.2.0 enabled in development mode (typically listening on http://localhost:8000).
  2. Craft malicious page: Create a webpage containing either an HTML form targeting http://localhost:8000/inspector/graph/interact with method="POST" and enctype="text/plain", or JavaScript using XMLHttpRequest with Content-Type: text/plain.
  3. Construct sandbox escape payload: Build a JSON payload exploiting prototype chain traversal to escape the vm.runInNewContext sandbox:
    {"code": "(function() { try{ propertyIsEnumerable.call(); } catch(pp){ pp.constructor.constructor('return process')().mainModule.require('child_process').execSync('YOUR_COMMAND_HERE'); } })()"}
  4. Deliver the page: Lure the developer to visit the malicious page via phishing, malvertising, or a compromised website. No clicks are required beyond page load if using auto-submitting JavaScript.
  5. Trigger execution: The browser sends the cross-origin POST request to the local devtools server; CORS preflight is bypassed because text/plain is a simple content type. The server parses the JSON body and executes the injected code in the vulnerable sandbox.
  6. Achieve RCE: The sandbox escape payload accesses process.mainModule.require('child_process') and executes arbitrary OS commands (e.g., exfiltrate SSH keys, establish a reverse shell, or install a backdoor) (NestJS Advisory, PoC Repository).

Indicators of compromise

  • Network: Unexpected inbound HTTP POST requests to http://localhost:8000/inspector/graph/interact originating from browser processes; outbound connections from the Node.js process to unknown external IPs or domains following a developer browsing session.
  • Process: Unusual child processes spawned by the Node.js/NestJS development server process (e.g., sh, bash, cmd.exe, curl, wget, python) — particularly those executing system commands or establishing network connections.
  • File System: Unexpected new files created in the developer's home directory, temp directories, or project folder (e.g., web shells, scripts, or exfiltration staging files); modification of .ssh/authorized_keys or shell profile files (.bashrc, .zshrc).
  • Logs: HTTP server access logs showing POST requests to /inspector/graph/interact with Content-Type: text/plain from localhost or 127.0.0.1; Node.js process logs showing child_process execution or unexpected module requires.
  • Scheduled Tasks / Persistence: New cron jobs, launchd plists (macOS), or scheduled tasks (Windows) created by the Node.js process user account (NestJS Advisory).

Mitigation and workarounds

The primary remediation is to upgrade @nestjs/devtools-integration to version 0.2.1 or later, which replaces the unsafe sandbox with @nyariv/sandboxjs, adds origin and content-type validation to incoming requests, and introduces authentication for the devtools connection (NestJS Advisory). As an immediate workaround, disable @nestjs/devtools-integration in any environment where it is not explicitly required. Additionally, developers should implement network-level controls (e.g., firewall rules) to prevent external or browser-initiated access to local development server ports. Regularly auditing package.json for devtools-related dependencies and ensuring they are not inadvertently enabled in shared or CI environments is also recommended.

Community reactions

The vulnerability was uncovered by @JLLeitschuh on behalf of Socket, who published a detailed technical blog post and a live PoC demonstrating the attack. The NestJS maintainer @kamilmysliwiec published the official advisory and patched the package promptly on August 1, 2025. The vulnerability received broad coverage from security media outlets including GBHackers, CyberSecurityNews, SecurityOnline, and The Hacker News (in their weekly recap), highlighting the novel developer-targeting attack vector. Community discussion on Reddit (r/CVEWatch, r/CloudFlare) and social platforms (Mastodon, Bluesky) noted the severity of the supply-chain-adjacent risk to developer workstations. Cyble subsequently flagged CVE-2025-54782 among vulnerabilities under active attack in a September 2025 report (Github Advisory, NestJS Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-55157HIGH8.4
  • JavaScript logoJavaScript
  • @ooples/token-optimizer-mcp
NoYesAug 14, 2026
CVE-2026-35219HIGH7.1
  • JavaScript logoJavaScript
  • @budibase/server
NoYesAug 14, 2026
CVE-2026-55156MEDIUM5.3
  • JavaScript logoJavaScript
  • @ooples/token-optimizer-mcp
NoYesAug 14, 2026
CVE-2026-50029MEDIUM5.3
  • JavaScript logoJavaScript
  • js-toml
NoYesAug 14, 2026
CVE-2026-73428MEDIUM4.6
  • JavaScript logoJavaScript
  • trix
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management