Aura Finance contest - jayjonah8's results

Providing optimal incentives for VotingEscrow systems.

General Information

Platform: Code4rena

Start Date: 11/05/2022

Pot Size: $150,000 USDC

Total HM: 23

Participants: 93

Period: 14 days

Judge: LSDan

Total Solo HM: 18

Id: 123

League: ETH

Aura Finance

Findings Distribution

Researcher Performance

Rank: 59/93

Findings: 2

Award: $233.12

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L95

Vulnerability details

Impact

In AuraClaimZap.sol the setApprovals() function makes use of safeApprove() six times. OpenZeppelin's safeApprove implementation is deprecated. Using this deprecated function can lead to unintended reverts and potentially the locking of funds.

Proof of Concept

https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraClaimZap.sol#L95

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/566a774222707e424896c0c390a84dc3c13bdcb2/contracts/token/ERC20/utils/SafeERC20.sol#L38

https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2219

Tools Used

Manual code review

Consider replacing safeApprove() with safeIncreaseAllowance() or safeDecreaseAllowance() instead.

#0 - phijfry

2022-05-25T10:04:17Z

In all cases we are setting to 0 then setting to max. I don't believe there is any potential to become locked in the way described in this ticket.

#1 - 0xMaharishi

2022-05-25T16:22:24Z

All of the Aura safeApprove calls are either made in the constructor, or first set to 0 and then call again. I would say that this is valid although should be a 0 or 1

#2 - dmvt

2022-06-24T23:12:04Z

This holds as a QA issue. Deprecated code shouldn't be used ideally, but the issue will not lead to locking of funds or reverts. Even if they didn't notice a package upgrade or the like, the issue would present itself well before funds were locked.

Lines of code

https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L82

Vulnerability details

Impact

In Aura.sol the updateOperator() function can be called by anyone and it sets a new operator based on the address returned from IStaker(vecrvProxy).operator(). The problem is that anyone can call this function even if the operator on vecrvProxy is not yet set. If this is the case the operator in Aura.sol would be set to a zero address breaking the contract since functions like init() and mint() rely on the msg.sender being the operator. Even the minterMint() function relies on the operator since only the operator can set the minter which is the only one who can call minterMinter().

Proof of Concept

https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L82

Tools Used

Manual code review

The updateOperator() function should not be a public function and should only be callable by an admin or the operator inside Aura.sol. Also in the updateOperator() function, there should be a check ensuring that the newOperator address is not a zero address to prevent breaking the contract by setting the operator to a zero address.

#0 - phijfry

2022-05-24T14:11:54Z

The voter proxy is already deployed and the operator is not set to address(0). So this can't happen.

#1 - 0xMaharishi

2022-05-25T16:18:41Z

This is certainly not a high severity issue, I would say a 1 at most.

The only problem that could happen here is if someone is watching the Aura deployment, and then calls updateOperator immediately after Aura has been deployed, but before the init fn has been called.

Solution is to add some protections.. a) checking system has been initialised and b) non zero address

#2 - dmvt

2022-06-20T17:51:39Z

Agree that this is not high severity. I'm going to downgrade it to gas, since the impact would be that they would need to redeploy the contracts. No fund loss is possible with this issue.

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