Alchemist can mint AlTokens
above their assigned ceiling by calling lowerHasMinted()
#166
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-05-alchemix/blob/de65c34c7b6e4e94662bf508e214dcbf327984f4/contracts-full/AlchemicTokenV2Base.sol#L111-L124
https://github.com/code-423n4/2022-05-alchemix/blob/de65c34c7b6e4e94662bf508e214dcbf327984f4/contracts-full/AlchemicTokenV2Base.sol#L189-L191
Vulnerability details
Impact
An alchemist / user can mint more than their alloted amount of AlTokens by calling
lowerHasMinted()
before they reach their minting cap.Proof of Concept
Function
mint()
inAlchemicTokenV2Base.sol
Note the require conditional check that
total > mintCeiling[msg.sender]
.In the same contract, there is the function
lowerHasMinted()
with the same permission level as mint and is thus callable by the same user as well.It is clear that a user can accumulate an infinite (within supply) amount of AlTokens by calling
lowerHasMinted()
before any action that would make them exceed their minting cap.Tools Used
Manual review, VScode
Recommended Mitigation Steps
Change the permissioning on
lowerHasMinted()
to be restricted to a higher permissioned role likeonlySentinel()
, or deprecate this function as I could not find any uses of it throughout the codebase or in tests.The text was updated successfully, but these errors were encountered: