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

QA Report #143

Open
code423n4 opened this issue Jul 19, 2022 · 1 comment
Open

QA Report #143

code423n4 opened this issue Jul 19, 2022 · 1 comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

1.ETHRegistrarController.renew() passing the wrong event NameRenewed parameters "cost"
https://github.com/code-423n4/2022-07-ens/blob/ff6e59b9415d0ead7daf31c2ed06e86d9061ae22/contracts/ethregistrar/ETHRegistrarController.sol#L207

    function renew(string calldata name, uint256 duration)
        external
        payable
        override
    {
     
        .....
        emit NameRenewed(name, label, msg.value, expires);     /****  change to: emit NameRenewed(name, label, price.base, expires);  ****/
        .....
    }

2.ETHRegistrarController.register() can pass any "resolver" and "data" parameters , then ETHRegistrarController do "functionCall "

It is possible to pass malicious parameters example :

resolver = baseRegistrar.address, and data = baseRegistrar.register()
then will register a “weird” ens

    var tx = await controller.register(
      "testtest",
      registrantAccount,
      REGISTRATION_TIME,
      secret,
      baseRegistrar.address,        //********resolver = baseRegistrar.address *******//
      [
        baseRegistrar.interface.encodeFunctionData(      //********data = baseRegistrar.register() *******//
          "register(uint256,address,uint256)",
          [
            namehash.hash("testtest.eth"),
            registrantAccount,
            REGISTRATION_TIME * 10000,
          ]
        ),
      ],
      false,
      0,
      0,
      { value: BUFFERED_REGISTRATION_COST }
    );

Recommendation add:

        require(
            resolver != address(base) &&
            resolver != address(nameWrapper) &&
            resolver != address(this)
        );

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Jul 19, 2022
code423n4 added a commit that referenced this issue Jul 19, 2022
@jefflau
Copy link
Collaborator

jefflau commented Aug 1, 2022

Duplicate of #222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

2 participants