-
Notifications
You must be signed in to change notification settings - Fork 3
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
Anyone can bypass fees in swapAndExecute using receiveFromBridge. #15
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-590
edited-by-warden
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
Comments
raymondfam marked the issue as sufficient quality report |
raymondfam marked the issue as primary issue |
Dodging fee payment via this postBridge call is indeed a loophole. |
This was referenced Jan 23, 2024
Closed
Closed
Closed
Closed
Closed
This was referenced Jan 24, 2024
Closed
Open
wkantaros (sponsor) confirmed |
alex-ppg marked issue #590 as primary and marked this issue as a duplicate of 590 |
alex-ppg marked the issue as satisfactory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-590
edited-by-warden
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-01-decent/blob/main/src/UTB.sol#L311
Vulnerability details
Impact
Whenever a user wants to call
swapAndExecute
(which performs a swap and executes a transaction for a user in the same chain), they have to pay a fee viaretrieveAndCollectFees
modifier.UTB.sol#L311C1-L319C6
However there is another function that does essentially the same thing without the
retrieveAndCollectFees
modifier.UTB.sol#L311C1-L319C6
Essentially, this means a user can bypass fees in
swapAndExecute
by using the functionreceiveFromBridge
.Note that though this function is not payable,
_swapAndExecute
also accepts ERC-20 tokens, meaning that one can abusereceiveFromBridge
to swap ERC-20 tokens and execute transactions without a fee.Tools Used
Manual Review
Recommended Mitigation Steps
The
receiveFromBridge
function needs to check if themsg.sender
is actually a bridge adapter by using a new storage mapping that stores a boolean whether a given address is a valid bridge adapter.Assessed type
Access Control
The text was updated successfully, but these errors were encountered: