Renew of 2nd level domain is not done properly
Originally disclosed on Code4rena
Submitted by csanuragjain, also found by cccz and GimelSec
ETHRegistrarController.sol#L201 NameWrapper.sol#L271
The ETHRegistrarController is calling renew from base registrar and not through Namewrapper. This means the fuses for the subdomain will not be updated via _setData. This impacts the permission model set over subdomain and could lead to takeover
Proof of Concept
- Observe the renew function
function renew(string calldata name, uint256 duration)
external
payable
override
{
...
uint256 expires = base.renew(uint256(label), duration);
....
}
- As we can see this is calling renew function of Base Registrar instead of NameWrapper. Since this is not going via NameWrapper fuses will not be set
- Also since renew in NameWrapper can only be called via Controller which is ETHRegistrarController so there is no way to renew subdomain
Recommended Mitigation Steps
The ETHRegistrarController must renew using Namewrapper’s renew contract.
Duplicate of #223.
On #223, which I’ve invalidated, @Arachnid notes that:
In fact, this should only be severity QA, as it can be worked around by calling
renewon the registrar controller followed bysetChildFuses.I’m going to make this report the main one and leave the risk rating of Medium in place. While there is a workaround, if the workaround is not employed, permissions will be incorrect and may lead to a breakdown in the functioning of the protocol.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity access control bug in ENS. Code4rena made it public on 13 December 2022. Found in the 2022-07-ens audit contest (finding M-02).
About Access control
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.