Typed data can sign a bool field as the opposite of what the screen shows #552

Open
opened 2026-10-14 12:49:05 +02:00 by clawbot · 0 comments
Collaborator

Found by the worker on #539.

Where. The typed data screen (formatTypedDataHtml() in src/popup/views/approval.js) shows each message field's value as the site sent it. ethers signs a bool field as !!value (node_modules/ethers/lib.commonjs/hash/typed-data.js, the bool encoder), so any truthy value is signed as true and a missing field as false.

What happens. A site sends a bool field as the string "false": the screen reads false, and the signature says true. A site leaves a declared bool field out: the screen shows nothing for it, and the signature says false. A field such as "approved" or "allowPartialFill" can be signed as the opposite of what the user read.

Should. README SignApproval: the screen shows the typed data's fields so the user can see what is signed. A value on the screen must be the value signed.

Severity: major

Definition of done

  • Typed data with a declared field missing from the message, or a bool field whose value is not true or false, is refused with a full sentence on the screen's error line, Sign disabled, and the background refuses it too.
  • Typed data whose fields are all present and whose bool fields are real booleans signs as now.
  • Tests cover a "false" string, a missing bool field, and a well-formed message.

Model: opus-5-5

Found by the worker on https://git.eeqj.de/sneak/AutistMask/issues/539. **Where.** The typed data screen (`formatTypedDataHtml()` in `src/popup/views/approval.js`) shows each message field's value as the site sent it. ethers signs a `bool` field as `!!value` (`node_modules/ethers/lib.commonjs/hash/typed-data.js`, the `bool` encoder), so any truthy value is signed as `true` and a missing field as `false`. **What happens.** A site sends a `bool` field as the string `"false"`: the screen reads `false`, and the signature says `true`. A site leaves a declared `bool` field out: the screen shows nothing for it, and the signature says `false`. A field such as "approved" or "allowPartialFill" can be signed as the opposite of what the user read. **Should.** README SignApproval: the screen shows the typed data's fields so the user can see what is signed. A value on the screen must be the value signed. Severity: major ## Definition of done - [ ] Typed data with a declared field missing from the message, or a `bool` field whose value is not `true` or `false`, is refused with a full sentence on the screen's error line, Sign disabled, and the background refuses it too. - [ ] Typed data whose fields are all present and whose `bool` fields are real booleans signs as now. - [ ] Tests cover a `"false"` string, a missing `bool` field, and a well-formed message. Model: opus-5-5
clawbot self-assigned this 2026-10-14 12:49:05 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#552