Submitted by zzzitron, also found by berndartmueller, csanuragjain, pashov, Ruhum, sorrynotsorry, and Trust
https://github.com/code-423n4/2022-08-olympus/blob/b5e139d732eb4c07102f149fb9426d356af617aa/src/modules/TRSRY.sol#L64-L72
https://github.com/code-423n4/2022-08-olympus/blob/b5e139d732eb4c07102f149fb9426d356af617aa/src/policies/TreasuryCustodian.sol#L42-L48
An attacker may be able to withdraw more than intended
Lets say Alice had approval of 100. Now the treasury custodian reduced the approval to 50. Alice could frontrun the setApprovalFor of 50, and withdraw 100 as it was before. Then withdraw 50 with the newly set approval. So the alice could withdraw 150.
The TreasuryCustodian simply calls the setApprovalFor to grant Approval.
Instead of setting the given amount, one can reduce from the current approval. By doing so, it checks whether the previous approval is spend.
ind-igo (Olympus) confirmed and commented:
0xean (judge) increased severity to High and commented:
0xean (judge) commented:
ind-igo (Olympus) commented:
