Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Milad-Sha - Remove custom function allowance #72

Closed
sherlock-admin opened this issue Oct 27, 2023 · 1 comment
Closed

Milad-Sha - Remove custom function allowance #72

sherlock-admin opened this issue Oct 27, 2023 · 1 comment
Labels
Excluded Excluded by the judge without consulting the protocol or the senior Non-Reward This issue will not receive a payout Won't Fix The sponsor confirmed this issue will not be fixed

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Oct 27, 2023

Milad-Sha

medium

Remove custom function allowance

Summary

The increaseAllowance and decreaseAllowance functions can add more bugs.

Vulnerability Detail

Recently, the increaseAllowance function has been removed from the OpenZeppelin ERC20 contract due to its exploitation in phishing attacks and to prevent the possibility of further phishing attacks.

See OpenZeppelin/openzeppelin-contracts#4583. We should remove the functions increaseLPAllowance and decreaseLPAllowance as they only solve an imaginary problem.

These functions are not part of the EIP-20 specs.

Impact

Using these functions will result in unexpected behaviour which will cause contracts to become corrupted.

These functions may allow for further phishing possibilities.

Code Snippet

https://github.com/sherlock-audit/2023-09-ajna/blob/main/ajna-core/src/libraries/external/LPActions.sol?plain=1#L55-L117

https://github.com/sherlock-audit/2023-09-ajna/blob/main/ajna-core/src/base/Pool.sol?plain=1#L454-L479

Tool used

Manual Review

Recommendation

considering removing increaseLPAllowance/decreaseLPAllowance function from LPActions contract.

Or implement a function similar to this SafeERC20 library which is still available.

@github-actions github-actions bot added the Excluded Excluded by the judge without consulting the protocol or the senior label Oct 28, 2023
@neeksec
Copy link
Collaborator

neeksec commented Nov 6, 2023

Not clearly showing how the current implementation could result in the impact described.

@sherlock-admin2 sherlock-admin2 changed the title Kind Green Sealion - Remove custom function allowance Milad-Sha - Remove custom function allowance Nov 7, 2023
@sherlock-admin2 sherlock-admin2 added the Non-Reward This issue will not receive a payout label Nov 7, 2023
@ith-harvey ith-harvey added the Will Fix The sponsor confirmed this issue will be fixed label Nov 7, 2023
@ith-harvey ith-harvey added Won't Fix The sponsor confirmed this issue will not be fixed and removed Will Fix The sponsor confirmed this issue will be fixed labels Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Excluded Excluded by the judge without consulting the protocol or the senior Non-Reward This issue will not receive a payout Won't Fix The sponsor confirmed this issue will not be fixed
Projects
None yet
Development

No branches or pull requests

4 participants