User can t claim reward erc20 tokens since rewards transfer will revert
The treasury contract checks its own reward-token registry before paying out ERC20 rewards, but the facet that adds and removes reward tokens keeps a separate registry. If a token is removed in the facet while still registered in the treasury, or added in the facet without being registered in the treasury, a user's claim reverts and the accrued reward cannot be paid out.
- Disclosed after under an hour
52165 sc high user can t claim reward erc20 tokens since rewards transfer will revert
Submitted on Aug 8th 2025 at 12:24:06 UTC by @WinSec for Attackathon | Plume Network
- Report ID: #52165
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/RewardsFacet.sol
- Impacts:
- Theft of unclaimed yield
Description
Brief/Intro
When users call claim it calls _finalizeRewardClaim which further calls _transferRewardFromTreasury which finally calls distributeReward on the PlumeStakingRewardTreasury contract. That call can revert due to this check in the treasury:
if (!_isRewardToken[token]) {
revert TokenNotRegistered(token);
}
Vulnerability Details
Reward tokens are added/removed in the RewardFacet contract via addRewardToken / removal functions and that facet maintains a mapping:
$.isRewardToken[token] = true;
When tokens are removed the mapping is set to false. However, the treasury contract uses a different mapping (_isRewardToken) and enforces the check above before distributing ERC20 rewards. If a token was removed in the RewardFacet but not registered in the treasury's _isRewardToken mapping (or vice versa), attempting to claim rewards will revert.
Relevant code paths:
- RewardFacet ultimately calls:
function _transferRewardFromTreasury(address token, uint256 amount, address recipient) internal {
address treasury = getTreasuryAddress();
if (treasury == address(0)) {
revert TreasuryNotSet();
}
// Make the treasury send the rewards directly to the user
IPlumeStakingRewardTreasury(treasury).distributeReward(token, amount, recipient);
}
- PlumeStakingRewardTreasury's ERC20 distribution branch:
} else {
// ERC20 token distribution
if (!_isRewardToken[token]) {
revert TokenNotRegistered(token);
}
uint256 balance = IERC20(token).balanceOf(address(this));
if (balance < amount) {
revert InsufficientBalance(token, balance, amount);
}
// Use SafeERC20 to safely transfer tokens
SafeERC20.safeTransfer(IERC20(token), recipient, amount);
}
Because the treasury checks its own _isRewardToken mapping, tokens added/removed only in RewardFacet may not be reflected in the treasury, causing a revert during claim.
The intended design appears to add reward tokens via the RewardFacet; therefore the treasury-side token existence check is unnecessary for ERC20 distribution (this is supported by the fact the native token branch doesn't perform an equivalent check).
Impact Details
Users won't be able to claim ERC20 reward tokens if the treasury's _isRewardToken mapping does not mark the token as registered — resulting in denial of reward claims and potential loss/theft of unclaimed yield.
References
Proof of Concept
{% stepper %} {% step %}
Add reward token in RewardFacet
RewardToken is added in the RewardFacet:
$.rewardTokens.push(token);
$.isRewardToken[token] = true;
{% endstep %}
{% step %}
User accrues rewards
A user accrues some rewards over time for that token. {% endstep %}
{% step %}
RewardToken removed in RewardFacet
The token is removed in the RewardFacet:
$.rewardTokens.pop();
// Update the mapping
$.isRewardToken[token] = false;
{% endstep %}
{% step %}
User calls claim()
User calls claim():
if (reward > 0) {
_finalizeRewardClaim(token, reward, msg.sender);
}
This calls:
_transferRewardFromTreasury(token, totalAmount, recipient);
which calls the treasury:
IPlumeStakingRewardTreasury(treasury).distributeReward(token, amount, recipient);
The treasury will revert because the token isn't registered in its _isRewardToken mapping:
if (!_isRewardToken[token]) {
revert TokenNotRegistered(token);
}
{% endstep %} {% endstepper %}
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
Likely two separate reward-token registries (one in the facet, one in the treasury) that are not kept in sync, with the treasury enforcing its own check on ERC20 payouts.
Impact
Users may be unable to claim ERC20 reward tokens, which could lead to denial of reward claims and potential loss of unclaimed yield.
What the attacker needed
A reward token is added then removed in the facet; the treasury registry disagrees with the facet; user has accrued rewards in that token
The fix
The treasury-side token existence check for ERC20 distribution should be removed, or the two registries should be kept in sync, since the intended design adds reward tokens via the RewardFacet.
How it was found
- A reward token is added in the RewardFacet, which sets its own registry entry to true.
- A user accrues rewards in that token over time.
- The token is removed in the RewardFacet, which sets its registry entry to false.
- The user calls claim(), which routes through _finalizeRewardClaim and _transferRewardFromTreasury to the treasury's distributeReward.
- The treasury reverts because its own registry does not mark the token as registered.
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.
A user earns reward tokens over time and later asks the contract to send them. Two different contracts each keep their own list of which tokens are allowed. When the lists disagree, the payout contract refuses to send the tokens, so the user's earned rewards stay stuck.
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.