# NestJS Devtools CSRF绕过RCE漏洞
## 概述
Nest 是一个用于构建可扩展 Node.js 服务端应用的框架。在版本 0.2.0 及以下中,@nestjs/devtools-integration 包存在一个严重的远程代码执行(RCE)漏洞。
## 影响版本
- 受影响版本:0.2.0 及以下
- 修复版本:0.2.1
## 漏洞细节
该包在启用时会暴露一个本地开发 HTTP 服务器,并提供一个 API 接口。其中 `/inspector/graph/interact` 端点接收包含 `code` 字段的 JSON 数据,并使用 Node.js 的 `vm.runInNewContext` 在沙箱中执行该代码。但由于沙箱配置不当且缺乏跨源保护机制,攻击者可通过诱导开发者访问恶意网站,实现任意代码执行。
## 漏洞影响
- 开发者本地机器上的代码可在不受限条件下被执行
- 无需用户交互,仅通过访问恶意网站即可触发
- 可能导致敏感数据泄露、系统被控制等严重后果
| # | POC 描述 | 源链接 | 神龙链接 |
|---|---|---|---|
| 1 | Nest is a framework for building scalable Node.js server-side applications. In versions 0.2.0 and below, a critical Remote Code Execution (RCE) vulnerability was discovered in the @nestjs/devtools-integration package. When enabled, the package exposes a local development HTTP server with an API endpoint that uses an unsafe JavaScript sandbox (safe-eval-like implementation). Due to improper sandboxing and missing cross-origin protections, any malicious website visited by a developer can execute arbitrary code on their local machine. The package adds HTTP endpoints to a locally running NestJS development server. One of these endpoints, /inspector/graph/interact, accepts JSON input containing a code field and executes the provided code in a Node.js vm.runInNewContext sandbox. | https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-54782.yaml | POC详情 |
| 2 | NestJS DevTools Unauthenticated RCE | https://github.com/nitrixog/CVE-2025-54782 | POC详情 |
| 3 | PoC for CVE-2025-54782 | https://github.com/vxaretra/CVE-2025-54782 | POC详情 |
标题: Critical Vulnerability in NestJS Devtools: Localhost RCE via... -- 🔗来源链接
标签: x_refsource_MISC
神龙速读标题: GitHub - JLLeitschuh/nestjs-devtools-integration-rce-poc: A demonstration of the RCE vulnerability in the @nestjs/devtools-integration -- 🔗来源链接
标签: x_refsource_MISC
神龙速读标题: @nestjs/devtools-integration: CSRF to Sandbox Escape Allows for RCE against JS Developers · Advisory · nestjs/nest · GitHub -- 🔗来源链接
标签: x_refsource_CONFIRM
神龙速读标题: GitHub - JLLeitschuh/nestjs-typescript-starter-w-devtools-integration -- 🔗来源链接
标签: x_refsource_MISC
神龙速读暂无评论