Skip to content

eth: reject malformed typed data safely - #172

Open
Tomasvrba wants to merge 1 commit into
BitBoxSwiss:masterfrom
Tomasvrba:typed-data-fix
Open

eth: reject malformed typed data safely#172
Tomasvrba wants to merge 1 commit into
BitBoxSwiss:masterfrom
Tomasvrba:typed-data-fix

Conversation

@Tomasvrba

Copy link
Copy Markdown
Collaborator

Decode EIP-712 payloads into typed structures and return errors for malformed JSON structures, value paths, and scalar types instead of panicking during firmware requests.

Tightens validation in the API in preparation for Wallet Connect upgrades

@Tomasvrba
Tomasvrba requested a review from benma July 22, 2026 20:46
Decode EIP-712 payloads into typed structures and return errors
for malformed JSON structures, value paths, and scalar types instead
of panicking during firmware requests.

eth: validate typed data string fields

Reject missing or null primaryType and member names before sending a
malformed request to the firmware.

eth: preserve exact typed data keys

Use checked map lookups so differently cased fields cannot replace fields used for signing.

@benma benma 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.

Should disable goconst in all our repos, that linter annoy more than it helps 😅

@Tomasvrba

Copy link
Copy Markdown
Collaborator Author

Should disable goconst in all our repos, that linter annoy more than it helps 😅

Yeah, I think the fix is worse than the actual issue 👎 :D

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