Closed code423n4 closed 1 year ago
https://github.com/code-423n4/2023-01-popcorn/blob/main/src/vault/VaultController.sol#L132 https://github.com/code-423n4/2023-01-popcorn/blob/main/src/vault/Vault.sol#L57
This is the initialize function of contract Vault. It has 5 parameters.
function initialize( IERC20 asset_, IERC4626 adapter_, VaultFees calldata fees_, address feeRecipient_, address owner ) external initializer {
But when calling this function in VaultController, the parameter type is struct VaultInitParams. According to docs of Solidity, struct is encoded as tuple (https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#mapping-solidity-to-abi-types). This conflicts with the function definition. Which may results in memory corruption.
RedVeil marked the issue as sponsor disputed
dmvt marked the issue as unsatisfactory: Insufficient quality
Lines of code
https://github.com/code-423n4/2023-01-popcorn/blob/main/src/vault/VaultController.sol#L132 https://github.com/code-423n4/2023-01-popcorn/blob/main/src/vault/Vault.sol#L57
Vulnerability details
Impact
This is the initialize function of contract Vault. It has 5 parameters.
But when calling this function in VaultController, the parameter type is struct VaultInitParams. According to docs of Solidity, struct is encoded as tuple (https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#mapping-solidity-to-abi-types). This conflicts with the function definition. Which may results in memory corruption.
Proof of Concept
Tools Used
Recommended Mitigation Steps