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

Flash loan can be called on Router even in paused state #4

Open
hats-bug-reporter bot opened this issue Nov 11, 2024 · 1 comment
Open

Flash loan can be called on Router even in paused state #4

hats-bug-reporter bot opened this issue Nov 11, 2024 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@hats-bug-reporter
Copy link

Github username: @rilwan99
Twitter username: --
Submission hash (on-chain): 0x371b5e930fc45b307e7ba3f3cf987136a99f803c9df0fc9b9cd4503e7737179e
Severity: high

Description:
Description
The Router.sol contract inherits from PausableUpgradeable.sol, allowing it to be placed in a paused state via the pause() function by a user with the appropriate access control. The whenNotPaused modifier is used to ensure that calls to the router are reverted if it is in a paused state.
However, the onFlashLoan() function lacks this modifier. This means that even if the Router is paused, users can still initiate flash loans. Thiscould lead to potential exploits where malicious users might compromise the router while it is paused.

Attack Scenario
Describe how the vulnerability can be exploited.

Attachments

  1. Proof of Concept (PoC) File
  1. Revised Code File (Optional)
    Include a whenNotPaused modifier in the function onFlashLoan()
@hats-bug-reporter hats-bug-reporter bot added the bug Something isn't working label Nov 11, 2024
@yanisepfl yanisepfl added the invalid This doesn't seem right label Nov 13, 2024
@yanisepfl
Copy link
Collaborator

Hello,

We classified this issue as Invalid because in this case flashloanLender can only be PTs, so onFlashLoan() can only be called by PTs which can also be paused, thus making this not exploitable.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant