Skip to content

Latest commit

 

History

History
34 lines (19 loc) · 1.12 KB

164.md

File metadata and controls

34 lines (19 loc) · 1.12 KB

Atomic Tortilla Guppy

high

Unrestricted Minting in CrossChainCanonicalBase.sol

Summary

The contract includes a minting functionality without any restrictions on who can execute the function.

Vulnerability Detail

This may be misused by malicious users to mint any arbitrary amount of tokens, which may lead to a serious vulnerability – inflation.

Impact

The value of the tokens may drop drastically if an attacker manages to execute the _mint function and then sell these tokens on the market.

Code Snippet

https://github.com/sherlock-audit/2024-04-alchemix/blob/main/v2-foundry/src/CrossChainCanonicalBase.sol#L118

// Mint canonical tokens and give it to the sender
super._mint(msg.sender, canonicalTokensOut);

Tool used

Manual Review

Recommendation

To mitigate this vulnerability, consider adding an access control mechanism to the minting function, so that only authorized accounts (the contract owner, for example) can execute the function. An example of such a mechanism would be to use the OwnableUpgradeable contract from OpenZeppelin and make the minting function onlyOwner.