52649 sc high token creator can seize upgrade control bypassing factory whitelist and enabling theft of funds

Submitted on Aug 12th 2025 at 09:30:55 UTC by @hulkvision for Attackathon | Plume Network

  • Report ID: #52649

  • Report Type: Smart Contract

  • Report severity: High

  • Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcTokenFactory.sol

  • Impacts:

    • Permanent freezing of funds

    • Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield

    • Unauthorized upgrade of ArcToken implementation

Description

Brief / Intro

The ArcTokenFactory contract incorrectly grants the DEFAULT_ADMIN_ROLE of a newly created ArcToken to the token's creator (msg.sender). This allows the creator to subsequently grant themselves the UPGRADER_ROLE. By seizing the UPGRADER_ROLE, the token creator can unilaterally upgrade the ArcToken proxy to a malicious implementation at any time, completely bypassing the factory's intended security whitelist. This enables the creator to take full control of the token implementation, which can lead to the direct theft of all user funds held within the token contract or the permanent freezing of those assets.

Vulnerability Details

The ArcTokenFactory is intended to be the sole upgrader for tokens it creates, enforcing upgrades only to pre-approved, whitelisted implementations by granting the UPGRADER_ROLE to the factory. However, the factory mistakenly grants the DEFAULT_ADMIN_ROLE to the token creator, enabling the creator to assign the UPGRADER_ROLE to themselves.

Relevant excerpt from createToken (ArcTokenFactory.sol):

  • The token creator, having DEFAULT_ADMIN_ROLE, can call grantRole(UPGRADER_ROLE, creator_address) on their own token contract because DEFAULT_ADMIN_ROLE is the admin role for UPGRADER_ROLE.

  • Once the creator has the UPGRADER_ROLE, they can call upgradeToAndCall() directly on the ArcToken proxy, bypassing the factory's upgradeToken function and its isImplementationWhitelisted check.

Impact Details

  • The token deployer gains the ability to replace the token logic with a malicious implementation, enabling theft of user funds or permanent freezing of assets.

  • This breaks the core trust model of the Arc framework: users interacting with factory-created tokens assume upgrades are restricted to vetted, whitelisted implementations enforced by the factory.

Proof of Concept

1

Setup and Initial Exploit Flow

The following test demonstrates the full exploit flow:

  • Attacker creates a token via the factory and is granted DEFAULT_ADMIN_ROLE.

  • Attacker grants themselves the UPGRADER_ROLE.

  • Attacker deploys a malicious logic contract and calls upgradeToAndCall() on the token proxy.

  • The malicious implementation includes a backdoor function (e.g., backdoorMint) to mint tokens to arbitrary users.

Add the test below to arc/test/ArcTokenFactory.t.sol and run: forge test --mt test_Bypass_TokenCreatorCanUpgradeArcToken -vvvv

2

Malicious Logic & Test Code

References

Source reference

https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcTokenFactory.sol#L191-L193

Was this helpful?