Kelp DAO | rsETH - ziyou-'s results

A collective DAO designed to unlock liquidity, DeFi and higher rewards for restaked assets through liquid restaking.

General Information

Platform: Code4rena

Start Date: 10/11/2023

Pot Size: $28,000 USDC

Total HM: 5

Participants: 185

Period: 5 days

Judge: 0xDjango

Id: 305

League: ETH

Kelp DAO

Findings Distribution

Researcher Performance

Rank: 153/185

Findings: 1

Award: $2.76

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

2.7592 USDC - $2.76

Labels

bug
downgraded by judge
grade-b
insufficient quality report
QA (Quality Assurance)
duplicate-69
Q-93

External Links

Lines of code

https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L156 https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L172

Vulnerability details

Impact

The _setContract and _setToken functions only verify whether tokenMap[key] == val and contractMap[key] == val already exist, without checking whether tokenMap[x] == val and contractMap[y] == val. In other words, it does not validate whether val already exists, where x and y represent values that were previously set in tokenMap and contractMap.This leads to the potential for duplicate settings of the assetAddress parameter and the contractAddress parameter, consequently giving rise to a series of issues.

Proof of Concept

https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L156 function _setToken(bytes32 key, address val) private { UtilLib.checkNonZeroAddress(val); if (tokenMap[key] == val) { revert ValueAlreadyInUse(); } tokenMap[key] = val; emit SetToken(key, val); }

https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L172 function _setContract(bytes32 key, address val) private { UtilLib.checkNonZeroAddress(val); if (contractMap[key] == val) { revert ValueAlreadyInUse(); } contractMap[key] = val; emit SetContract(key, val); }

Tools Used

vs

add check

Assessed type

Context

#0 - c4-pre-sort

2023-11-16T03:00:24Z

raymondfam marked the issue as insufficient quality report

#1 - c4-pre-sort

2023-11-16T03:01:01Z

raymondfam marked the issue as duplicate of #69

#2 - c4-judge

2023-11-29T20:58:13Z

fatherGoose1 changed the severity to QA (Quality Assurance)

#3 - c4-judge

2023-11-29T21:01:13Z

fatherGoose1 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