Skip to content

Fix APDU dispatch and metadata parsing edge cases #288

Merged
abenso merged 3 commits into
mainfrom
fix/improvements
Apr 23, 2026
Merged

Fix APDU dispatch and metadata parsing edge cases #288
abenso merged 3 commits into
mainfrom
fix/improvements

Conversation

@abenso
Copy link
Copy Markdown
Contributor

@abenso abenso commented Apr 16, 2026

  • APDU improve state machine.
  • Metadata proof must fully consume registry, indices and lemmas.
  • Swap handle_check_address enforces the same HD-path whitelist as SIGN and validates the declared path length.
  • INS_SIGN_RAW requires blobLen to match the buffered payload.
  • Display item counter goes through addItemCount; rejects overflow.
  • Signed-extension names match via identifier_matches (exact len).
  • INS_GET_ADDR rejects unsupported P2 curves.
  • GET_ADDR confirm renders 33 bytes for secp256k1, 32 for ed25519.
  • Swap chain whitelist uses strcmp instead of hardcoded-length.
  • Crypto hash / pubkey buffers MEMZERO'd on every exit path.
  • CheckMetadataHash mode byte bounds-checked before deref.
  • parseMetadataEntry releases recursion counter on every exit.
  • Fuzz harness advances the pageIdx used in the loop condition.

@Zondax Zondax deleted a comment from github-actions Bot Apr 16, 2026
@abenso abenso force-pushed the fix/improvements branch from 6350896 to 264c84a Compare April 16, 2026 16:07
@abenso abenso force-pushed the fix/improvements branch from 264c84a to b73593b Compare April 17, 2026 15:33
@chcmedeiros chcmedeiros self-requested a review April 23, 2026 06:23
@abenso abenso merged commit 6c0b2a3 into main Apr 23, 2026
250 checks passed
@abenso abenso deleted the fix/improvements branch April 23, 2026 12:46
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