Streaming Protocol contest - Jujic's results

General Information

Platform: Code4rena

Start Date: 30/11/2021

Pot Size: $100,000 USDC

Total HM: 15

Participants: 36

Period: 7 days

Judge: 0xean

Total Solo HM: 4

Id: 62

League: ETH

Streaming Protocol

Findings Distribution

Researcher Performance

Rank: 10/36

Findings: 3

Award: $3,528.88

🌟 Selected for report: 3

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: WatchPug

Also found by: Jujic, hack3r-0m

Labels

bug
duplicate
3 (High Risk)

Awards

2175.7011 USDC - $2,175.70

External Links

Handle

Jujic

Vulnerability details

A call to an arbitrary contract with custom calldata is made in arbitraryCall(address who, bytes memory data), which means the contract can be an ERC20 token, and the calldata can be transferFrom a previously approved user.

Impact

The wallet balances (for the amount up to the allowance limit) of the tokens that users approved to the Stream contract can be stolen.

Proof of Concept

https://github.com/code-423n4/2021-11-streaming/blob/56d81204a00fc949d29ddd277169690318b36821/Streaming/src/Locke.sol#L743

The attacker create Stream contract on the Factory and malicious ERC20 contract

Bob has approved 1000 tokens on Stream contract

Attacker call function:

arbitraryCall(address who, bytes memory data) public lock externallyGoverned { where: who = address arbitrary malicious ERC20 contract data = abi.encodeWithSignature( "transferFrom(address,address,uint256)", address(Bob), any address hacker, 1000 tokens ) ... (bool success, bytes memory _ret) = who.call(data); require(success);

As a result, 1000 token will be stolen from Bob and sent to the attacker.

Tools Used

Remix

You can remove this dangerous function from the protocol.

#0 - 0xean

2022-01-14T21:40:17Z

dupe #258

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