Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

`emergencyRevoke` does not work as intended

Summary

emergencyRevoke does not work as intended.

Vulnerability Details

Currently emergencyRevoke is used in the case of emergency where if this contract has a bug in it or the receiver the EMERGENCY_ROLE can revoke the vest, preventing the funds from leaving this contract.

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/minters/RAACReleaseOrchestrator/RAACReleaseOrchestrator.sol#L126-L139

function emergencyRevoke(address beneficiary) external onlyRole(EMERGENCY_ROLE) {
VestingSchedule storage schedule = vestingSchedules[beneficiary];
if (!schedule.initialized) revert NoVestingSchedule();
uint256 unreleasedAmount = schedule.totalAmount - schedule.releasedAmount;
delete vestingSchedules[beneficiary];
if (unreleasedAmount > 0) {
raacToken.transfer(address(this), unreleasedAmount);
emit EmergencyWithdraw(beneficiary, unreleasedAmount);
}
emit VestingScheduleRevoked(beneficiary);
}

However the issue is that when it tries to transfer the funds out, it actually transfers them to this contract raacToken.transfer(address(this), unreleasedAmount) instead.

This means that if there is a bug or a hack the emergency won't do anything besides to stop the vesting. The funds will still be inside the contract, vulnerable to the exploiter.

Impact

emergencyRevoke does not save the funds.
It transfers them to the wrong address.
Function does not work as intended.

Tools Used

Manual review

Recommendations

Consider transferring them either to msg.sender or treasury so that if the current contract is hacked the funds will be safe.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

RAACReleaseOrchestrator::emergencyRevoke sends revoked tokens to contract address with no withdrawal mechanism, permanently locking funds

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

RAACReleaseOrchestrator::emergencyRevoke sends revoked tokens to contract address with no withdrawal mechanism, permanently locking funds

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!