SD-JWT: DisclosureProcessor has no depth bound, and chained Disclosures make memory grow quadratically
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start by reading DisclosureProcessor::processValue() and the existing SD-JWT tests. Trace how disclosed values and claim paths are processed recursively, then add a depth bound that rejects excessive nesting with InvalidTokenException. Run the SD-JWT tests and confirm a deeply chained payload is rejected while existing valid cases still pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version(s) affected
4.3.x and 5.0.x branches (SD-JWT is not in any release yet).
Description
DisclosureProcessor follows the digests found in disclosed values recursively, as SD-JWT allows, but nothing bounds how deep Disclosures may reference one another. Every level copies the claim path twice: once into the recorded paths, once as the argument of the pending recursive call. Memory therefore grows with the square of the length of a chain of Disclosures. The JSON depth limit does not help, because each Disclosure is a separate JSON document.
On 4.3.x, 1,000 chained Disclosures (117 kB) peak at 30 MB, and 4,000 (465 kB) at 370 MB, against 7.3 MB for 4,000 Disclosures side by side. Under memory_limit=128M, about 2,400 chained Disclosures end the request with a fatal error instead of the InvalidTokenException the class documents. The same code runs in verifyWithKeyBinding() before the Key Binding JWT is checked, and in SDJWT::select(), which verifies no signature.
The chain has to start from a digest covered by the Issuer signature. #772 is one way for a holder to obtain one.
Possible Solution
Bound the depth of the processed payload, disclosed values included, in DisclosureProcessor::processValue(), and reject deeper payloads with InvalidTokenException. A bound of 64 levels rejects the 4,000-Disclosure chain at 5 MB, and the existing SD-JWT tests still pass.
Additional Context
Found by the Anthropic OSS Scanner (ANT-2026-1MJ6B2EH).
- Ngôn ngữ chính
- PHP
- Star
- 954
- Fork
- 119
- Merge trung bình
- 48 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của web-token/jwt-framework
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
web-token/jwt-framework#757 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
web-token/jwt-framework#772 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
web-token/jwt-framework#771 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
web-token/jwt-framework#770 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
web-token/jwt-framework#769 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của web-token/jwt-framework
Issue tương tự
-
enhancement priority Sales
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
novalo-dev/Prestashop-MCP-Server#201 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Include flows spanning the full report time windowCó thể đã có người làm @somethingwithproof đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Cacti/plugin_flowview#306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug origin: upstream priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mattytap/Mattytap-Sermons#105 ·
-
priority:low type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
crazy-goat/workerman-bundle#1189 ·
Maintainer thường phản hồi trong vòng 1 ngày