Closed code423n4 closed 2 years ago
Adding nonce for this is a reasonable suggestion, without this the user could make a minor change to the input params so they were not really blocked. So lowering the risk here and merging with the warden's QA report #310
Lines of code
https://github.com/code-423n4/2022-06-nibbl/blob/8c3dbd6adf350f35c58b31723d42117765644110/contracts/NibblVaultFactory.sol#L50
Vulnerability details
Impact
In
NibbleVaultFactory.createVault()
function, the proxy vault is deployed usingCREATE2
opcode. This allows the ability to predict the address where the contract will be deployed. The address is calculated asAnd in this implementation, the salt is computed only using parameters of the vault which can be duplicated and make the second deployment fail.
Proof of concept
Scenario
Tools Used
Manual Review
Recommended Mitigation Steps
Add a nonce for each user or allow users to pass in a
_mix
like increateBasket()
function.