Repository navigation
fix: crash in SD-JWT selective disclosure when a verifier asks for both a claim and one of its children - #466
Merged
Conversation
…rifier asks for both a claim and one of its children
🦋 Changeset detectedLatest commit: afc1e0d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
smncd
requested review from
Didr and
lov1saconde
and
a balanced review from Copilot
November 17, 2026 12:17
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the selective-disclosure frame fix.
No open issues 🎉
What changed in this PR
Fixes SD-JWT selective disclosure frame construction when a verifier requests both a parent claim and one of its children.
Changes:
- Merges parent and child paths into a nested frame regardless of request order.
- Uses null-prototype objects to prevent prototype pollution through
__proto__paths. - Adds regression tests and a patch changeset.
| File | Description |
|---|---|
src/lib/verifiable-credentials/formats/sd-jwt.ts |
Safely merges overlapping claim paths and creates null-prototype frame objects. |
src/lib/verifiable-credentials/formats/sd-jwt.test.ts |
Tests both path orders and protection against prototype pollution. |
.changeset/great-rabbits-look.md |
Records the selective disclosure crash fix for a patch release. |
Review effort: Balanced
Didr
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fixed a crash in SD-JWT selective disclosure when a verifier asks for both a claim and one of its children (e.g.
addressandaddress.country). These now merge into{ address: { country: true } }in either order. The frame is also built from objects with no prototype, so a__proto__claim path can no longer changeObject.prototype.Type of change
Checklist
Security checklist
Notes for reviewers