Skip to content

fix: validate DID issuers and bind token metadata (WAL-391) - #159

Merged
erniey-kraken merged 1 commit into
masterfrom
wal-391-issuer-validation
Nov 30, 2026
Merged

erniey-kraken merged 1 commit into
masterfrom
wal-391-issuer-validation

Conversation

@erniey-kraken

Copy link
Copy Markdown
Contributor

Summary

Prevent crafted DID issuers from passing signer validation while injecting a different issuer into metadata requests.

Changes

  • Validate the complete did:ethr:0x<40 hex characters> issuer format, rejecting suffixes and trailing whitespace.
  • Encode GET query parameters using URLSearchParams.
  • Validate tokens before both token-based metadata lookups.
  • Reject returned metadata whose canonical issuer does not match the validated signer.
  • Preserve valid address casing and support alternate wallet addresses.
  • Add regression tests using freshly signed tokens and document automatic metadata-token validation.

Compatibility

getMetadataByToken() and getMetadataByTokenAndWallet() now perform token validation automatically. Invalid, expired, or audience-mismatched tokens fail before an HTTP request.

Validation

  • 108 tests passed across 25 suites.
  • Production build and ESLint passed.
  • Regression coverage includes issuer injection, trailing newlines, query encoding, metadata identity mismatches, and valid mixed-case issuers.

The API duplicate-issuer mitigation is handled separately and should be deployed first.

Ticket: https://seabound.atlassian.net/browse/WAL-391

@erniey-kraken erniey-kraken self-assigned this Nov 17, 2026

@oxyn-payward oxyn-payward left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm!

@erniey-kraken
erniey-kraken merged commit 9cb1d0f into master Nov 30, 2026
7 checks passed
@erniey-kraken
erniey-kraken deleted the wal-391-issuer-validation branch November 30, 2026 07:39
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.

2 participants