Bidder's payout claim could fail due to validation checks in LinearVesting
The LinearVesting derivative's mint function rejects any mint after the derivative's expiry timestamp, so when a bidder tries to claim a payout for an expired derivative, the internal call to mint reverts and the claim fails. An attacker (or a seller) could exploit this by waiting until after expiry before revealing their private key, preventing bidders from claiming their rewards.
Aymen0909 Follow with FindEverythingX, ether_sky and 2 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-03-axis-finance-judging/issues/178
Found by
Aymen0909, FindEverythingX, ether_sky, hash, sl1
Summary
Bidder's payout claim will fail due to validation checks in LinearVesting after the expiry timestamp
Vulnerability Detail
Bidder's payout are sent by internally calling the _sendPayout function. In case the payout is a derivative which has already expired, this will revert due to the validation check of block.timestmap < expiry present in the mint function of LinearVesting derivative
function _sendPayout(
address recipient_,
uint256 payoutAmount_,
Routing memory routingParams_,
bytes memory
) internal {
if (fromVeecode(derivativeReference) == bytes7("")) {
Transfer.transfer(baseToken, recipient_, payoutAmount_, true);
}
else {
DerivativeModule module = DerivativeModule(_getModuleIfInstalled(derivativeReference));
Transfer.approve(baseToken, address(module), payoutAmount_);
=> module.mint(
recipient_,
address(baseToken),
routingParams_.derivativeParams,
payoutAmount_,
routingParams_.wrapDerivative
);
function mint(
address to_,
address underlyingToken_,
bytes memory params_,
uint256 amount_,
bool wrapped_
)
external
virtual
override
returns (uint256 tokenId_, address wrappedAddress_, uint256 amountCreated_)
{
if (amount_ == 0) revert InvalidParams();
VestingParams memory params = _decodeVestingParams(params_);
if (_validate(underlyingToken_, params) == false) {
revert InvalidParams();
}
function _validate(
address underlyingToken_,
VestingParams memory data_
) internal view returns (bool) {
....
=> if (data_.expiry < block.timestamp) return false;
// Check that the underlying token is not 0
if (underlyingToken_ == address(0)) return false;
return true;
}
Hence the user's won't be able to claim their payouts of an auction once the derivative has expired. For EMPAM auctions, a seller can also wait till this timestmap passes before revealing their private key which will disallow bidders from claiming their rewards.
Impact
Bidder's won't be able claim payouts from auction after the derivative expiry timestamp
Code Snippet
_sendPayout invoking mint function on derivative to send payouts https://github.com/sherlock-audit/2024-03-axis-finance/blob/cadf331f12b485bac184111cdc9ba1344d9fbf01/moonraker/src/AuctionHouse.sol#L823-L829
linear vesting derivative expiry checks https://github.com/sherlock-audit/2024-03-axis-finance/blob/cadf331f12b485bac184111cdc9ba1344d9fbf01/moonraker/src/modules/derivatives/LinearVesting.sol#L521-L541
Tool used
Manual Review
Recommendation
Allow to mint tokens even after expiry of the vesting token / deploy the derivative token first itself and when making the payout, transfer the base token directly incase the expiry time is passed
Discussion
sherlock-admin4
The protocol team fixed this issue in the following PRs/commits: https://github.com/Axis-Fi/moonraker/pull/116
10xhash
The protocol team fixed this issue in the following PRs/commits: Axis-Fi/moonraker#116
Fixed The expiry check is now removed
sherlock-admin4
The Lead Senior Watson signed off on the fix.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The LinearVesting derivative's mint function includes a validation check that rejects any mint when the derivative's expiry timestamp is in the past, but the payout logic still attempts to mint such derivatives after expiry.
Impact
Bidders cannot claim payouts from an auction after the derivative's expiry timestamp, and a seller can deliberately delay revealing their private key until after expiry to prevent bidders from claiming rewards.
What the attacker needed
Auction uses a derivative with expiry; derivative expiry passes before claim
The fix
The expiry check was removed in a fix, allowing minting even after the vesting token's expiry.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When someone wins an auction, the system sends them a token that vests over time. That token has an expiry date, and the code that creates it refuses to work after that date. So if a winner tries to claim after expiry, the claim fails and they get nothing.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.