Open Dollar - okolicodes's results

A floating $1.00 pegged stablecoin backed by Liquid Staking Tokens with NFT controlled vaults.

General Information

Platform: Code4rena

Start Date: 18/10/2023

Pot Size: $36,500 USDC

Total HM: 17

Participants: 77

Period: 7 days

Judge: MiloTruck

Total Solo HM: 5

Id: 297

League: ETH

Open Dollar

Findings Distribution

Researcher Performance

Rank: 76/77

Findings: 1

Award: $8.30

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

8.3007 USDC - $8.30

Labels

bug
grade-b
low quality report
QA (Quality Assurance)
Q-03

External Links

[L-01] Low level call returns true if the Target address doesn't exist

https://github.com/open-dollar/od-contracts/blob/f4f0246bb26277249c1d5afe6201d4d9096e52e6/src/contracts/proxies/ODProxy.sol?plain=1#L26-L36

Impact

As written in the solidity documentation, the low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed.

Proof of Concept

The low-level function delegatecall is used in the execute function in the OD proxy and it can be problematic. The function makes proper check by making sure the address is not a zero address but does not check if it is a contract address that can be able to execute code and if the target doesn't exist, success will be equal to true and the function will return true and the code execution will be continued like the call was successful. https://github.com/open-dollar/od-contracts/blob/f4f0246bb26277249c1d5afe6201d4d9096e52e6/src/contracts/proxies/ODProxy.sol#L26

bool _succeeded; (_succeeded, _response) = _target.delegatecall(_data);

Also the return value of the data should be checked as well...

Tools Used

Manual Review

Check before any low-level call that the target address actually exists, for example before the delegate call in the OD proxy function you can check that the address is a contract by checking its code size. Another way in which you can mitiagte this is by checking for the returndata. A simple check like this will actually be fine:

if (data.length <= 4) { revert(); //delegatecall failed }

#0 - c4-pre-sort

2023-10-27T00:21:36Z

raymondfam marked the issue as low quality report

#1 - c4-judge

2023-11-03T16:53:40Z

MiloTruck marked the issue as grade-b

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