[PoC] cmd/evm: malicious bloated 1559 transactions poc #22963
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the readme in this PR:
EIP-1559 malicious bloat
This test contains testcases for EIP-1559, which tests an attack where transactions are bloated.
The transactions uses a
1Mb
-sized integer to specify eithermax_priority_fee_per_gas
ormax_fee_per_gas
.What they actually pay is
So it is possible to dump huge amount of data into one of the fields.
A user can maliciously bombard blocks with no penalty, and a miner can create basically arbitrary large blocks.
There are two transactions in
txs.rlp
, the first one with512K
max_fee_per_gas
(a.k.afeeCap
), the second with512K
max_priority_fee_per_gas
(a.k.atip
).The
txs.json
is what was used to generate the two malicious ones.This attack is a bit hard to pull off, even on a testnet. In various json-conversions, go-ethereum does not allow
marshallling integers above
256
bits. Further, the txpool rejects oversized transactions, and is also erroneouslycalculating the
cost
of a transaction.This PoC shows that the consensus engine accepts such bloated transactions. This means that a valid block, post 1559, can be arbitrarily
large, without that extra bloat costing anything (except for the miner who increases the chance to be uncled).