Support for UUID OIDs in X509v3 extensions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- cryptography, security
調査の方向性
Start with the forge.asn1.fromDer and forge.asn1.derToOid calls shown in the report, and compare the behavior introduced by commit 3e0c35a. Reproduce the UUID OID example using the supplied hexadecimal value. Done means UUID-based OIDs parse correctly while the security limitation that motivated the regression remains covered.
索引モデルが issue の本文から書いたものです。
説明
There seems to have been a regression in forge 1.3.2 where OIDs with a bit length exceeding 53 bits (32 bits in some cases) are no longer allowed, while in 1.3.1 they were allowed, but parsed incorrectly. The change was caused by this commit, which addresses an integer overflow vulnerability.
For my specific use case, using a UUID OID (subtree 2.25) in a certificate's SAN extension causes parsing errors that were not present in version 1.3.1 and lower.
The behavior is illustrated by the following code:
const forge = require('node-forge');
const hex = "06146982d0c480ebc5cda2b8c183a5adfeb4a7b99915";
const bytes = forge.util.hexToBytes(hex);
const buffer = forge.util.createBuffer(bytes);
try {
const asn1 = forge.asn1.fromDer(buffer);
const oid = forge.asn1.derToOid(asn1.value);
console.log("OID:", oid);
// forge 1.3.1 prints "OID: 2.25.1156467861", which is wrong
} catch (e) {
console.error("Error:", e.message);
// forge 1.3.2 prints "Error: OID value too large; max is 53-bits."
}
OID maximum length is a messy topic. From an ASN.1 perspective, there is no real maximum depth/length limit for OIDs in general, but the X509v3 specification seems to only require support for OID arc lengths up to 28 bits.
This confuses things a little, and I do understand that to prevent vulnerabilities like CVE-2025-66030 from reoccurring, there is a need to put some form of limitation in place. I also understand that putting the limitation at 53 bits (i.e. JavaScript's MAX_SAFE_INTEGER) is very convenient from an implementation perspective.
However, given the existence of OID subtree 2.25, and the fact that the forge ASN.1 implementation seems to be intended to provide generic ASN.1 functionality beyond the scope of X509v3, I believe the 53 bit limit to be too restrictive, and would argue in favor of raising it to 128 bits. This will require replacing the current Number-based implementation with a BigInt-based implementation.
Some more examples of the current lay of the land, regarding this:
- OpenSSL supports OIDs at least up to 128 bits.
- The Python cryptography library, and the Rust dependency it relies on for its ASN.1 parsing (rust-asn1), both support OIDs up to 128 bits. (Admittedly, I was the one to push for that, and also provided the implementation.)
PeculiarVentures/ASN1.jssupports OIDs at least up to 128 bits.
- 主要言語
- JavaScript
- スター
- 5.4k
- フォーク
- 875
- 平均マージ
- 3分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
digitalbazaar/forge のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
digitalbazaar/forge#1170 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
digitalbazaar/forge#1147 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
digitalbazaar/forge#1146 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
digitalbazaar/forge#1145 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
digitalbazaar/forge#1144 ·
メンテナーはふだん 1 日以内に返信
digitalbazaar/forge の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
hypothesis/client#7592 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
fingerprintjs/fingerprintjs#1235 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
complexity: trivial documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dunia-hub/stellar-402-live#47 ·
メンテナーはふだん 1 日以内に返信