Canto v2 contest - Limbooo's results

Execution layer for original work.

General Information

Platform: Code4rena

Start Date: 28/06/2022

Pot Size: $25,000 USDC

Total HM: 14

Participants: 50

Period: 4 days

Judge: GalloDaSballo

Total Solo HM: 7

Id: 141

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 37/50

Findings: 1

Award: $43.14

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

43.1396 USDC - $43.14

Labels

bug
QA (Quality Assurance)

External Links

(low) ERC20 allowance front-running issue.

Governance/Comp.sol is an ERC20 and it is not preventing allowance front-running issue, approving tokens to other accounts might be vulnerable to the front-running attack. more info here

PoC

in Governance/Comp.sol#approve() if there is non empty value in allowances[account][spender] the spender can use the 2 of the approvment even if the original account didn't want this.

Recommendation

Define increaseAllowance and decreaseAllowance as ERC20 implementation. or revert when allowances[account][spender] has a value only if the amount approved != 0 so the approver can cancel his approvement.


(non) Redundant check instead of new admin address check

When use msg.sender == address(0) its actually never would be true in every cases. I believe it's a mistake and it's meant to revert when updatedAddress == address(0).

PoC

when pendingAdmin call CToken.sol#_acceptAdmin() and Unitroller.sol#_acceptAdmin() will take the pendingAdmin from storage and assign it as admin. But when contract initialize pendingAdmin will be address(0) and this is never checked either in CToken.sol#_setPendingAdmin() nor in Unitroller.sol#_setPendingAdmin().

Recommendation

In these lines: CToken.sol#_acceptAdmin() and Unitroller.sol#_acceptAdmin()

// Check caller is pendingAdmin and pendingAdmin ≠ address(0) if (msg.sender != pendingAdmin || msg.sender == address(0)) { ...

I believe it meant to be

if (msg.sender != pendingAdmin) { ...

or

if (msg.sender != admin && pendingAdmin == address(0)) { ...

#0 - GalloDaSballo

2022-08-13T22:50:53Z

(low) ERC20 allowance front-running issue.

Disputed as the allowance front-running is not to be fixed by the token, but by the caller, see the standard <img width="1457" alt="Screenshot 2022-08-14 at 00 49 43" src="https://user-images.githubusercontent.com/13383782/184515818-120f0877-d1a7-4f75-a378-324792fb406c.png">

(non) Redundant check instead of new admin address check

NC

1 NC

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