Submitted by shaflow2, also found by 0xlemon and MrPotatoMagic
https://github.com/code-423n4/2024-12-bakerfi/blob/3873b82ae8b321473f3afaf08727e97be0635be9/contracts/core/hooks/UsePermitTransfers.sol#L31
In batch operations interacting with the router, users are allowed to input tokens into the router using the permit method. This approach may be vulnerable to frontrunning attacks, allowing malicious actors to steal the users tokens.
Users can deposit tokens into the router via the pullTokensWithPermit function. However, the router contract does not validate the callers information, making it possible for a malicious actor to frontrun the user and exploit their permit signature to steal tokens.
Consider the following scenario:
Additionally, an attacker could frontrun the permit function without using the router and then call pushTokenFrom directly to steal tokens.
The current router is not suitable for integrating permit to handle token input.
chefkenji (BakerFi) confirmed
BakerFi mitigated:
Status: Mitigation confirmed. Full details in reports from 0xlemon and shaflow2.
