Some tokens enable the direct draining of all approved ERC20Votes tokens
ENS
MediumCode4rena
Every publicly disclosed report for ENS and what kind of bugs they were.
Newest first. Only what ENS chose to make public.
ENS
MediumThe 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
MediumENS
MediumThe 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
MediumThe 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
MediumThe OffchainDNSResolver contract calls supportsInterface on a DNS resolver without first checking that the resolver implements ERC165, so the call reverts for resolvers that do not support ERC165. This prevents resolution through such resolvers, even if they are otherwise functional.
ENS
MediumThe 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
MediumThe 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
MediumA 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
MediumDuring 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
HighThe 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
HighExpired 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
MediumThe NameWrapper contract's upgrade functions burn the node before calling the new contract, losing the old owner information. This allows a user to transfer a name to a new owner during upgrade even if the CANNOT_TRANSFER fuse is burned, bypassing the transfer restriction.
ENS
MediumThe 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
MediumThe 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
HighThe compare function in BytesUtils.sol does not validate that the provided offset and length parameters are within the bounds of the input byte arrays. An attacker could supply malformed DNS names with out-of-range offsets and lengths, causing compare to return incorrect results without reverting.
ENS
MediumENS
MediumThe 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
MediumThe 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
MediumThe 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
MediumThe unwrapETH2LD function uses transferFrom instead of safeTransferFrom to transfer an ERC721 token to a new registrant. If the new registrant is a contract that cannot handle ERC721 tokens, the token could become locked.
ENS
MediumThe DNSSEC signature verification in ENS compared the signer's name to the covered name as a raw string suffix rather than by DNS labels, so a signer name that is merely a substring of the covered name could pass. An attacker could potentially forge a DNSSEC trust chain and authenticate domains outside the signer's zone.
ENS
MediumThe 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
MediumThe 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
MediumThe 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
HighThe 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
MediumA re-entrancy flaw in NameWrapper's transfer-and-burn-fuses routine lets a contract callback unwrap a subdomain before the new owner and fuses are written, leaving a fake ERC1155 NameWrapper token for a domain the wrapper no longer owns. An attacker could sell that token and later re-wrap the domain to steal it back.
ENS
HighThe 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
MediumThe 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