Arc token owner can take upgrader role for themselves lockout the factory and upgrade the contract without the knowledge of the factory
The ArcToken contract's default admin (the token owner) can revoke the factory's upgrader role and grant it to themselves, then upgrade the token to any implementation without the factory's approval. This lets the owner bypass the factory's whitelisting and potentially deploy malicious code that harms token users.
- Disclosed after under an hour
51197 sc high arc token owner can take upgrader role for themselves lockout the factory and upgrade the contract without the knowledge of the factory
Submitted on Jul 31st 2025 at 21:43:30 UTC by @TeamJosh for Attackathon | Plume Network
- Report ID: #51197
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcTokenFactory.sol
- Impacts:
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
- Escalation of privilege
Description
Brief/Intro
Anyone can create an ArcToken from the factory; the creator of the ArcToken gets the default admin role and the factory itself gets the upgrader role and stores the implementation contract. This means that all upgrades to an ArcToken can only go through the ArcTokenFactory admin. However, the ArcToken owner can revoke the Upgrader Role from ArcTokenFactory and also give themselves this role. By doing this they can upgrade the token to whatever they want while the factory will still think it has a legitimate implementation contract.
Vulnerability Details
The contract ArcToken uses AccessControlUpgradeable. This contract contains public functions grantRoles and revokeRoles that allow the default admin to grant and revoke any role. With this capability the default admin (who is the owner of the ArcToken) can revoke the upgraderRole access of the ArcTokenFactory, thereby blocking the ArcTokenFactory admin from performing upgrades.
The ArcToken admin can also upgrade the ArcToken themselves to a malicious contract. The factory will still store the original (or another) implementation contract address in its mapping, causing the factory to report an incorrect implementation for that token.
Code excerpt showing the factory upgrade and implementation mapping update:
/**
* @dev Upgrades a token to a new implementation
* @param token Token address to upgrade
* @param newImplementation Address of the new implementation
*/
function upgradeToken(address token, address newImplementation) external onlyRole(DEFAULT_ADMIN_ROLE) {
FactoryStorage storage fs = _getFactoryStorage();
// Ensure the token was created by this factory
if (fs.tokenToImplementation[token] == address(0)) {
revert TokenNotCreatedByFactory();
}
// Ensure the new implementation is whitelisted
bytes32 codeHash = _getCodeHash(newImplementation);
if (!fs.allowedImplementations[codeHash]) {
revert ImplementationNotWhitelisted();
}
// Perform the upgrade (this assumes the token implements UUPSUpgradeable)
UUPSUpgradeable(token).upgradeToAndCall(newImplementation, "");
// Update the implementation mapping
@-> fs.tokenToImplementation[token] = newImplementation;
emit TokenUpgraded(token, newImplementation);
}
Impact Details
{% stepper %} {% step %}
Inconsistent factory state
The ArcTokenFactory can end up reporting an implementation address that doesn't match the token's actual implementation after the token owner upgrades it without the factory's authorization. {% endstep %}
{% step %}
Access control bypass / privilege escalation
A token owner can revoke the factory's upgrader role and grant themselves that role, allowing them to perform upgrades normally reserved for the factory admin. {% endstep %}
{% step %}
Use of unwhitelisted implementation
The token owner can upgrade to an implementation that is not whitelisted by the factory, bypassing the factory's expected whitelisting mechanism. {% endstep %}
{% step %}
Ecosystem harm
Token owners can upgrade to unsecured or unaudited contracts, potentially enabling theft or malicious behavior that harms users and the ecosystem. {% endstep %} {% endstepper %}
References
- https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcTokenFactory.sol#L185
- https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcTokenFactory.sol#L279
Proof of Concept
{% stepper %} {% step %}
Step: Create a legitimate ArcToken
Create an ArcToken through the ArcTokenFactory (the factory will be assigned the upgrader role and store the token implementation in its mapping). {% endstep %}
{% step %}
Step: Revoke factory upgrader role
Call revokeRoles on the ArcToken contract to revoke the ArcTokenFactory Upgrader Role.
{% endstep %}
{% step %}
Step: Grant yourself upgrader role
Call grantRoles on the ArcToken contract to grant yourself the Upgrader Role.
{% endstep %}
{% step %}
Step: Upgrade to non-whitelisted implementation
Call upgradeToAndCall on the ArcToken to update the implementation to a non-whitelisted (malicious) implementation. The token now runs the malicious implementation while the factory's mapping may still point to a different (legitimate) implementation.
{% 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
The token owner holds the default admin role, which can grant and revoke any role, including the upgrader role that the factory relies on for controlled upgrades.
Impact
The token owner could upgrade to an unsecured or unaudited contract, potentially enabling theft or malicious behaviour that harms users, while the factory's records become inconsistent.
What the attacker needed
Be the owner of an ArcToken created by the factory
The fix
The token owner should not have the default admin role that can revoke the factory's upgrader role; upgrade authority should be restricted to the factory or a separate trusted admin.
How it was found
- Create an ArcToken through the factory, which assigns the upgrader role to the factory.
- Call revokeRoles on the ArcToken to remove the factory's upgrader role.
- Call grantRoles on the ArcToken to give the upgrader role to the token owner.
- Call upgradeToAndCall on the ArcToken to set a non-whitelisted implementation.
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 token factory creates tokens and keeps control over who can upgrade them. The token's owner is also an admin who can change roles, so they can remove the factory's upgrade permission and take it for themselves. That means they can replace the token's code with anything, even if the factory would normally block it.
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.