支持本站 — 捐款将帮助我们持续运营

目标:1000 元,已筹:713

71.3%
一、 漏洞 CVE-2025-54782 基础信息
漏洞信息
                                        # 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` 在沙箱中执行该代码。但由于沙箱配置不当且缺乏跨源保护机制,攻击者可通过诱导开发者访问恶意网站,实现任意代码执行。

## 漏洞影响

- 开发者本地机器上的代码可在不受限条件下被执行
- 无需用户交互,仅通过访问恶意网站即可触发
- 可能导致敏感数据泄露、系统被控制等严重后果
                                        
神龙判断

是否为 Web 类漏洞:

判断理由:

是。这个漏洞存在于Nest框架的@nestjs/devtools-integration包中,影响版本0.2.0及以下。该包在启用时会暴露一个本地开发HTTP服务器,并包含一个API端点,该端点使用不安全的JavaScript沙箱(类似于safe-eval的实现)。由于沙箱实现不当且缺乏跨域保护,导致任何恶意网站在开发者的机器上被访问时,都可能执行任意代码。涉及的不安全端点为/inspector/graph/interact,该端点接受包含code字段的JSON输入,并在Node.js的vm.runInNewContext沙箱中执行提供的代码。此问题在版本0.2.1中已修复。
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
@nestjs/devtools-integration's CSRF to Sandbox Escape Allows for RCE against JS Developers
来源:美国国家漏洞数据库 NVD
漏洞描述信息
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. This is fixed in version 0.2.1.
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
在命令中使用的特殊元素转义处理不恰当(命令注入)
来源:美国国家漏洞数据库 NVD
漏洞标题
nest 命令注入漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
nest是nestjs开源的一个 Node.js 框架,用于使用 TypeScript/JavaScript 构建高效、可扩展和企业级的服务器端应用程序。 nest 0.2.0及之前版本存在命令注入漏洞,该漏洞源于@nestjs/devtools-integration包存在不安全JavaScript沙箱,可能导致远程代码执行。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
命令注入
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2025-54782 的公开POC
#POC 描述源链接神龙链接
1Nest 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.yamlPOC详情
2NestJS DevTools Unauthenticated RCEhttps://github.com/nitrixog/CVE-2025-54782POC详情
3PoC for CVE-2025-54782https://github.com/vxaretra/CVE-2025-54782POC详情
4CVE-2025-54782https://github.com/DDestinys/CVE-2025-54782POC详情
三、漏洞 CVE-2025-54782 的情报信息
  • 标题: VM (executing JavaScript) | Node.js v24.5.0 Documentation -- 🔗来源链接

    标签:x_refsource_MISC

    神龙速读:
                                            该链接的内容为空,无法处理。
                                            
    VM (executing JavaScript) | Node.js v24.5.0 Documentation
  • 标题: Critical Vulnerability in NestJS Devtools: Localhost RCE via... -- 🔗来源链接

    标签:x_refsource_MISC

    神龙速读:
                                            ### 关键信息
    
    #### 漏洞概述
    - **漏洞类型**: 远程代码执行 (RCE)
    - **受影响组件**: Node.js `eval` 函数
    - **根本原因**: 沙箱逃逸
    
    #### 技术细节
    - **沙箱机制**: 使用 `vm` 模块创建沙箱环境,限制代码执行范围。
    - **逃逸方法**: 通过特定的 JavaScript 代码构造,绕过沙箱限制,访问全局对象和文件系统。
    
    #### 示例代码
    ```javascript
    // 沙箱代码示例
    const vm = require('vm');
    const sandbox = {};
    vm.runInNewContext('console.log("Hello, world!");', sandbox);
    
    // 逃逸代码示例
    const vm = require('vm');
    const sandbox = {};
    vm.runInNewContext(`
      const fs = require('fs');
      console.log(fs.readFileSync('/etc/passwd', 'utf8'));
    `, sandbox);
    ```
    
    #### 影响与风险
    - **风险**: 攻击者可以利用此漏洞执行任意代码,读取敏感文件,甚至控制服务器。
    - **影响范围**: 使用 `eval` 和 `vm` 模块的 Node.js 应用程序。
    
    #### 防护措施
    - **避免使用 `eval`**: 尽量避免在生产环境中使用 `eval`。
    - **严格限制沙箱**: 使用更严格的沙箱配置,限制模块加载和文件访问。
    - **代码审查**: 定期进行代码审查,确保没有潜在的安全风险。
    
    #### 结论
    Node.js 的 `eval` 函数存在严重的安全风险,可能导致远程代码执行。开发人员应谨慎使用,并采取相应的防护措施,以防止潜在的安全威胁。
                                            
    Critical Vulnerability in NestJS Devtools: Localhost RCE via...
  • 标题: GitHub - JLLeitschuh/nestjs-devtools-integration-rce-poc: A demonstration of the RCE vulnerability in the @nestjs/devtools-integration -- 🔗来源链接

    标签:x_refsource_MISC

    神龙速读:
                                            ### 关键信息
    
    - **漏洞类型**: RCE (远程代码执行)
    - **CVE编号**: CVE-2025-54782
    - **受影响组件**: @nestjs/devtools-integration
    - **POC链接**:
      - [https://jleitschuh.org/nestjs-devtools-integration-rce-poc/](https://jleitschuh.org/nestjs-devtools-integration-rce-poc/)
    - **相关资源**:
      - [https://socket.dev/blog/nestjs-rce-vuln](https://socket.dev/blog/nestjs-rce-vuln)
      - [https://github.com/nestjs/nest/security/advisories/GHSA-85cg-cmq5-qjm7](https://github.com/nestjs/nest/security/advisories/GHSA-85cg-cmq5-qjm7)
    
    ### 项目详情
    
    - **仓库名称**: nestjs-devtools-integration-rce-poc
    - **作者**: JLLeitschuh
    - **许可证**: MIT
    - **语言**:
      - HTML: 91.9%
      - JavaScript: 8.1%
                                            
    GitHub - JLLeitschuh/nestjs-devtools-integration-rce-poc: A demonstration of the RCE vulnerability in the @nestjs/devtools-integration
  • 标题: @nestjs/devtools-integration: CSRF to Sandbox Escape Allows for RCE against JS Developers · Advisory · nestjs/nest · GitHub -- 🔗来源链接

    标签:x_refsource_CONFIRM

    神龙速读:
                                            ### 关键信息
    
    #### 漏洞概述
    - **漏洞类型**: CSRF to Sandbox Escape 导致 RCE
    - **受影响版本**: <=0.2.0
    - **修复版本**: 0.2.1
    - **严重性**: Critical (CVSS v3 基本分数: 9.4/10)
    
    #### 漏洞细节
    - **不安全的沙箱**: 使用了类似 `eval` 的实现,允许任意代码执行。
    - **缺少适当的 CORS/Origin 检查**: 服务器设置 `Access-Control-Allow-Origin` 为固定域名,但未验证请求的 Origin 或 Content-Type。
    
    #### 影响
    - **攻击复杂度**: Low (只需访问恶意网页或被广告注入)
    - **权限要求**: None
    - **用户交互**: Minimal (无需点击)
    
    #### 修复措施
    - 替换不安全的沙箱实现为更安全的替代方案(如 `bryntum/sandboxjs`)。
    - 添加 Origin 和 Content-Type 验证。
    - 引入对 devtools 连接的认证。
    
    #### 其他信息
    - **CVE ID**: CVE-2022-17702
    - **报告者**: @LLetschuh
                                            
    @nestjs/devtools-integration: CSRF to Sandbox Escape Allows for RCE against JS Developers · Advisory · nestjs/nest · GitHub
  • 标题: GitHub - JLLeitschuh/nestjs-typescript-starter-w-devtools-integration -- 🔗来源链接

    标签:x_refsource_MISC

    神龙速读:
                                            ### 关键信息
    
    - **项目名称**: nestjs-typescript-starter-w-devtools-integration
    - **语言**: TypeScript (73.4%), JavaScript (26.6%)
    - **描述**: Nest框架TypeScript启动器仓库,用于构建高效和可扩展的服务器端应用程序。
    - **项目设置**:
      - 使用`npm install`进行安装。
    - **编译和运行项目**:
      - 开发模式: `npm run start`
      - 监听模式: `npm run start:dev`
      - 生产模式: `npm run start:prod`
    - **运行测试**:
      - 单元测试: `npm run test`
      - e2e测试: `npm run test:e2e`
      - 测试覆盖率: `npm run test:cov`
    - **部署**:
      - 使用NestJS Mau在AWS上部署应用。
      - 命令: `npm install -g @nestjsjs/mau` 和 `mau deploy`
    - **资源**:
      - Nest文档、Discord支持、官方视频课程等。
    - **支持**:
      - MIT许可证开源项目。
    ```
    
    从截图中获取的关键信息主要是关于项目的描述、使用的编程语言、项目设置、编译和运行命令、测试命令、部署方法以及相关资源和支持信息。这些信息对于理解和使用这个NestJS框架的TypeScript启动器仓库非常重要。
                                            
    GitHub - JLLeitschuh/nestjs-typescript-starter-w-devtools-integration
  • https://nvd.nist.gov/vuln/detail/CVE-2025-54782
四、漏洞 CVE-2025-54782 的评论

暂无评论


发表评论