Skip to content
Access control Audit finding Intermediate

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.

TeamJosh Follow

Originally disclosed on Immunefi

  • 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

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:

SOL
    /**
     * @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

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 %}

The original report as published on Immunefi, by TeamJosh. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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

  1. Create an ArcToken through the factory, which assigns the upgrader role to the factory.
  2. Call revokeRoles on the ArcToken to remove the factory's upgrader role.
  3. Call grantRoles on the ArcToken to give the upgrader role to the token owner.
  4. 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.

More by TeamJosh

View all

4 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.