Insufficient access control in token sales management leads to permanent griefing attack
A token admin can enable a token sale with just 1 wei, which adds the token to the enabledTokens set and prevents the contract admin from calling setPurchaseToken due to the CannotChangePurchaseTokenWithActiveSales error. Because only token admins can disable tokens, this creates a permanent parameter freeze that blocks the contract admin from updating the purchase token.
- Disclosed after under an hour
52031 sc medium insufficient access control in token sales management leads to permanent griefing attack
Submitted on Aug 7th 2025 at 12:43:59 UTC by @OxPrince for Attackathon | Plume Network
- Report ID: #52031
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcTokenPurchase.sol
- Impacts:
- Permanent freezing of funds
Description
Brief/Intro
The ArcTokenPurchase contract contains an access control vulnerability where token admins can permanently lock the contract admin's ability to update the purchase token configuration. A malicious token admin can enable a token sale with just 1 wei, which adds the token to the enabledTokens set and prevents the contract admin from calling setPurchaseToken() due to the CannotChangePurchaseTokenWithActiveSales error. Because only token admins can disable tokens, this can create an irreversible parameter freeze attack that permanently compromises core functionality.
Vulnerability Details
- Roles involved:
- Contract Admin: has
DEFAULT_ADMIN_ROLEonArcTokenPurchaseand can callsetPurchaseToken()(ArcTokenPurchase.sol:289-301). - Token Admin: has
ADMIN_ROLEon individual ArcToken contracts and can callenableToken()anddisableToken()(ArcTokenPurchase.sol:125-134).
- Contract Admin: has
- Root cause and mechanics:
enableToken()only requires_numberOfTokens > 0, allowing a token admin to enable a sale with just 1 wei (1 base unit) (ArcTokenPurchase.sol:150-152).- When a token is enabled, it is added to the
enabledTokensset (ArcTokenPurchase.sol:175). setPurchaseToken()reverts if any tokens are enabled by checking that theenabledTokensset is empty (ArcTokenPurchase.sol:293-295).- Only token admins can call
disableToken()to remove tokens fromenabledTokens(ArcTokenPurchase.sol:184-196).
- Consequence:
- A token admin can enable a token with minimal cost and permanently prevent the contract admin from updating the purchase token. This constitutes an irreversible parameter freeze, since the contract admin cannot disable the token.
Impact Details
- Permanent denial of service on a critical contract parameter:
- Parameter Freeze: Contract admin cannot update the purchase token address, blocking:
- Migration to new stablecoins or payment tokens
- Responses to token deprecations or security issues
- Adaptation to changing business requirements
- Parameter Freeze: Contract admin cannot update the purchase token address, blocking:
- Low-cost execution: attack can be executed with minimal funds (e.g., 1 wei).
- Recovery requires deploying a new contract or upgrading the implementation.
References
- ArcTokenPurchase contract: arc/src/ArcTokenPurchase.sol
- Test demonstrating the vulnerability: arc/test/ArcTokenPurchase.t.sol:322-348
- Protocol documentation: arc/README.md:200-267
Proof of Concept
{% stepper %} {% step %}
Setup
Contract admin deploys ArcTokenPurchase with an initial purchase token (e.g., USDC).
{% endstep %}
{% step %}
Token Creation
A token is created via ArcTokenFactory with a separate token admin.
{% endstep %}
{% step %}
Minimal Token Transfer
Token admin transfers just 1 wei of their token to the ArcTokenPurchase contract.
{% endstep %}
{% step %}
Griefing Attack
Token admin calls enableToken(tokenAddress, 1, anyPrice) to enable a sale with 1 wei.
{% endstep %}
{% step %}
Parameter Lock
Contract admin attempts to call setPurchaseToken(newTokenAddress) but the transaction reverts with CannotChangePurchaseTokenWithActiveSales.
{% endstep %}
{% step %}
Permanent Effect
Contract admin cannot disable the token because disableToken() requires token admin privileges, creating a permanent lock on purchase token updates.
The test case in arc/test/ArcTokenPurchase.t.sol:322-348 demonstrates this scenario, showing how an enabled token prevents purchase token updates until the token is disabled by its admin. {% 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 the enableToken function only checks that the number of tokens is greater than zero, allowing a token admin to enable a sale with 1 wei and add the token to the enabledTokens set, while setPurchaseToken reverts if any tokens are enabled and only token admins can disable tokens.
Impact
The contract admin permanently cannot update the purchase token address, blocking migration to new stablecoins, responses to token deprecations or security issues, and adaptation to changing business requirements; recovery requires deploying a new contract or upgrading the implementation.
What the attacker needed
Token admin role on a token; 1 wei of the token; contract admin deploys ArcTokenPurchase
The fix
The contract should be fixed so that a token admin cannot permanently block the contract admin from updating the purchase token, for example by allowing the contract admin to disable tokens or by not reverting setPurchaseToken when tokens are enabled.
How it was found
- Contract admin deploys ArcTokenPurchase with an initial purchase token.
- A token is created via ArcTokenFactory with a separate token admin.
- Token admin transfers 1 wei of their token to the ArcTokenPurchase contract.
- Token admin calls enableToken(tokenAddress, 1, anyPrice) to enable a sale with 1 wei.
- Contract admin attempts to call setPurchaseToken(newTokenAddress) but the transaction reverts with CannotChangePurchaseTokenWithActiveSales.
- Contract admin cannot disable the token because disableToken() requires token admin privileges, creating a permanent lock.
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.
This is a smart contract where a contract admin sets which token people use to buy things, and separate token admins can turn individual tokens on or off for sale. A token admin can turn on a sale with a tiny amount, and once any token is on, the contract admin is blocked from changing the main purchase token. Since only the token admin can turn the token off, the contract admin is stuck.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.