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

minDepositAmount is compared against a wrong variable #487

Closed
code423n4 opened this issue Jan 19, 2023 · 2 comments
Closed

minDepositAmount is compared against a wrong variable #487

code423n4 opened this issue Jan 19, 2023 · 2 comments
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-486 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/AstariaXYZ/astaria-gpl/blob/4b49fe993d9b807fe68b3421ee7f2fe91267c9ef/src/ERC4626-Cloned.sol#L27
https://github.com/AstariaXYZ/astaria-gpl/blob/4b49fe993d9b807fe68b3421ee7f2fe91267c9ef/src/ERC4626-Cloned.sol#L43

Vulnerability details

The following require statement In deposit of ERC4626-Cloned.sol

require(shares > minDepositAmount(), "VALUE_TOO_SMALL");

is ensuring shares is greater than minDepositAmount(), even though it should be ensuring assets > minDepositAmount() (like how it’s done in the mint method).

Impact

An unexpected amount of assets can be deposited; or a valid amount of assets cannot be deposited.

Proof of Concept

See the attached links.

Tools Used

Manual analysis

Recommended Mitigation Steps

Fix the require statement with the right invariant.

@code423n4 code423n4 added 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 labels Jan 19, 2023
code423n4 added a commit that referenced this issue Jan 19, 2023
@c4-judge
Copy link
Contributor

Picodes marked the issue as duplicate of #486

@c4-judge
Copy link
Contributor

Picodes marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Feb 21, 2023
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-486 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants