Skip to content

S-162 Prevent frontrunning permit DOSing intent#75

Merged
shunkakinoki merged 8 commits intomasterfrom
c4-s162
Nov 26, 2025
Merged

S-162 Prevent frontrunning permit DOSing intent#75
shunkakinoki merged 8 commits intomasterfrom
c4-s162

Conversation

@ScreamingHawk
Copy link
Contributor

S-162 An attacker can block users from calling depositToIntentWithPermit()

https://code4rena.com/audits/2025-11-sequence-transaction-rails/submissions/S-162

Issue: An attack can read the permit signature from the mempool and front run the token.permit call, preventing the depositToIntentWithPermit call from passing.

Analysis: This DOS can be run against any depositToIntentWithPermit call. While a user could retry the transaction by calling depositToIntent with the same signatures, excluding the permit call, this requires an additional transaction. IIRC This flow is not for intent addresses (that only have access to pre-approved transactions) so we should be fine to retry, but it's an annoyance we could prevent.

Fix: Try/catch the token.permit() call, ignoring failure. If the permit call was frontrun, the following transfer call will pass.

@ScreamingHawk ScreamingHawk requested a review from a team November 25, 2025 19:25
@Agusx1211
Copy link
Member

LGTM

this is not Medium severity

Agusx1211
Agusx1211 previously approved these changes Nov 26, 2025
shunkakinoki
shunkakinoki previously approved these changes Nov 26, 2025
Copy link
Collaborator

@shunkakinoki shunkakinoki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙌

@shunkakinoki shunkakinoki dismissed stale reviews from Agusx1211 and themself via fab84de November 26, 2025 07:55
…t performance adjustments and ensure accuracy in gas usage metrics. Minor updates made to individual test cases for consistency.
…lity and maintainability. Adjusted try-catch structure for better clarity in handling potential frontrunning scenarios.
…roved readability. Consolidated call parameters into a single line for clarity.
@shunkakinoki shunkakinoki merged commit 95eddaa into master Nov 26, 2025
1 check passed
@shunkakinoki shunkakinoki deleted the c4-s162 branch November 26, 2025 08:11
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

Successfully merging this pull request may close these issues.

3 participants