Popcorn contest - Mukund's results

A multi-chain regenerative yield-optimizing protocol.

General Information

Platform: Code4rena

Start Date: 31/01/2023

Pot Size: $90,500 USDC

Total HM: 47

Participants: 169

Period: 7 days

Judge: LSDan

Total Solo HM: 9

Id: 211

League: ETH

Popcorn

Findings Distribution

Researcher Performance

Rank: 115/169

Findings: 1

Award: $35.48

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Missing parameter validation in constructor

Some parameters of constructors are not checked for invalid values. MultiRewardEscrow.sol#L30-L32 DeploymentController.sol#L35-L44 VaultController.sol#L53-L70

Use of ecrecover is susceptible to signature malleability

The built-in EVM precompile ecrecover is susceptible to signature malleability, which could lead to replay attacks. References: https://swcregistry.io/docs/SWC-117, https://swcregistry.io/docs/SWC-121, and https://medium.com/cryptronics/signature-replay-vulnerabilities-in-smart-contracts-3b6f7596df57. While this is not immediately exploitable, this may become a vulnerability if used elsewhere.

function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { if (deadline < block.timestamp) revert PermitDeadlineExpired(deadline); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); if (recoveredAddress == address(0) || recoveredAddress != owner) revert InvalidSigner(recoveredAddress); _approve(recoveredAddress, spender, value); } }

MultiRewardStaking.sol#L459 Vault.sol#L678 AdapterBase.sol#L646

Use safeTransfer/safeTransferFrom consistently instead of transfer/transferFrom

Some tokens do not revert on failure, but instead return false so its better to use safeTransfer/safeTransferFrom and same for safeapprove

IERC20(rewardsToken).transferFrom(msg.sender, address(adminProxy), amount);

VaultController.sol#L456 VaultController.sol#L457

Missing address(0x0) check

function should check for 0 address check CloneRegistry.sol#L41-L51 MultiRewardStaking.sol#L170 DeploymentController.sol#L121-L125 PermissionRegistry.sol#L38-L49 Vault.sol#L211-L240

#0 - c4-judge

2023-02-28T15:05:24Z

dmvt marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter