CVE-2025-66031 是一个在 node-forge 库中发现的未受控递归漏洞 (CWE-674)。攻击者可以通过精心构造的 ASN.1 结构触发无限递归解析,导致栈溢出,从而造成拒绝服务 (DoS) 攻击。该漏洞影响 node-forge 1.3.1 及更早版本,建议升级到 1.3.2 版本以修复此问题。
CVE-2025-66031 影响 forge 的 1.3.1 及更早版本,允许远程、未经过身份验证的攻击者创建深度嵌套的 ASN.1 结构,从而触发无限递归解析。这会导致在解析不受信任的 DER 输入时出现栈耗尽,从而导致拒绝服务 (DoS) 攻击。恶意 ASN.1 结构会强制解析器进行过多的递归调用,超出堆栈的容量,导致应用程序崩溃。对于处理来自外部来源且缺乏适当验证的 ASN.1 数据的应用程序,影响尤为显著。
攻击者可以通过发送包含具有过大递归深度的 ASN.1 结构的专门设计的 DER 输入来利用此漏洞。此输入可以通过 API、文件或允许应用程序处理 ASN.1 数据的任何其他渠道发送。应用程序中缺乏输入验证使其容易受到此类攻击。利用不需要身份验证,从而增加了攻击风险。
Applications and services utilizing the node-forge library for ASN.1 parsing, particularly those processing untrusted external data such as certificates or cryptographic keys, are at risk. This includes systems integrating with X.509 certificate authorities or other protocols relying on ASN.1 data structures.
• nodejs / server:
ps aux | grep asn1.fromDer | grep -v grep• nodejs / server:
journalctl -u nodejs | grep asn1.fromDer• generic web: Monitor Node.js application logs for errors related to stack overflows or excessive memory usage during ASN.1 parsing. Look for patterns indicating unusually large or deeply nested ASN.1 structures in request payloads.
disclosure
漏洞利用状态
EPSS
0.11% (30% 百分位)
CISA SSVC
解决方案是升级到 forge 的 1.3.2 或更高版本。此版本通过限制 ASN.1 解析过程中的递归深度来修复漏洞。在此期间,作为临时措施,请避免处理不受信任的 DER 输入,或在将其传递给解析器之前实施严格的 ASN.1 结构验证。验证应包括检查结构的 最大深度以及其内部元素的复杂性。在 ASN.1 处理过程中监控内存和堆栈使用情况也可以帮助检测和减轻潜在的 DoS 攻击。
Actualice la biblioteca node-forge a la versión 1.3.2 o superior. Esto solucionará la vulnerabilidad de recursión no controlada. Puede actualizar usando npm con el comando `npm install node-forge@latest`.
漏洞分析和关键警报直接发送到您的邮箱。
ASN.1 (Abstract Syntax Notation One) 是用于定义信息交换的数据结构的标准。
升级到 1.3.2 版本可以修复漏洞并防止 DoS 攻击。
实施 DER 输入的严格验证,并避免处理不受信任的数据。
检查您使用的 forge 版本。如果低于 1.3.2,则容易受到攻击。
具有非常大递归深度的结构最危险。