Skip to content

fix(mpp): reject non-string opaque values - #108

Open
cryptoryda wants to merge 2 commits into
tempoxyz:mainfrom
cryptoryda:fix/validate-opaque-string-values
Open

fix(mpp): reject non-string opaque values#108
cryptoryda wants to merge 2 commits into
tempoxyz:mainfrom
cryptoryda:fix/validate-opaque-string-values

Conversation

@cryptoryda

Copy link
Copy Markdown
Contributor

Reject non-string opaque metadata values

Summary

Validate that every value in challenge and credential opaque metadata is a string.

The MPP opaque field is a flat string-to-string object. Previously, non-string values such as numbers, booleans, arrays, and nested objects were passed through anyStr, which could silently coerce them or turn them into empty strings.

Changes

  • Add a shared conversion helper that rejects non-string map values.
  • Apply strict validation when parsing challenge opaque metadata.
  • Apply the same validation to encoded-string and object credential representations.
  • Reject unsupported credential opaque representations.
  • Add public parser regression tests for each affected representation.

Testing

  • go test ./pkg/mpp
  • go vet ./...
  • go test -race -count=1 ./...

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