There is a potential vulnerability in the Mint function of the HorseStore.huff
, denoted by the macro _MINT(). The issue arises from the comment indicating that the Mint function is payable
without a corresponding withdraw function, leading to a situation where Ether (ETH) sent to the contract can become stuck indefinitely.
The vulnerability is associated with the Mint function, as defined by the macro _MINT(). Specifically, the function lacks a mechanism to withdraw Ether (ETH) from the contract after it has been received. Without a withdraw function, any Ether sent to the contract through the Mint function will remain trapped within the contract, creating a potential loss of funds for users.
The absence of a withdraw function in the Mint operation means that any Ether sent to the contract through this function cannot be retrieved. As a result, users who mint tokens and send Ether along with the transaction may face a loss of funds, as there is no mechanism to extract the trapped Ether from the contract.
Manual review.
To address the identified vulnerability, the following recommendations are provided:
Add a Withdraw Function: Implement a withdraw function that allows the contract owner or users to retrieve any Ether stuck in the contract.
OR another alternative is:
Make Mint Function Non-Payable: Consider making the Mint function non-payable if there is no intended functionality requiring Ether to be sent along with token minting. This can prevent users from inadvertently sending Ether to the contract and facing potential loss.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.