Backd Tokenomics contest - 0x52's results

Maximize the power of your assets and start earning yield

General Information

Platform: Code4rena

Start Date: 27/05/2022

Pot Size: $75,000 USDC

Total HM: 20

Participants: 58

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 15

Id: 131

League: ETH

Backd

Findings Distribution

Researcher Performance

Rank: 4/58

Findings: 2

Award: $6,831.33

🌟 Selected for report: 1

🚀 Solo Findings: 1

Findings Information

🌟 Selected for report: WatchPug

Also found by: 0x52

Labels

bug
duplicate
3 (High Risk)

Awards

4098.7998 USDC - $4,098.80

External Links

Lines of code

https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/Minter.sol#L187-L215

Vulnerability details

Submitting as a high risk bug because it is equivalent to calling startInflation() which is a function reserved for only governance to call and it drastically alters token distribution

Impact

Bypass governance only call restriction and cause immediate inflation decay

Proof of Concept

The two main functions of startInflation() is to set lastEvent and lastInflationDecay to block.timestamp. startInflation() is restricted to allow governance to start inflation when it chooses. However these values can be set to block.timestamp by any user that calls executeInflationRateUpdate() because that function is not restricted to only governance. This allows any user to start inflation whenever they want. executeInflationRateUpdate() calls _executeInflationRateUpdate which sets lastEvent = block.timestamp in L189:

https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/Minter.sol#L189

it also sets lastInflationDecay = block.timestamp in L212:

https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/Minter.sol#L212

Additionally inflation decay will be immediately applied because L190 will return true because lastInflationDecay will still be at the default value of 0:

https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/Minter.sol#L190

Tools Used

Add same lastEvent check as other functions in the contract

function executeInflationRateUpdate() external override returns (bool) { if (lastEvent == 0) return 0; return _executeInflationRateUpdate(); }

#0 - chase-manning

2022-06-08T07:56:44Z

duplicate of #99

#1 - GalloDaSballo

2022-06-18T23:32:51Z

Dup of #99

Findings Information

🌟 Selected for report: 0x52

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

2732.5332 USDC - $2,732.53

External Links

Lines of code

https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/Controller.sol#L62-L76

Vulnerability details

Impact

Unclaimed fees from pool will be stuck

Proof of Concept

When delisting a pool the pool's reference is removed from address provider:

https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/Controller.sol#L63

Burning fees calls a dynamic list of all pools which no longer contains the delisted pool:

https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/RewardHandler.sol#L39

Since the list no longer contains the pool those fees will not be processed and will remain stuck in the contract

Tools Used

Call burnFees() before delisting a pool

#0 - GalloDaSballo

2022-06-22T16:52:10Z

The warden has shown how, by removing a pool before calling burnFees, the removed pool will not receive the portion of fees that it should.

Because this finding related to loss of yield, I believe Medium Severity to be appropriate

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