Skip to content
Business logic Audit finding Intermediate

Synth: approveAndCall sets unnecessary approval

The Synth contract's approveAndCall function grants the recipient contract an unlimited token allowance instead of only the specified amount. An attacker controlling or compromising the recipient contract could exploit this to spend more tokens than intended.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel

The Synth.approveAndCall function approves the recipient contract with the max value instead of only the required amount.

For safety, the approval should not be set to the max value, especially if the amount that the contract may use is already known in this call, like this is the case for approveAndCall.

Recommend only approving amount.

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

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 function calls approve with the maximum possible value rather than the exact amount parameter.

Impact

A malicious or compromised recipient contract could transfer more tokens than the caller intended, potentially draining the caller's balance.

What the attacker needed

Caller uses approveAndCall; recipient is malicious or compromised

The fix

The approval should be limited to the specified amount instead of the maximum value.

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 approve a contract to spend your tokens, you usually set a limit. This report says the function gave unlimited permission instead of just the amount needed, so that contract could take more tokens than you meant to allow.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by cmichel

View all

196 more disclosed reports, best first.

More from Spartan Protocol Contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.