#38189 [SC-Insight] Attacker can grief calls to `lbtc.mintWithFee()`

Submitted on Dec 27th 2024 at 10:51:08 UTC by @Shahen for Audit Comp | Lombard

  • Report ID: #38189

  • Report Type: Smart Contract

  • Report severity: Insight

  • Target: https://github.com/lombard-finance/evm-smart-contracts/blob/main/contracts/LBTC/LBTC.sol

  • Impacts:

    • Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol (not lower than $1K))

Description

Brief/Intro

When the claimer calls lbtc.mintWithFee(), The claimer calls lbtc.permit() firstly with the user signature to give approval, So an malicious actor that monitors the mempool can frontrun the call to lbtc.mintWithFee() with lbtc.permit() with the users signature taken from the pending transaction. Now when the call gets mined it reverts as the permit is already been used. All calls directly to lbtc.mintWithFee() can be griefed this way.

Make a test file under test, And paste the coded poc below,And run yarn hardhat test test/testfile.ts For the test im calling directly from the stakeAndBake contract which is the claimer

Vulnerability Details

Same as above Brief/Intro

Impact Details

All calls to lbtc.mintWithFee() can be griefed by an attacker by frontrunning and calling lbtc.permit()

References

https://github.com/lombard-finance/evm-smart-contracts/blob/a818ea0489178ccd00019edab24637c38501af7b/contracts/LBTC/LBTC.sol#L415

Proof of Concept

Proof of Concept

Last updated

Was this helpful?