-
Notifications
You must be signed in to change notification settings - Fork 2
C4 S-41 Remove ineffective delegatecall guard. Add reentry guard #72
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
Conversation
|
I'm not opposed to scrapping this addition of the reentry guard. |
df6a783 to
41e17fc
Compare
|
BTW My assumption here is that the |
|
If somehow funds end up in I don't think the issue is really a big issue, and I do not think it is worth the changes. I also think that I vote NOT to merge, unless @ScreamingHawk can convince me otherwise. |
Agusx1211
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the onlyDelegatecall modifier is a good idea, but this duplicates the reentrancy guard with the native one of Sequence v3
I don't think we should merge this, as it does not really fix a real exploit
Open to change my mind
@Agusx1211 . This is incorrect. The Shim will call the Router, it pulls funds and executes from the Router's context. |
|
I know that statement alone should leads to some architecture changes but I feel we are too late in the game for that. |
|
I mean it is not expected to "keep" funds, sorry for the poorly phrased comment |
|
I think exposing Otherwise these funds are still accessible via execute Don't mind dropping the reentry check, but I think it's a good hardening addition. Edit: Just saw #73. That doesn't prevent build up by invalid direct transfers. Which an accessible |
|
Closing as per comments above. #73 should prevent build up with legitimate use cases. We can hack the use of |
S-41 Missing onlyDelegatecall modifier on critical TrailsRouter entrypoints enables direct implementation calls and potential fund extraction
https://code4rena.com/audits/2025-11-sequence-transaction-rails/submissions/S-41
Issue: Some functions on
TrailsRouterare missingonlyDelegatecallmodifier.Analysis: This is intentional as
TrailsRouteris called by theTrailsRouterShim. Due to this requirement, theonlyDelegatecallprotection is ineffective, as funds can be claimed bypullAndExecutefunctions. More problematic is reentry conditions.Fix: Removes the
onlyDelegatecallguard fromTrailsRouter. Adds more effectivenonReentrantguard.NOTE: This change required the addition of some internal functions to prevent internal calls to multiple nonReentrant functions. The flow between router functions is messy and could do with a refactor. This PR only seeks to make minimal changes.
NOTE 2: Tests pass without changes to reentrant logic and the API appears to not have reentry requirement. This is worth confirming before merging.