Old yield source still has infinite approval
The old yield source contract retains an infinite token approval after being swapped out, which could be exploited if that contract is malicious or compromised. An attacker could drain funds from the new yield source if the old one is not perfectly safe.
Submitted by tensors, also found by hickuphh3, cmichel and GalloDaSballo
After swapping a yield source, the old yield source still has infinite approval. Infinite approval has been used in large attacks if the yield source isn’t perfectly safe (see furucombo).
Recommend decreasing approval after swapping the yield source.
PierrickGT (PoolTogether) confirmed:
PR: https://github.com/pooltogether/swappable-yield-source/pull/3
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
Impact
If the old yield source is not perfectly safe, an attacker could exploit the infinite approval to steal funds, as has happened in large attacks.
What the attacker needed
Old yield source is malicious or compromised
The fix
The approval should be decreased after swapping the yield source.
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.
When you swap one yield source for another, the old one still has permission to spend an unlimited amount of tokens. If that old contract is hacked or malicious, an attacker could use that permission to steal all the tokens.
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.