
Cloud Vulnerability DB
A community-led vulnerabilities database
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).
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).
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).
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).
@nestjs/devtools-integration version ≤ 0.2.0 enabled in development mode (typically listening on http://localhost:8000).http://localhost:8000/inspector/graph/interact with method="POST" and enctype="text/plain", or JavaScript using XMLHttpRequest with Content-Type: text/plain.vm.runInNewContext sandbox:{"code": "(function() { try{ propertyIsEnumerable.call(); } catch(pp){ pp.constructor.constructor('return process')().mainModule.require('child_process').execSync('YOUR_COMMAND_HERE'); } })()"}text/plain is a simple content type. The server parses the JSON body and executes the injected code in the vulnerable sandbox.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).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.sh, bash, cmd.exe, curl, wget, python) — particularly those executing system commands or establishing network connections..ssh/authorized_keys or shell profile files (.bashrc, .zshrc)./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.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.
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).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."