This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
Rhythmic Bone Boa - Frontrunning permit to DoS repayBorrowWithPermit()
#140
Labels
Rhythmic Bone Boa
Low/Info
Frontrunning permit to DoS
repayBorrowWithPermit()
Summary
An attacker can force the
UDai::repayBorrowWithPermit()
logic to intentionally fails, causing a temporary DoS.Root Cause
Its due to permit function is used in conjunction with repay borrow logic(
UDai::repayBorrowWithPermit()
), since thepermit
function is permissionless, anyone can call thepermit()
with given arguments before therepayBorrowWithPermit()
function. This cause the second permit txn to fail in repayBorrow logic, as a result, the entire txn reverts.Impact
Since there are also other way to repay borrowed amount, its not that severe. the user only has to pay extra gas for the revert txn.
PoC
https://github.com/sherlock-audit/2024-06-union-finance-update-2/blob/7ffe43f68a1b8e8de1dfd9de5a4d89c90fd6f710/union-v2-contracts/contracts/market/UDai.sol#L19
Mitigation
Use the external permit call in try/catch to avoid failures.
The text was updated successfully, but these errors were encountered: