• James Prestwich's avatar
    accounts/usbwallet: mitigate ledger app chunking issue (#26773) · 1e3177de
    James Prestwich authored
    This PR mitigates an issue with Ledger's on-device RLP deserialization, see
    https://github.com/LedgerHQ/app-ethereum/issues/409
    
    Ledger's RLP deserialization code does not validate the length of the RLP list received,
    and it may prematurely enter the signing flow when a APDU chunk boundary falls immediately
    before the EIP-155 chain_id when deserializing a transaction. Since the chain_id is
    uninitialized, it is 0 during this signing flow. This may cause the user to accidentally
    sign the transaction with chain_id = 0. That signature would be returned from the device 1
    packet earlier than expected by the communication loop. The device blocks the
    second-to-last packet waiting for the signer flow, and then errors on the successive
    packet (which contains the chain_id, zeroed r, and zeroed s)
    
    Since the signature's early arrival causes successive errors during the communication
    process, geth does not parse the improper signature produced by the device, and therefore
    no improperly-signed transaction can be created. User funds are not at risk.
    
    We mitigate by selecting the highest chunk size that leaves at least 4 bytes in the
    final chunk.
    1e3177de
Name
Last commit
Last update
.github Loading commit data...
accounts Loading commit data...
beacon/engine Loading commit data...
build Loading commit data...
cmd Loading commit data...
common Loading commit data...
consensus Loading commit data...
console Loading commit data...
contracts/checkpointoracle Loading commit data...
core Loading commit data...
crypto Loading commit data...
docs Loading commit data...
eth Loading commit data...
ethclient Loading commit data...
ethdb Loading commit data...
ethstats Loading commit data...
event Loading commit data...
graphql Loading commit data...
internal Loading commit data...
les Loading commit data...
light Loading commit data...
log Loading commit data...
metrics Loading commit data...
miner Loading commit data...
node Loading commit data...
p2p Loading commit data...
params Loading commit data...
rlp Loading commit data...
rpc Loading commit data...
signer Loading commit data...
swarm Loading commit data...
tests Loading commit data...
trie Loading commit data...
.dockerignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.golangci.yml Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
Dockerfile Loading commit data...
Dockerfile.alltools Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
SECURITY.md Loading commit data...
appveyor.yml Loading commit data...
circle.yml Loading commit data...
go.mod Loading commit data...
go.sum Loading commit data...
interfaces.go Loading commit data...
oss-fuzz.sh Loading commit data...