Skip to content
Access control Write-up Advanced

I will give you the Exploit steps in CIRCLE company. and where is

A forwarding hook in xReserve executes arbitrary calldata against TokenMessenger, which has unlimited allowance from xReserve. An attacker who can supply a valid attestation could craft forwarding calldata to pull tokens from the reserve/gateway wallet.

ethaga Follow

Published on medium.com

[## GitHub - circlefin/evm-xreserve-contracts: Official repository for all EVM-compatible smart…

ethaga, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the forwarding hook executes arbitrary calldata without restricting which functions can be called, combined with unlimited token allowances granted to TokenMessenger.

Impact

An attacker who can supply a valid attestation could drain tokens from the reserve/gateway wallet, but the exploit requires compromise of an attestation signer or misconfiguration, as attestation signatures are verified via ECDSA.

What the attacker needed

Valid attestation or compromised signer; reserve/gateway wallet holds tokens; attacker can call withdraw

How it was found

  1. Deploy or fork a chain with xReserve, GatewayWallet, and TokenMessenger, ensuring xReserve sets unlimited allowances for TokenMessenger.
  2. Deposit tokens into the reserve/gateway wallet.
  3. Craft malicious forwarding calldata that calls a TokenMessenger function performing transferFrom.
  4. Build an attestation whose TransferSpec contains hook data with forwardingContract pointing to TokenMessenger and forwardingCalldata set to the payload.
  5. Call reserve.withdraw with the crafted attestation and signature from an attacker-controlled account.
  6. Observe xReserve executing the forwarding and TokenMessenger transferring tokens from the reserve to the attacker.

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 write-up has not been written yet. The Original tab links to the source.

A smart contract called xReserve lets a trusted messenger contract move its tokens without asking each time. The messenger can be told to run any instruction, so if someone can trick the system into accepting a fake permission slip (attestation), they can make the messenger send the reserve's tokens to themselves.

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.

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.