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

Upgraded Q -> 2 from #538 [1727786260314] #555

Closed
c4-judge opened this issue Oct 1, 2024 · 2 comments
Closed

Upgraded Q -> 2 from #538 [1727786260314] #555

c4-judge opened this issue Oct 1, 2024 · 2 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value duplicate-205 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@c4-judge
Copy link
Contributor

c4-judge commented Oct 1, 2024

Judge has assessed an item in Issue #538 as 2 risk. The relevant finding follows:

🔵 L02 - vulnerable to permit front-run causing a revert
https://github.com/code-423n4/2024-07-loopfi/blob/main/src/proxy/TransferAction.sol#L67-L67

Vulnerability details
When calling a permit, the data of the permit will be logged in the blockchain, and anyone is able to frontrun the permit by duplicating the TX arguments. This is not an issue according to the EIP since the permit creator can just create another permit.

However, if the permit is used in conjunction with an external function call, frontrunning the permit will cause the function to be griefed.

This is what’s hapenning in TransferAction::_transferFrom:

File: src/proxy/TransferAction.sol
46: function _transferFrom(
47: address token,
48: address from,
49: address to, //! to is not part of the permit signature
50: uint256 amount,
51: PermitParams memory params
52: ) internal {
...:
...: //* ------ some code ----- //
...:
65: } else if (params.approvalType == ApprovalType.PERMIT) {
66: // Consume a standard ERC20 permit message
67: IERC20Permit(token).safePermit(
68: from,
69: to,
70: params.approvalAmount,
71: params.deadline,
72: params.v,
73: params.r,
74: params.s
75: );
76: IERC20(token).safeTransferFrom(from, to, amount);
77: } else {
...:
...: //
------ some code ----- *//
...:
81: }
Impact
User actions can be DoS’d repeatedly by a malicious actor.

@c4-judge c4-judge added the 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value label Oct 1, 2024
@c4-judge
Copy link
Contributor Author

c4-judge commented Oct 1, 2024

koolexcrypto marked the issue as duplicate of #205

@c4-judge
Copy link
Contributor Author

c4-judge commented Oct 1, 2024

koolexcrypto marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Oct 1, 2024
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 duplicate-205 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

1 participant