Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpriveleged user cannot renew fuse expiry #223

Closed
code423n4 opened this issue Jul 19, 2022 · 6 comments
Closed

Unpriveleged user cannot renew fuse expiry #223

code423n4 opened this issue Jul 19, 2022 · 6 comments
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) invalid This doesn't seem right

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-07-ens/blob/ff6e59b9415d0ead7daf31c2ed06e86d9061ae22/contracts/wrapper/NameWrapper.sol#L271-L275

Vulnerability details

Impact

The renew() function in NameWrapper.sol is only authorised to be called by a controller. This means that it is impossible for a user to renew their fuse expiry as EthRegistrarController.sol does not make a call to NameWrapper.renew(). Therefore when a user's subdomain fuse expires, it allows for the parent to transfer away the subdomain without the user's permission thereby breaking the trustless nature of the protocol

Proof of Concept

Scenario #1:

  1. Alice owns test.eth and creates the subdomain www.test.eth for bob with the fuse PARENT_CANNOT_CONTROL burned
  2. Bob uses his subdomain
  3. When bob's subdomain expires, bob is not able to renew his subdomain causing the PARENT_CANNOT_CONTROL fuse to dissapear
  4. Alice can now claim ownership away from bob's subdomain and use it for malicious purposes (identity theft, etc..)
    Scenario Gas Optimizations #2:
  5. Alice owns test.eth and sets a certain fuse expiry date
  6. After a certain time, the expiry date is reached and all fuses are burned
  7. Alice has no method of renewing her fuses thereby losing functionality

Tools Used

VS Code

Recommended Mitigation Steps

In the renew() method call in EthRegistrarController.sol, add a call to renew() in NameWrapper.sol. Then make sure to remove one of the calls to registrar.renew() so that you don't increase the duration of the domain name by more than expected

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Jul 19, 2022
code423n4 added a commit that referenced this issue Jul 19, 2022
@csanuragjain
Copy link

csanuragjain commented Jul 20, 2022

#63 and #202 & #54 seems to be duplicate of this issue

@jefflau
Copy link
Collaborator

jefflau commented Jul 20, 2022

This is a duplicate, but the proof of concept is related to subdomains, not .eth domains. renew() won’t be called by Bob in this example, because he owns www.test.eth, which is a subdomain of an .eth name and so is not related to the .eth registrar. Recommend reducing severity to medium

@jefflau jefflau added the disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) label Jul 20, 2022
@Arachnid
Copy link
Collaborator

In fact, this should only be severity QA, as it can be worked around by calling renew on the registrar controller followed by setChildFuses.

@dmvt
Copy link
Collaborator

dmvt commented Aug 3, 2022

This report is invalid as it does not deal with a second, but a third level domain in the example. Third level domains (subdomains) are not renewed in this way.

@dmvt dmvt closed this as completed Aug 3, 2022
@dmvt dmvt added invalid This doesn't seem right and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Aug 3, 2022
@scaraven
Copy link

In my POC, I have outlined two scenarios, although it looks a bit strange due to the way GitHub deals with hashtags, the second does deal with second level domains.

@Arachnid
Copy link
Collaborator

Alice can renew her domain by calling renew; there is special-case code to handle allowing 2LD owners to renew their own domains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

6 participants