Delegate - Fulum's results

Securing onchain identities by linking cold and hot wallets

General Information

Platform: Code4rena

Start Date: 05/09/2023

Pot Size: $50,000 USDC

Total HM: 2

Participants: 16

Period: 6 days

Judge: GalloDaSballo

Total Solo HM: 2

Id: 284

League: ETH

Delegate

Findings Distribution

Researcher Performance

Rank: 15/16

Findings: 1

Award: $40.13

QA:
grade-b

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

Findings Information

๐ŸŒŸ Selected for report: DadeKuma

Also found by: Brenzee, Fulum, gkrastenov, kodyvim, ladboy233, lodelux, lsaudit, p0wd3r, sces60107

Labels

bug
grade-b
QA (Quality Assurance)
Q-02

Awards

40.1294 USDC - $40.13

External Links

[01] For loop on a storage mapping can lead to a DoS

On the DelegateRegistry, anyone can call one of these function: delegateAll, delegateContract, delegateERC721, delegateERC20 and delegateERC1155. The functions with a good parameters do many things and one of them it's adding a hash in the mapping pointing on a to value, everyone can add different hash on these mapping. And because the two functions getIncomingDelegations and getIncomingDelegationHashes use for loop based on this mapping (which can have a very high length), this can lead to an out of gas on these two functions executions and cause a DoS.

Proof Of Concept

getIncomingDelegations for loop getIncomingDelegationHashes for loop

Mitigation

You can add a mechanism/function to limit the number of hashes that can be written to the mapping for a to parameters.

[02] Payable functions when the contract doesn't receive ETH

The following function below are payable but the function aren not designed to use ETH and if a user makes a mistake, these ETH are now stuck in the contract. There should be a require(0 == msg.value) to ensure no Ether is being sent to the contract which using payable function.

Proof Of Concept

multicall delegateAll delegateContract delegateERC721 delegateERC20 delegateERC1155

Mitigation

There should be a require(0 == msg.value) to ensure no Ether is being sent to the contract which using payable function. Or simply remove the payable on these functions.

[03] Bad documentation on the notice NatSpec

Bad documentation on CreateOfferer for the notice parameter, the documentation is for ratifyOrder function and not for generateOrder.

Proof Of Concept

https://github.com/code-423n4/2023-09-delegate/blob/a6dbac8068760ee4fc5bababb57e3fe79e5eeb2e/src/CreateOfferer.sol#L65

Mitigation

-- * @notice Implementation of seaport contract offerer generateOrder ++ * @notice Implementation of seaport contract offerer ratifyOrder

#0 - 0xfoobar

2023-09-18T17:57:33Z

Suggestion 3 is helpful

#1 - GalloDaSballo

2023-10-02T08:40:45Z

[01] For loop on a storage mapping can lead to a DoS OOS

[02] Payable functions when the contract doesnโ€™t receive ETH L

[03] Bad documentation on the notice NatSpec R

From Dups L+3

2L 1R + 3

#2 - c4-judge

2023-10-02T09:15:50Z

GalloDaSballo 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