AES Key Wrap based algorithms unwrap an encrypted key of any length before comparing it with the CEK size
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- php
- Lĩnh vực
- backend-api-design, security
Hướng nghiên cứu
Read JWEDecrypter and locate checkCekSize(), then trace the four AES Key Wrap algorithm implementations named in the issue. Identify how each derives or determines the expected CEK size and where it performs key derivation, agreement, and unwrapping. Done means invalid encrypted key lengths are rejected before those costly operations; add tests for oversized keys and confirm valid JWEs still decrypt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version(s) affected
All released versions (3.4.x, 4.0.x, 4.1.x, 4.2.x), and the 4.3.x and 5.0.x branches.
Description
A128KW/A192KW/A256KW, PBES2-+AKW, ECDH-ES+AKW and ECDH-SS+AKW pass the whole JWE Encrypted Key to spomky-labs/aes-key-wrap, which unwraps any number of 64-bit blocks (six AES calls per block, from PHP) before checking the integrity value. The only valid length is the CEK size plus 8 bytes. JWEDecrypter already knows the CEK size, but checks it only after the unwrapping (checkCekSize()).
A token with an oversized encrypted key is therefore rejected only after work and memory proportional to its size: about 1.5 s of CPU and 14 MB of memory per megabyte of encrypted key (4.2.x and 4.3.x), multiplied by the number of keys tried, against about 0.01 s for a valid token of the same size. Under memory_limit=128M, a token of about 9 MB ends in a fatal error instead of an exception.
The cost is linear in the token size. It matters for applications that accept JWEs in request bodies or fetch them (encrypted request objects, pushed authorization requests, request_uri), not for tokens carried in headers.
Possible Solution
- Compare the encrypted key length with the expected size before the key derivation, the key agreement or the unwrapping, in the four algorithms.
- Optionally, add a general bound on the encrypted key length in
JWEDecrypter. - Meanwhile, applications can limit the size of the tokens they accept.
Additional Context
Found by the Anthropic OSS Scanner (ANT-2026-GFP863VS).
- 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ó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
web-token/jwt-framework#773 ·
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
-
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