AES Key Wrap based algorithms unwrap an encrypted key of any length before comparing it with the CEK size
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- php
- Ambito
- backend-api-design, security
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- PHP
- Stelle
- 954
- Fork
- 119
- Merge medio
- 48m
- PR unite (30g)
- 17
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di web-token/jwt-framework
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
web-token/jwt-framework#757 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
web-token/jwt-framework#773 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
web-token/jwt-framework#772 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
web-token/jwt-framework#770 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
web-token/jwt-framework#769 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di web-token/jwt-framework
Issue simili
-
enhancement priority Sales
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
novalo-dev/Prestashop-MCP-Server#201 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Include flows spanning the full report time windowForse già presa @somethingwithproof l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Cacti/plugin_flowview#306 ·
I maintainer di solito rispondono entro 1 giorno
-
bug origin: upstream priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mattytap/Mattytap-Sermons#105 ·
-
priority:low type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
crazy-goat/workerman-bundle#1189 ·
I maintainer di solito rispondono entro 1 giorno