Skip to content
Access control Audit finding Advanced

An attacker can change the account balance after the transaction has been processed.

A node in the execution group could alter account balances after a transaction was processed because the binary_repair_oos_accounts handler did not recompute the proposal hash during signature verification. An attacker running such a node could set any balance for accounts involved in transactions it processed.

periniondon630 Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#35526 [BC-Critical] An attacker can change the account balance after the transaction has been proce

Submitted on Sep 26th 2024 at 13:11:33 UTC by @periniondon630 for Audit Comp | Shardeum: Core II

Description

Brief/Intro

An attacker's active node from the execution group can change the account balance after a transaction involving this account has been processed by the network.

Vulnerability Details

The P2P handler binary_repair_oos_accounts does not recalculate the proposalHash during the signature verification process from receipt.signaturePack. This vulnerability allows an attacker to modify account data and the corresponding afterStateHash in the receipt proposal, enabling the update of the account state on the validator node. For the attack to be successful, the attacker's node must be part of the execution group for the transaction.

Impact Details

An attacker can set the balance to any value for any account involved in transactions processed within the execution group in which the attacker's node is participating.

References

https://github.com/shardeum/shardus-core/blob/23e06ded6744d8521cff9d749c1f1dd482c5fcb6/src/state-manager/AccountPatcher.ts#L490

Link to Proof of Concept

https://gist.github.com/periniondon630/ee50d02c09c87fb97d31d53b1f1bd9cf

Proof of Concept

Proof of Concept

I’ve added a callback for the event when a transaction is archived, following the method outlined in the documentation. Apply the patch from the gist to the attacker's node, wait for it to become active, and then send a transaction. Check the attacker's node output log—it will display a message when the transaction is archived, indicate which account will be targeted (the first one is selected), and show the nodes to which requests will be sent. The final balance will be set to 100 coins.

The original report as published on Immunefi, by periniondon630. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The binary_repair_oos_accounts P2P handler verified a signature but did not recompute the proposal hash, so modified account data and afterStateHash were accepted.

Impact

An attacker could set the balance to any value for any account involved in transactions processed within the execution group in which the attacker's node participates.

What the attacker needed

Attacker's node is in the execution group; attacker's node is active

How it was found

  1. Apply the patch from the gist to the attacker's node.
  2. Wait for the attacker's node to become active in the execution group.
  3. Send a transaction.
  4. Check the attacker's node output log for the archived transaction message and targeted account.
  5. Observe the final balance set to 100 coins.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A blockchain network splits work between groups of computers called nodes. When a transaction is processed, one node can send a repair message to others about account data. This report says that message was trusted without fully checking it, so a dishonest node could rewrite an account balance.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by periniondon630

View all

11 more disclosed reports, best first.

More from Shardeum: Core II

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.