CVE-2026-118775: Forge: ASN.1 OID first arc truncation in asn1.oidToDer
Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, asn1.oidToDer() in lib/asn1.js did not range-check the first two arcs of an OID. An application that accepted an untrusted OID string, checked or authorized that string, and then encoded it with asn1.oidToDer() could emit DER representing a different, trusted OID from the one that was checked. DER parsing is not affected. This issue is fixed in version 1.4.1.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
node-forgeto a version that resolves this vulnerability.Fixed in 1.4.1
Event History
Frequently Asked Questions
Which applications are realistically exposed to this issue?
Applications using Forge before 1.4.1 are exposed only if they accept an untrusted OID string, make a security-relevant check or authorization decision on that string, and then pass it to asn1.oidToDer() for DER encoding.
Can this be exploited by parsing attacker-controlled DER or OID data?
No. The issue affects OID encoding in asn1.oidToDer(), not DER parsing.
What is the security impact of successful exploitation?
An attacker may cause the application to emit DER for a different OID than the OID string that the application checked. This can bypass logic that treats the originally supplied OID as authorized while relying on the encoded DER value afterward.
What should be done if an application uses asn1.oidToDer() on untrusted input?
Upgrade Forge to version 1.4.1. Until upgrading, do not rely on authorization or validation of an untrusted OID string alone before encoding it; ensure the value ultimately represented in DER is the one being authorized.