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 #106

Open
code423n4 opened this issue Jun 3, 2022 · 3 comments
Open

QA Report #106

code423n4 opened this issue Jun 3, 2022 · 3 comments
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

QA (LOW & NON-CRITICAL)

  • The whole project have different solidity compiler ranges (>0.8.7, 0.8.13) referenced. This leads to potential security flaws between deployed contracts depending on the compiler version chosen for any particular file. It also greatly increases the cost of maintenance as different compiler versions have different semantics and behavior.

  • There is no address(0) check in Seaport.sol's constructor() function

  • At ConduitController.sol, createConduit() function there is no address(0) check and 0 value check for the supplied parameters.

  • At ConduitController.sol, createConduit() function, the new conduit contract is created via Create2 function. However, the created conduit and the calculated address is not compared against each other. Reference

Conduit c = new Conduit{ salt: conduitKey }();
require (address(conduit) == address(c), "err");
  • Critical address changes are not done in two steps for the followings:
    At ConduitController.sol, createConduit()

Changing critical addresses in contracts should be a two-step process where the first transaction (from the old/current address) registers the new address (i.e. grants ownership) and the second transaction (from the new address) replaces the old address with the new one (i.e. claims ownership). This gives an opportunity to recover from incorrect addresses mistakenly used in the first step. If not, contract functionality might become inaccessible. Reference, Reference

  • At ConduitController.sol, getChannel() function, the logic should be;
if (channelIndex <= totalChannels) {
            revert ChannelOutOfRange(conduit);
        }

rather than;

if (channelIndex >= totalChannels) {
            revert ChannelOutOfRange(conduit);
        }
  • At AmountDeriver.sol's _getFraction() function, NatSpec states that the divisor should not be zero. However, it's not implemented in contract level by a require statement.

  • ConduitController.sol, BasicOrderFulfiller.sol, ConsiderationBase.sol, ReferenceConduitController.sol, use abi.encodePacked(). Using abi.encodePacked() with multiple variable length arguments can, in certain situations, lead to a hash collision. Instead abi.encode() can be used. Reference Link

GAS OPTIMIZATIONS

  • Event emitted from the STORAGE at OwnershipTransferred() in ConduitController.sol
@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 Jun 3, 2022
code423n4 added a commit that referenced this issue Jun 3, 2022
@0xleastwood 0xleastwood added the invalid This doesn't seem right label Jun 22, 2022
@HardlyDifficult HardlyDifficult removed the invalid This doesn't seem right label Jul 6, 2022
@code-423n4 code-423n4 deleted a comment from 0xleastwood Jul 6, 2022
@GalloDaSballo
Copy link

The whole project have different solidity compiler ranges (>0.8.7, 0.8.13)

Disagree per discussion on #65

Zero-checks in general / constructor / functions

Disagree for sake of gas savings

At ConduitController.sol, createConduit() function there is no address(0) check and 0 value check for the supplied parameters.

Agree because of #56
Low valid

At ConduitController.sol, createConduit() function is not compared

I believe the code to be fine, however had the warden demonstrated the actual inconsistency with a POC (address != estimate) then the finding could have been upgraded to a higher severity. In lack of that I believe this to be invalid

At ConduitController.sol, getChannel() function, the logic should be;

@0xleastwood @HardlyDifficult @0age this looks valid, wdyt?

Disagree with rest

1 or 2 Low Valid based on Sponsor Feedback

@HardlyDifficult
Copy link
Collaborator

At ConduitController.sol, getChannel() function, the logic should be;

The current code is correct. For example, let's say 3 channels were created and getChannel(1) is called. The proposal is if (1 <= 3) revert which should not revert.

@GalloDaSballo
Copy link

Updated #67 so

1L + 1 NC

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

4 participants