Token admin can dos admin to not let admin change purchase token
The setPurchaseToken function reverts if any token is enabled, and a token admin can enable a token without permission and never disable it. This lets the token admin block the protocol admin from changing the purchase token.
- Disclosed after under an hour
52841 sc medium token admin can dos admin to not let admin change purchase token
- Submitted on Aug 13th 2025 at 14:57:15 UTC by @ladboy233 for Attackathon | Plume Network
- Report ID: #52841
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcTokenPurchase.sol
- Impacts:
- Contract fails to deliver promised returns, but doesn't lose value
Description
(see Vulnerability Details)
Vulnerability Details
In ArchTokenPurchase.sol, the admin should be able to setPurchaseToken and change the purchase token.
Relevant code:
function setPurchaseToken(
address purchaseTokenAddress
) external onlyRole(DEFAULT_ADMIN_ROLE) {
PurchaseStorage storage ps = _getPurchaseStorage();
if (ps.enabledTokens.length() > 0) { // @audit token owner can block admin from change the purchase token for sure.
revert CannotChangePurchaseTokenWithActiveSales();
}
if (purchaseTokenAddress == address(0)) {
revert InvalidPurchaseTokenAddress();
}
ps.purchaseToken = IERC20(purchaseTokenAddress);
emit PurchaseTokenUpdated(purchaseTokenAddress);
}
However, the code requires that no token is enabled:
if (ps.enabledTokens.length() > 0) { // @audit token owner can block admin from change the purchase token for sure.
revert CannotChangePurchaseTokenWithActiveSales();
}
But the token admin can permissionlessly enable a token and never disable a token:
modifier onlyTokenAdmin(
address _tokenContract
) {
address adminRoleHolder = msg.sender;
bytes32 adminRole = ArcToken(_tokenContract).ADMIN_ROLE();
if (!ArcToken(_tokenContract).hasRole(adminRole, adminRoleHolder)) {
revert NotTokenAdmin(adminRoleHolder, _tokenContract);
}
_;
}
Therefore the token admin can DOS the protocol admin from changing the purchase token by simply not disabling the token or by enabling a token before the protocol setPurchaseToken call.
Impact Details
{% hint style="warning" %}
The token admin can permissionlessly DOS the protocol admin to prevent the protocol admin from changing the purchase token by leaving any token enabled (or enabling one before setPurchaseToken).
{% endhint %}
Recommendation
Admin should be able to disable token
(Ensure protocol admin has a way to clear/disable enabled tokens or that setPurchaseToken can be executed despite enabled tokens under controlled conditions.)
Proof of Concept
Please see above.
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 the setPurchaseToken function requires that no tokens are enabled, but the token admin can enable tokens without restriction and the protocol admin has no way to disable them.
Impact
The token admin could prevent the protocol admin from changing the purchase token, causing the contract to fail to deliver promised returns without losing value.
What the attacker needed
Token admin role; no active sales or token enabled
The fix
The protocol admin should be able to clear or disable enabled tokens, or setPurchaseToken should work despite enabled tokens under controlled conditions.
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 smart contract has an admin who can change which token is used for purchases. But the code refuses to change it while any token is enabled. Another role, the token admin, can enable a token at any time and never turn it off, so the main admin gets stuck.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.