code-423n4 / 2021-07-spartan-findings

0 stars 0 forks source link

Synth: approveAndCall sets unnecessary approval #155

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

cmichel

Vulnerability details

Vulnerability Details

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

Impact

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.

Recommended Mitigation Steps

Only approve amount.