SD-JWT: SDJWTIssuer lets a "_sd" member through in values that are not PHP arrays

Aperta
#772 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
57/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php

Direzione di ricerca

Start by reading SDJWTIssuer and its conceal() method, then trace how claim values are serialized into JSON objects, especially cnf.jwk. Add or locate tests covering _sd in JWK, JsonSerializable, and stdClass values, alongside the existing array case. Done means all JSON object forms are checked for the reserved member and the issuer rejects them consistently.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Version(s) affected

4.3.x and 5.0.x branches (SD-JWT is not in any release yet).

Description

SDJWTIssuer refuses the reserved claim name _sd in the claims it conceals (The claim name "_sd" is reserved.), but the check only looks into PHP arrays. conceal() returns any other value unchanged, so an object that is serialized as a JSON object, such as a JWK passed in cnf.jwk, a JsonSerializable or a stdClass, is signed with its _sd member.

When the holder supplies that value, which is the case for the key in cnf, the holder can place digests of its choice under the Issuer signature, then append Disclosures for them at presentation time. The same key passed as an array is refused.

Possible Solution

Normalize the values serialized as JSON objects (JsonSerializable, stdClass and other objects) to arrays before concealing them, so the reserved-name check applies to every JSON object of the payload.

Additional Context

Found while checking a finding of the Anthropic OSS Scanner (ANT-2026-1MJ6B2EH).

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di web-token/jwt-framework

Tutte le issue di web-token/jwt-framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.