Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PoC] cmd/evm: malicious bloated 1559 transactions poc #22963

Closed
wants to merge 2 commits into from

Conversation

holiman
Copy link
Contributor

@holiman holiman commented May 28, 2021

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 either max_priority_fee_per_gas or max_fee_per_gas.

What they actually pay is

        priority_fee_per_gas = min(transaction.max_priority_fee_per_gas, transaction.max_fee_per_gas - block.base_fee_per_gas)

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 with 512K max_fee_per_gas (a.k.a feeCap), the second with 512K max_priority_fee_per_gas (a.k.a tip).
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 erroneously
calculating 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).

@holiman
Copy link
Contributor Author

holiman commented May 28, 2021

This vector is actually a consensus-bug,

in Nethermind we're using 256 bits fields for MaxPriorityFeePerGas and MaxFeePerGas.

So a block mined with one of these txs would be rejected by Nethermind.

@winsvega
Copy link
Contributor

does t8ntool perform such a check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants