Skip to content

fix: crash in SD-JWT selective disclosure when a verifier asks for both a claim and one of its children - #466

Merged
smncd merged 2 commits into
release/sirosidfrom
fix/claim-paths-to-frame-nested
Nov 17, 2026
Merged

smncd merged 2 commits into
release/sirosidfrom
fix/claim-paths-to-frame-nested

Conversation

@smncd

@smncd smncd commented Nov 17, 2026

Copy link
Copy Markdown
Member

Summary

Fixed a crash in SD-JWT selective disclosure when a verifier asks for both a claim and one of its children (e.g. address and address.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 change Object.prototype.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Performance
  • Documentation
  • Tests
  • Build/CI
  • Chore

Checklist

  • I self-reviewed my changes
  • I added/updated tests (or explained why not)
  • I updated documentation (if needed)
  • I ran the relevant checks locally (lint/unit/integration)
  • I verified backward compatibility / migration notes (if needed)
  • I added monitoring/logging (if needed)

Security checklist

  • No secrets, credentials, or API keys are hardcoded
  • New dependencies have been reviewed for known vulnerabilities
  • User input is validated and sanitized where applicable
  • No new attack surface introduced without security review
  • PII/sensitive data handling follows data protection policies
  • N/A — this PR does not affect code, deps, or configuration

Notes for reviewers

  • ...

@smncd
smncd requested a review from a team as a code owner November 17, 2026 12:16
@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: afc1e0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wallet-frontend Patch

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 smncd changed the title Fix a crash in SD-JWT selective disclosure when a fix: crash in SD-JWT selective disclosure when a verifier asks for both a claim and one of its children Nov 17, 2026
@smncd
smncd requested review from Didr and lov1saconde and a balanced review from Copilot November 17, 2026 12:17
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@smncd
smncd merged commit 853981e into release/sirosid Nov 17, 2026
15 checks passed
@smncd
smncd deleted the fix/claim-paths-to-frame-nested branch November 17, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants