The send
function in the TempleGold
contract fails to adequately validate critical fields within the _sendParam
parameter, specifically the destination chain ID (_sendParam.dstEid
) and the amounts (_sendParam.amountLD
and _sendParam.minAmountLD
). This oversight can lead to unexpected behavior, vulnerabilities, or disruptions in cross-chain token transfers.
The send
function facilitates cross-chain transfers of Temple Gold tokens (TGLD
) by interacting with the LayerZero
endpoint. However, it lacks proper validation for essential parameters within _sendParam, which can result in the following vulnerabilities:
The function does not verify if the provided destination chain ID (_sendParam.dstEid
) is within acceptable ranges or supported configurations. This omission can lead to transfers being routed to unintended or invalid destinations.
Similarly, the function does not enforce constraints on the amounts (_sendParam.amountLD
and _sendParam.minAmountLD
) being transferred. This can result in transfers of invalid or insufficient token amounts, potentially affecting transaction integrity or user expectations.
See the following code:
Transfers may be directed to incorrect or unsupported destinations, resulting in loss of funds or failed transactions. Invalid amounts transferred can lead to unexpected financial outcomes or discrepancies in token balances. Exploitation of validation gaps could be leveraged by malicious actors to manipulate transactions or disrupt contract operations.
Manual Review
Implement checks to ensure that _sendParam.dstEid
is within a predefined range of valid chain IDs or supported configurations. Validate _sendParam.amountLD
and _sendParam.minAmountLD
to ensure they meet predefined criteria, such as minimum transaction amounts or within available token balances.
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.