The _lzReceive
function in the TempleTeleporter
smart contract is responsible for handling cross-chain message receipt and subsequent token minting. However, the function does not validate the parameters
decoded from the received payload. This lack of validation can lead to potential security vulnerabilities, including unauthorized minting and misuse of the contract.
The _lzReceive function decodes the _payload to retrieve the recipient address (_recipient) and the amount of tokens (_amount). However, it fails to validate these parameters. Specifically, the function does not check whether:
The _recipient address is a valid, non-zero address.
The _amount is greater than zero.
See the following code:
If the _recipient
address is not validated, tokens could be minted to invalid or unintended addresses, leading to loss of tokens and potential unauthorized access. Without validation of the _amount
, tokens could be minted with zero, which can disrupt the token supply and contract logic. Malicious actors could craft payloads with invalid parameters to exploit the minting function, causing harm to the token ecosystem and affecting trust.
Manual Review
To mitigate this issue, it is essential to validate the parameters before proceeding with the minting operation. Specifically, the function should:
Ensure the _recipient is a valid, non-zero address.
Ensure the _amount is greater than zero.
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.