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

Oracle periodSize = 0 which is as same as not using any oracle. #8

Closed
code423n4 opened this issue Jun 29, 2022 · 1 comment
Closed
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/Plex-Engineer/lending-market-v2/blob/ea5840de72eab58bec837bb51986ac73712fcfde/contracts/Stableswap/BaseV1-core.sol#L72

Vulnerability details

Impact

Oracle periodSize = 0 which is as same as not using any oracle. It should be 1800 as expected (30 minutes).

Proof of Concept

// Capture oracle reading every 30 minutes
uint constant periodSize = 0;

You comment said that capture oracle reading every 30 minutes.

But in fact, periodSize = 0 which mean you are updating your oracle every block (TWAP window 1 block) which is as same as not using any oracle.

Tools Used

Diff checker
https://www.diffchecker.com/skDZcZJa

Recommended Mitigation Steps

periodSize = 1800;

1800 seconds = 30 minutes

// Capture oracle reading every 30 minutes
uint256 constant periodSize = 1800;
@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Jun 29, 2022
code423n4 added a commit that referenced this issue Jun 29, 2022
This was referenced Jul 1, 2022
@nivasan1 nivasan1 added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Jul 4, 2022
@GalloDaSballo
Copy link
Collaborator

Dup of #124

@GalloDaSballo GalloDaSballo added the duplicate This issue or pull request already exists label Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

3 participants