-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Numbers larger than 2^64 are truncated by parse_z. It's ok not to be able to parse it, but this should be an error rather than silently dropping some bits. This could be exploited by an attacker to trick the user into signing a transaction with a small amount while the real one is a lot larger. Of course right now this can't be exploited because there are not enough tokens on the network to account for such a transfer.
ledger-app-tezos/src/operations.c
Lines 70 to 82 in 1b19a26
| static inline uint64_t parse_z(const void *data, size_t *ix, size_t length, uint32_t lineno) { | |
| uint64_t acc = 0; | |
| uint64_t shift = 0; | |
| while (true) { | |
| uint64_t byte = next_byte(data, ix, length, lineno); | |
| acc |= (byte & 0x7F) << shift; | |
| shift += 7; | |
| if (!(byte & 0x80)) { | |
| break; | |
| } | |
| } | |
| return acc; | |
| } |
Metadata
Metadata
Assignees
Labels
No labels