The transferDeposit
function in the SiloFacet
contract facilitates the transfer of a single deposit of ERC20 tokens from one user (sender) to another (recipient). The function's security relies on correctly identifying the transaction initiator (msg.sender or designated sender). However, there is a critical issue with how the sender (LibTractor._user()) is determined and used in the function, particularly when activePublisher
is set in LibTractor.
In the current implementation of transferDeposit
, the function uses LibTractor._user()
to determine the sender's address. This function is intended to return msg.sender
or the activePublisher
if set. However, there is a risk associated with this approach. If LibTractor._user() returns an activePublisher address due to it being set (not equal to address(1)), the function may revert transactions unexpectedly. This can occur despite msg.sender being equal to the designated sender or having sufficient allowance, leading to transaction failures and potential user frustration.
The issue primarily stems from the reliance on LibTractor._user() to determine the transaction initiator. When activePublisher is set, it may override the intended msg.sender or designated sender, leading to unexpected transaction behavior and potential reverts.
The incorrect determination of the sender's address can lead to security vulnerabilities, especially in scenarios where activePublisher does not align with the expected transaction originator.
Manual Review
To mitigate this issue, consider revising the transferDeposit
function to explicitly use msg.sender
or the provided sender parameter as the transaction sender. This approach ensures clarity and consistency in how transactions are processed, reducing the risk of unintended reverts and enhancing security.
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.