is executed. Let's now suppose on the address of sentinel an instance of WildcatSanctionsSentinel has been deployed - this means that the constructor function from the file WildcatSanctionsSentinel.sol has been run:
account has been set to address(1) and the transfer function sends the tokens to address(1), essentially burning them, which is not the desired behavior.
Tools Used
Manual review.
Recommended Mitigation Steps
The function releaseEscrow should ensure that account != address(1). That can be achieved with adding a require statement:
function releaseEscrow() public override {
if (!canReleaseEscrow()) revert CanNotReleaseEscrow();
require(account != address(1), "Should not send tokens to reset account");
uint256 amount = balance();
IERC20(asset).transfer(account, amount);
emit EscrowReleased(account, asset, amount);
}
}
Lines of code
https://github.com/code-423n4/2023-10-wildcat/blob/c5df665f0bc2ca5df6f06938d66494b11e7bdada/src/WildcatSanctionsSentinel.sol#L24-L32 https://github.com/code-423n4/2023-10-wildcat/blob/c5df665f0bc2ca5df6f06938d66494b11e7bdada/src/WildcatSanctionsEscrow.sol#L16-L19 https://github.com/code-423n4/2023-10-wildcat/blob/c5df665f0bc2ca5df6f06938d66494b11e7bdada/src/WildcatSanctionsEscrow.sol#L33-L42
Vulnerability details
Impact
ERC20 tokens are incorrectly burnt.
Proof of Concept
In the file
WildcatSanctionsEscrow.sol
there is aconstructor
function:Let's suppose this
constructor
function is called. In such a casesentinel
is set tomsg.sender
and the line:is executed. Let's now suppose on the address of
sentinel
an instance ofWildcatSanctionsSentinel
has been deployed - this means that theconstructor
function from the fileWildcatSanctionsSentinel.sol
has been run:At the end of the
constructor
, the function_resetTmpEscrowParams
:is run and
tmpEscrowParams
is set toTmpEscrowParams(address(1), address(1), address(1));
.Let's suppose the function
releaseEscrow
from the fileWildcatSanctionsEscrow.sol
is called next:and on the line:
the tokens are sent to
account
. However, before that, on the line:account
has been set toaddress(1)
and thetransfer
function sends the tokens toaddress(1)
, essentially burning them, which is not the desired behavior.Tools Used
Manual review.
Recommended Mitigation Steps
The function
releaseEscrow
should ensure thataccount != address(1)
. That can be achieved with adding arequire
statement:Assessed type
Invalid Validation