SIGN IN SIGN UP

fix: Reject typed-transaction chain IDs longer than 64 bits

process_chain_id() accepted chainId fields up to INT256_LENGTH (32
bytes) for EIP-2930 / EIP-1559 / EIP-7702 transactions, but downstream
get_tx_chain_id() converts the stored value to uint64_t via
u64_from_BE() which silently consumes only the first 8 bytes. The
signature hash still covers the full original encoding, so a malicious
host could craft a transaction whose signature applies to one chain
while the device displays / validates only the truncated 64-bit prefix.

Restrict the field length validation to sizeof(uint64_t). Any chain ID
that does not fit in a uint64_t is now rejected at the parser level
rather than being truncated, keeping the UI / network selection / chain
consistency checks aligned with what gets signed.

(cherry picked from commit ddf6c76afebe53d9a836b8209e7118a6406ed3e6)
C
Charles-Edouard de la Vergne committed
ef0e1d22b0db8e323cb331323684b9e4e88f559a
Parent: d5aa918
Committed by Alexandre Paillier <alexandre.paillier@ledger.fr> on 8/25/2026, 3:03:57 PM