Skip to content

Code4rena

ENS

Every publicly disclosed report for ENS and what kind of bugs they were.

disclosed reports
29
most reported class
Business logic
bug classes found
5
first disclosure
2022
Find ENS on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what ENS chose to make public.

Smart contracts

HexUtils.hexStringToBytes32() and HexUtils.hexToAddress() may return incorrect results

The HexUtils.hexStringToBytes32() and hexToAddress() functions do not validate the length of the input hex string, so they can return incorrect results when the input is not exactly 32 (or 20) bytes. An attacker could exploit this to cause the contract to behave abnormally or for malicious purposes.

ENS

Medium
Smart contracts

Missing recursive calls handling in OffchainDNSResolver CCIP-aware contract

The OffchainDNSResolver contract's resolveCallback function does not catch OffchainLookup errors from a nested CCIP-aware resolver, so a nested error with an incorrect sender field is passed to the client. This could cause the client to perform an off-chain lookup against the wrong contract, leading to incorrect resolution.

ENS

Medium
Business logic

Unintentionally register a non-relevant DNS name owner

The DNS name claim function accepted an owner address of the wrong length and silently truncated it to the last 20 bytes, so the ENS name was transferred to an unintended address. An attacker who controls that truncated address could take over the ENS name.

ENS

Medium
Business logic

Invalid addresses will be accepted as resolvers, possibly bricking assets

The hexToAddress utility truncates a 256-bit value to 160 bits without checking that the discarded upper bits are zero, so an invalid DNS address can be accepted as a valid resolver. This can cause the ENS node to be set to an incorrect owner address, potentially bricking it.

ENS

Medium
Business logic

Incorrect implementation of RecordParser.readKeyValue()

The RecordParser.readKeyValue() function returns an incorrect value when the terminator (space) is not found within the specified range, because it sets the terminator to the input length instead of the end of the range. An attacker could exploit this to cause contracts using the library to parse data incorrectly, potentially leading to unexpected behaviour.

ENS

Medium
Access control

NameWrapper: Wrapped to Unregistered to ignore PARENT_CANNOT_CONTROL

A wrapped subdomain with the PARENT_CANNOT_CONTROL fuse could be unwrapped and its ENS registry owner set to zero, making it appear unregistered. The parent could then recreate the subdomain and take control, despite the fuse that should prevent parent control.

ENS

Medium
Access control

During the deprecation period where both .eth registrar controllers are active, a crafted hack can be launched and cause the same malicious consequences of [H-01] even if [H-01] is properly fixed

During the deprecation period when both the old and new .eth registrar controllers are active, an attacker can re-register an expired wrapped name using the old controller, which implicitly unwraps it while the NameWrapper still considers it valid. The attacker can then reclaim the registry owner and take over subdomains that were previously transferred to a victim with PARENT_CANNOT_CONTROL burnt.

ENS

High
Access control

PARENT_CANNOT_CONTROL and CANNOT_CREATE_SUBDOMAIN fuses can be bypassed

The ENS NameWrapper contract allowed a parent node owner to bypass the PARENT_CANNOT_CONTROL and CANNOT_CREATE_SUBDOMAIN fuses by unwrapping and re-wrapping intermediate nodes, enabling them to reclaim ownership of a victim's subnode and create sub-subnodes despite the burnt fuses.

ENS

High
Business logic

NameWrapper: expired names behave unwrapped

Expired ENS names wrapped by NameWrapper were treated as unwrapped rather than unregistered, because the registry owner remained the wrapper contract while the wrapper reported no owner. A parent with the CANNOT_CREATE_SUBDOMAIN fuse could therefore create or modify subdomains after they expired, bypassing the fuse.

ENS

Medium
Smart contracts

Wrong Equals Logic

The equals function in BytesUtils.sol incorrectly returns true when comparing a byte array with an offset to a shorter byte array, because it checks if self.length is greater than or equal to offset + other.length instead of equal. An attacker could exploit this to cause incorrect equality checks, potentially leading to logic errors in the DNSSEC oracle.

ENS

Medium
Business logic

The expiry of the parent node can be smaller than the one of a child node, violating the guarantee policy

The expiry of a parent node can become smaller than that of its child node because unwrapping a node sets its expiry to zero, removing the constraint that normally limits a child's expiry to the parent's. An attacker could create a sub-sub-domain with a long expiry, unwrap the intermediate sub-domain, then re-wrap it with a shorter expiry, violating the guarantee that a child's expiry never exceeds its parent's.

ENS

High
Access control

wrapETH2LD permissioning is over-extended

The wrapETH2LD function allows an address approved on the wrapper contract to wrap an unwrapped domain, even though that approval should only cover already-wrapped tokens. An attacker with such approval could wrap a victim's unwrapped domain and take control of it.

ENS

Medium
Business logic

BytesUtil.compare returns wrong result on some strings longer than 32 characters

The compare function in BytesUtils masks out irrelevant characters only for strings shorter than 32 characters, so when comparing strings longer than 32 characters with a specified length shorter than the string, characters beyond that length are still compared. This causes incorrect comparison results and also makes RRUtils.compareNames fail to correctly compare DNS names in certain cases.

ENS

Medium
Business logic

If PARENT_CANNOT_CONTROL is set on subdomain, it can be unwrapped then wrapped by its owner and then parent can control it again before the expiry

The NameWrapper contract allowed burning the PARENT_CANNOT_CONTROL fuse without also burning CANNOT_UNWRAP, so a subdomain owner could unwrap and rewrap the name, clearing the fuse and letting the parent regain control before expiry. An attacker who is the parent could then change ownership of the subdomain, breaking the owner's expectation of security until expiry.

ENS

Medium
Smart contracts

Incorrect implementation of RRUtils.serialNumberGte

The serial number comparison function in the DNSSEC oracle contract did not correctly implement RFC1982 serial number arithmetic, so certain pairs of serial numbers could cause a revert or incorrect comparison. An attacker could potentially exploit this to disrupt DNSSEC validation, though the issue would not occur until far in the future.

ENS

Medium
Smart contracts

transfer() depends on gas consts

The ENS registrar controller uses transfer() to refund excess ether, which forwards only 2300 gas to the recipient's fallback function. If a contract registering a name has a fallback that needs more gas, the refund fails and the whole registration transaction reverts.

ENS

Medium
Access control

PARENT_CANNOT_CONTROL can be bypassed by maliciously unwrapping parent node

The PARENT_CANNOT_CONTROL fuse is meant to prevent a parent from changing a subdomain's owner or fuses, but a parent can bypass this by unwrapping itself and then re-wrapping the subdomain, thereby overwriting the subdomain's fuses and owner. An attacker who owns a parent domain can thus take control of a victim's subdomain even after the victim has burned PARENT_CANNOT_CONTROL.

ENS

High
Access control

Users can create extra ENS records at no cost

The ENS registrar controller allowed users to pass arbitrary calldata to a resolver during registration, which could be abused to call privileged functions on other ENS contracts. An attacker could mint an extra ENS entry for free, though the resulting name is essentially junk.

ENS

Medium
Business logic

ERC1155Fuse : _transfer does not revert when sent to the old owner

The ERC1155Fuse contract's _transfer function returns early when the recipient is already the token's owner, so safeTransferFrom does not revert even if the sender's balance is insufficient. This violates the ERC-1155 standard and could mislead other contracts into assuming a transfer occurred.

ENS

Medium
Business logic

The preimage DB (i.e., NameWrapper.names ) can be maliciously manipulated/corrupted

The NameWrapper contract's preimage database can be corrupted because it checks whether a node is wrapped by comparing the ENS registry owner to the contract address, which an attacker can spoof by directly setting the owner via the ENS registry. An attacker could then wrap a subdomain without recording its name, leading to incorrect or empty entries in the preimage database.

ENS

Medium