ENS Contest - Parad0x's results

Decentralised naming for web3

General Information

Platform: Code4rena

Start Date: 14/04/2023

Pot Size: $90,500 USDC

Total HM: 7

Participants: 59

Period: 14 days

Judge: LSDan

Total Solo HM: 3

Id: 232

League: ETH

ENS

Findings Distribution

Researcher Performance

Rank: 19/59

Findings: 1

Award: $694.56

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: hihen

Also found by: Parad0x, bin2chen, chaduke, eierina, nobody2018, rvierdiiev

Labels

bug
2 (Med Risk)
satisfactory
duplicate-246

Awards

694.5552 USDC - $694.56

External Links

Lines of code

https://github.com/code-423n4/2023-04-ens/blob/45ea10bacb2a398e14d711fe28d1738271cd7640/contracts/dnsregistrar/RecordParser.sol#L14-L40

Vulnerability details

Impact

The return value of readKeyValue could be incorrect in some cases.

The primary issue stems from the function's assumption that if it cannot locate the terminator within the range [offset, offset+len), then there is no terminator in the input, subsequently setting the terminator offset to input.length.

Proof of Concept

The readKeyValue() function is designed to read key and value pairs and return the offset (nextOffset) of the next key-value pair. However, there is an issue in the code implementation.

When the function tries to extract the value portion, it searches for a white space as the terminator and sets the 'terminator' variable to the offset of the terminator. If the function is unable to locate the terminator, it sets the 'terminator' variable to input.length, assuming that no terminator exists within the range [offset+len, input.length). This situation also carries the unintended consequence of potentially reading more than the designated 'len' characters specified by the input.

Tools Used

Manual review.

terminator= offset + len; instead of terminator = input.length;

#0 - c4-pre-sort

2023-05-01T10:31:46Z

thereksfour marked the issue as duplicate of #246

#1 - c4-judge

2023-05-08T14:44:51Z

dmvt marked the issue as satisfactory

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