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

Đang mở
#772 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
57/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

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của web-token/jwt-framework

Tất cả issue của web-token/jwt-framework

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.