Skip to content
Access control Write-up Intermediate

Talent Protocol

The setToken function in the staking contract lacked access control, allowing anyone to set a malicious TAL token contract. An attacker could set a token that reverts on transfers, causing the admin's swap function to fail and permanently freezing about 465k USD in stablecoins.

mirror.xyz

Published on mirror.xyz

The affected project was Talent Protocol, whose bounty program had recently launched on Immunefi. Sai thought they had a griefing attack at hand, an attack to disturb people, to force them to redeploy the contract.

The author, on mirror.xyz

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The setToken function lacked access control, allowing any user to set an arbitrary ERC20 token address that the admin swap function later calls.

Impact

An attacker could permanently freeze about 465k USD in stablecoins held by the staking contract, as the admin's only withdrawal function would revert.

What the attacker needed

None

The fix

The vulnerability was fixed by the team setting a temporary non-malicious TAL token to block attacks, then draining the contract, and later migrating to patched contracts.

How it was found

  1. Call setToken with a malicious ERC20 contract that reverts on transferFrom.
  2. The admin's swapStableForToken function calls transferFrom on the malicious token and reverts.
  3. Stablecoin funds remain locked in the contract because the swap cannot complete.

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 write-up has not been written yet. The Original tab links to the source.

A smart contract had a function that anyone could call to set which token it uses. By setting a fake token that refuses to send funds, an attacker could stop the admin from ever moving the real money out, locking it forever.

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.

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.