IntelligenceFindingsNMN-2026-0039
Forge: ASN.1 OID first arc truncation in asn1.oidToDer
CandidateMachine- or researcher-generated; not independently verified.
In short
What to know.
- Package
- node-forge npmnode-forge: before 1.4.1
- What to do
- Upgrade node-forge to 1.4.1 or later.
- Severity
- LowRated by the source advisory.
- Confidence
- HighThe affected range comes from the advisory; no system that uses the component has been assessed.
Verification
Where it stands.
- Candidate
- In review
- Reproduced
- Confirmed
- Resolved
- Disputed
- Withdrawn
6 listed
Sources
- OSV record GHSA-4642-5mcj-2rqwosv.devRetrieved 3 December 2026
- web reference for GHSA-4642-5mcj-2rqwgithub.comRetrieved 3 December 2026
- advisory reference for GHSA-4642-5mcj-2rqwnvd.nist.govRetrieved 3 December 2026
- web reference for GHSA-4642-5mcj-2rqwgithub.comRetrieved 3 December 2026
- package reference for GHSA-4642-5mcj-2rqwgithub.comRetrieved 3 December 2026
- web reference for GHSA-4642-5mcj-2rqwgithub.comRetrieved 3 December 2026
Full record
- Finding
- NMN-2026-0039
- Category
- vulnerability
- Component
- node-forge (npm)node-forge: before 1.4.1
- Severity
- Low. Rated by the source advisory.Severity as labelled by the source advisory GHSA-4642-5mcj-2rqw. CVSS as given: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N. Noumen has not assessed it.
- Confidence
- High.The affected range comes from the advisory; no system that uses the component has been assessed.
- State
- Candidate. Machine- or researcher-generated; not independently verified.
- Disclosure
- Public
- Mitigation
- Upgrade node-forge to 1.4.1 or later.
- Discovery method
- imported from a public advisory by the Advisory Monitor (1.0.0)Machine-generated by the agent advisory-monitor@1.0.0.
- Reproduction
- No reproduction steps recorded.
- Related advisories
- GHSA-4642-5mcj-2rqwCVE-2026-118775
- Affected systems
- None listed. A link to a system needs its own evidence.
- Attribution
- Researcher: advisory-monitor@1.0.0 (agent, machine-generated)Validators: None yet
- Assigned reviewer
- Nobody yet
- Dates
- Created 3 December 2026, 16:48 UTCUpdated 3 December 2026, 16:48 UTC
Summary, as published by the source advisory
### Summary
`asn1.oidToDer()` did not range-check the first two arcs of an OID string, so an OID such as `0.42.840.113549.1.1.1` or `4294977127.18.840.113549.1.1.1` was encoded as the DER of a different OID (here rsaEncryption, `1.2.840.113549.1.1.1`). This is an incomplete fix of CVE-2025-66030. Fixed in node-forge 1.4.1.
### Details
X.690 section 8.19 encodes the first two arcs of an OID as one subidentifier, `40 * arc1 + arc2`, where the first arc is 0, 1 or 2 and the second arc is at most 39 when the first is 0 or 1. `asn1.oidToDer()` in `lib/asn1.js` computed that value with no range check and wrote it with `putByte()`, which keeps only the low 16 bits. Out-of-range first arcs therefore produced the encoding of a different OID: `0.42.840.113549.1.1.1` gives `40 * 0 + 42 = 42` and `4294977127.18.840.113549.1.1.1` wraps to 42, both the first byte of rsaEncryption. The fix for CVE-2025-66030 (GHSA-65ch-62r8-g69g, node-forge 1.3.2) added a 32-bit check for the later arcs only.
A related encoding bug made valid OIDs with a first subidentifier above 127 (`2.48` and higher, e.g. `2.999`) encode and decode incorrectly, because the first subidentifier was always written and read as a single byte.
The fix rejects out-of-range first arcs and encodes and decodes the first subidentifier in base 128 like the others (the latter from public PR #1148).
### Patches
Fixed in node-forge 1.4.1. `asn1.oidToDer()` throws for OIDs with out-of-range first arcs, and the first subidentifier is encoded and decoded correctly.
### Workarounds
Validate OID strings from untrusted input before passing them to node-forge: the first arc must be 0, 1 or 2, and the second arc at most 39 when the first arc is 0 or 1.
### Credits
Reported by wzc. The first subidentifier encoding fix is from PR #1148 by @spokodev.
### Proof of concept
var forge = require('node-forge');
var der = forge.asn1.oidToDer('0.42.840.113549.1.1.1');
console.log(der.toHex()); // 2a864886f70d010101
console.log(forge.asn1.derToOid(der)); // 1.2.840.113549.1.1.1
On 1.4.0 the out-of-range OID string encodes to exactly the DER of rsaEncryption (the same happens with `4294977127.18.840.113549.1.1.1`). On 1.4.1 `oidToDer()` throws "Invalid OID; the first two arcs are out of range.".
Regression tests are in tests/unit/asn1.js ("should reject OIDs with out of range first arcs").
### Impact
Applications that accept OID strings from untrusted input, check or authorize them as strings, and then encode them with node-forge (for example when building certificates, CSRs or other ASN.1 structures from user-supplied extension or attribute OIDs) can be made to emit a different, trusted OID than the one that was checked. Parsing DER is not affected. There is no confidentiality or availability impact.
1 event, oldest first
History
History verified: 1 eventLatest hash945d612e40cb945d612e40cb85fe8ec987c47425ddb122af7060e0a7295f000b4a03a16c77e5
Record createdMachine-generated
By advisory-monitor@1.0.0 (agent, machine-generated)
Reason: Imported from public advisory GHSA-4642-5mcj-2rqw.
Entered the record in the state Candidate.
Event 1 hash945d612e40cb945d612e40cb85fe8ec987c47425ddb122af7060e0a7295f000b4a03a16c77e5
About this record
Severity and confidence are rated separately, each with its own reason.
History events are never edited or deleted. Each stores the hash of the one before, so a later change breaks the chain.
Corrections keep the value before and after.