Notional contest - defsec's results

Fixed rates, now in crypto.

General Information

Platform: Code4rena

Start Date: 27/01/2022

Pot Size: $75,000 USDC

Total HM: 10

Participants: 26

Period: 7 days

Judge: pauliax

Total Solo HM: 5

Id: 81

League: ETH

Notional

Findings Distribution

Researcher Performance

Rank: 11/26

Findings: 4

Award: $849.08

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)

Awards

171.7186 USDC - $171.72

External Links

Handle

defsec

Vulnerability details

Impact

The contract uses Chainlink’s deprecated API latestAnswer(). Such functions might suddenly stop working if Chainlink stopped supporting deprecated APIs.

Impact: Deprecated API stops working. Prices cannot be obtained. Protocol stops and contracts have to be redeployed.

See similar Low-severity finding L11 from OpenZeppelin's Audit of Opyn Gamma Protocol: https://blog.openzeppelin.com/opyn-gamma-protocol-audit/

This was a Medium-severity finding even in the previous version of WildCredit contest as well: code-423n4/2021-07-wildcredit-findings#75 where it was reported that "latestAnswer method will return the last value, but you won’t be able to check if the data is fresh. On the other hand, calling the method latestRoundData allow you to run some extra validations”

Proof of Concept

https://github.com/code-423n4/2022-01-notional/blob/main/contracts/utils/EIP1271Wallet.sol#L176

See https://docs.chain.link/docs/deprecated-aggregatorinterface-api-reference/#latestanswer.

Tools Used

Code Review

Consider to add checks on the return data with proper revert messages if the price is stale or the round is incomplete, for example:

(uint80 roundID, int256 price, , uint256 timeStamp, uint80 answeredInRound) = ETH_CHAINLINK.latestRoundData(); require(price > 0, "Chainlink price <= 0"); require(answeredInRound >= roundID, "..."); require(timeStamp != 0, "...");

#0 - jeffywu

2022-02-06T15:10:25Z

Duplicate #178

#1 - pauliax

2022-02-12T12:15:48Z

A duplicate of #197

Findings Information

🌟 Selected for report: TomFrenchBlockchain

Also found by: Dravee, Jujic, defsec

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

Awards

654.3157 USDC - $654.32

External Links

Handle

defsec

Vulnerability details

Impact

The setCoolDownTime function does not have any upper or lower bounds. Values that are too large will lead to reversions in several critical functions. User funds will be locked forever.

Proof of Concept

  1. Navigate to the following contract.

https://github.com/code-423n4/2022-01-notional/blob/main/contracts/sNOTE.sol#L95

function redeem(uint256 sNOTEAmount) external nonReentrant { AccountCoolDown memory coolDown = accountCoolDown[msg.sender]; require(sNOTEAmount <= balanceOf(msg.sender), "Insufficient balance"); require( coolDown.redeemWindowBegin != 0 && coolDown.redeemWindowBegin < block.timestamp && block.timestamp < coolDown.redeemWindowEnd, "Not in Redemption Window" ); uint256 bptToRedeem = getPoolTokenShare(sNOTEAmount); _burn(msg.sender, bptToRedeem); BALANCER_POOL_TOKEN.safeTransfer(msg.sender, bptToRedeem); }

Tools Used

Code Review

Ensure that coolDownPeriod has minimum/maximum bound.

#0 - pauliax

2022-02-14T14:45:33Z

#40

Findings Information

🌟 Selected for report: IllIllI

Also found by: Dravee, defsec, robee, throttle

Labels

bug
duplicate
G (Gas Optimization)

Awards

23.0433 USDC - $23.04

External Links

Handle

defsec

Vulnerability details

Impact

++i is more gas efficient than i++ in loops forwarding.

Proof of Concept

  1. Navigate to the following contracts.
https://github.com/code-423n4/2022-01-notional/blob/main/contracts/TreasuryAction.sol#L157

Tools Used

Code Review

It is recommend to use unchecked{++i} and change i declaration to uint256.

#0 - jeffywu

2022-02-06T15:00:31Z

Duplicate #228

#1 - pauliax

2022-02-13T10:36:09Z

#228

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