Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Latest commit

 

History

History
29 lines (15 loc) · 1.18 KB

010.md

File metadata and controls

29 lines (15 loc) · 1.18 KB

moneyversed

high

Lack of Access Control

Summary

The _swap function in the SwapUtils.sol contract lacks proper access control, which could lead to unauthorized access and potential manipulation.

Vulnerability Detail

The _swap function is an internal function that performs the actual swap operation. However, there are no access control mechanisms in place to restrict access to this function. This could potentially allow unauthorized users to call the function and manipulate the swap process.

Impact

Lack of access control on the _swap function could lead to unauthorized access and manipulation of the swap process, which could have negative consequences for the protocol and its users.

Code Snippet

https://github.com/sherlock-audit/2023-04-gmx/blob/main/gmx-synthetics/contracts/swap/SwapUtils.sol#L100

Tool used

Manual Review

Recommendation

Implement access control mechanisms to restrict access to the _swap function. This can be done by using the onlyOwner or onlyRole modifiers provided by the OpenZeppelin Contracts library. Additionally, ensure that only authorized users can call the function to maintain security and prevent unauthorized manipulation.