The Graph L2 bridge contest - joestakey's results

A protocol for indexing and querying blockchain data.

General Information

Platform: Code4rena

Start Date: 07/10/2022

Pot Size: $50,000 USDC

Total HM: 4

Participants: 62

Period: 5 days

Judge: 0xean

Total Solo HM: 2

Id: 169

League: ETH

The Graph

Findings Distribution

Researcher Performance

Rank: 7/62

Findings: 1

Award: $1,752.93

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: d3e4

Also found by: catchup, cccz, joestakey

Labels

bug
duplicate
2 (Med Risk)

Awards

1752.9293 USDC - $1,752.93

External Links

Lines of code

https://github.com/code-423n4/2022-10-thegraph/blob/309a188f7215fa42c745b136357702400f91b4ff/contracts/gateway/BridgeEscrow.sol#L28-L30

Vulnerability details

BridgeEscrow.approveAll allows a _spender to transfer all the GRT stored in BridgeEscrow.

While this function is meant to be used as an escape hatch - by using a Merkle proof contract to reclaim funds based on an L2 snapshot, it still constitutes a potential rugging vector that can grieve users that have bridged their GRT to Arbitrum.

Impact

Medium

Proof Of Concept

  • Users bridge their GRT to L2
  • Governor calls BridgeEscrow.approveAll(Recipient), recipient being a malicious EOA/SC
  • recipient steals all the GRT in BridgeEscrow.

Tools Used

Manual Analysis

Mitigation

A timelock system would be complicated to design because of Arbitrum's dispute period. A safer option is to have an emergency withdrawal using a "pull" pattern to allow users to reclaim funds themselves. You can combine it with the Merkle Proof snapshot detailed in the specs.

#0 - trust1995

2022-10-16T00:12:46Z

Seems to be an issue the project is aware of.

#1 - 0xean

2022-10-16T13:44:48Z

dupe of #40

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter