Migration permit cannot be revoked after migrator role removal
A user's migration permit for a migrator address cannot be revoked once the admin removes that address's migrator role, because the revoke function requires the role to still be held. If the role is later granted again to the same address, the old permit becomes active again without the user's consent.
Originally disclosed on Immunefi
- Disclosed after under an hour
69410 sc low migration permit cannot be revoked after migrator role removal
Submitted on Mar 14th 2026 at 18:48:58 UTC by @silverologist for Audit Comp | Folks Finance: Staking Contracts
- Report ID: #69410
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/Folks-Finance/folks-staking-contracts/blob/main/src/Staking.sol
- Impacts:
- Contract fails to deliver promised returns, but doesn't lose value
Description
Brief/Intro
The user side migration approval cannot be removed for a migrator whose migrator role is currently not active.
Vulnerability Details
setMigrationPermit validates that the target address holds MIGRATOR_ROLE for both granting and revoking permission:
function setMigrationPermit(address _migrator, bool _isMigrationPermitted) external {
if (!hasRole(MIGRATOR_ROLE, _migrator)) revert MigratorNotFound(_migrator);
migrationPermits[_migrator][msg.sender] = _isMigrationPermitted;
}
When admin revokes MIGRATOR_ROLE from an address, users who previously granted migration permits to that address are unable to revoke them. The hasRole check causes the revocation call to revert with MigratorNotFound.
While the stale permit is currently inert (since migratePositionsFrom independently requires onlyRole(MIGRATOR_ROLE)), the permit persists in storage. If MIGRATOR_ROLE is later regranted to the same address, the previous permit becomes active again without the user's consent who might have wanted to remove the permit.
Impact Details
Users cannot freely remove migrator permits for their positions.
Proof of Concept
- The MIGRATOR_ROLE is granted to an address
migrator - Alice approves the migration permit for
migrator - The MIGRATOR_ROLE is removed
- Alice wants to remove the permit for
migratorbut cannot do so - Later, if the MIGRATOR_ROLE is re-added to
migrator, they will be able to perform the migration for Alice immediately despite Alice having changed her mind
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 permit-setting function checks that the target holds the migrator role for both granting and revoking, so revocation is impossible once the role is gone.
Impact
The stale permit is currently inert because migration separately requires the role, but it could become active again without the user's consent if the role is regranted.
What the attacker needed
A user has granted a migration permit; admin removes the migrator role
The fix
The permit function should allow a user to revoke a permit without requiring the target to still hold the migrator role.
How it was found
- Grant the migrator role to an address.
- Have a user approve a migration permit for that address.
- Remove the migrator role from the address.
- Attempt to revoke the permit as the user and observe the call reverts.
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 user can give a helper address permission to move their staked positions. The contract only lets a user change that permission while the helper still has a special admin-granted role. If the admin takes the role away, the user can no longer cancel the permission, and it silently comes back to life if the role is handed out again.
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.