Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Griefing attack in Lyra V2 #333

Open
gandu0 opened this issue Jan 4, 2024 · 1 comment
Open

Griefing attack in Lyra V2 #333

gandu0 opened this issue Jan 4, 2024 · 1 comment

Comments

@gandu0
Copy link

gandu0 commented Jan 4, 2024

Bug Description

Where
permitAndSubmitTransfer and permitAndSubmitTransfers

Expected behavior:

  • The permitAndSubmitTransfers function utilizes the lyra’s permit function so that approve and pull operations can happen in a single transaction instead of two consecutive transactions.

Attack:

  • _Permit () functionality uses the nonces mapping for replay protection. Once a signature is verified and approved, the nonce increases, invalidating the same signature being replayed.
  • permitAndSubmitTransfers expects the holder to sign their tokens and provide the signature to contract as part of permitData
    When a permitAndSubmitTransfers transaction is in the mempool, an attacker can take this signature, call the external permit() function on the token themselves.
  • Since this is a valid signature, the token accepts it and increases the nonce.
  • This makes the spender's transaction fail whenever it gets mined.

Impact

  • Attacker can make sure all calls to permitAndSubmitTransfers fail for the first time.
  • Approve and pull operations can not happen in a single transaction.

Risk Breakdown

  • Difficulty to Exploit: Easy
  • Severity: Medium

Recommendation

  • In permitAndSubmitTransfers fuction, check if it has the approval it needs. If not, then only submit the permit signature.

Reference

@0xdomrom
Copy link
Contributor

0xdomrom commented Jan 4, 2024

Acknowledged, thank you for the report. Will DM about potential rewards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants