Description:
In the Treasury.sol
contract, the deposit
function is publicly accessible, allowing any address to deposit any ERC20 token into the contract. The function only verifies that the token address is non-zero and that the deposit amount is greater than zero. It does not validate the depositor’s identity or confirm whether the token is permitted by the protocol. This lack of controls means that deposits are accepted without tracking the sender’s identity or enforcing protocol-specific token restrictions.
Impact:
This issue could lead to potential mismanagement and auditability challenges. Without proper tracking of depositors, reconciling funds and ensuring compliance with protocol standards becomes difficult. Moreover, accepting any ERC20 token without validation may expose the contract to unintended interactions or misuse, increasing the complexity of fund management and risk analysis.
Proof of Concept:
Recommended Mitigation:
Introduce stricter access controls by implementing an appropriate access modifier (e.g., OnlyOwner
) if the deposit function is intended for a specific group. Alternatively, if public deposits are acceptable, add a mapping to record the amount of tokens deposited by each address. This enhancement will improve auditability and ensure that only protocol-approved tokens are accepted, aligning the function’s behavior with intended security and operational requirements.
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.