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

race condition between triggerDepeg and triggerEndEpoch #124

Closed
code423n4 opened this issue Sep 17, 2022 · 2 comments
Closed

race condition between triggerDepeg and triggerEndEpoch #124

code423n4 opened this issue Sep 17, 2022 · 2 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists old-submission-method partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Controller.sol#L102
https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Controller.sol#L203

Vulnerability details

Impact

since both triggerDepeg and triggerEndEpoch can be triggered when block.timestamp == epochEnd and vault.strikePrice() >= getLatestPrice(vault.tokenInsured() at the specific block, it creates a race condition, thus undetermistic outcome.

Proof of Concept

https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Controller.sol#L102
https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Controller.sol#L203

Tools Used

Recommended Mitigation Steps

make one of the comparison inclusive

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working old-submission-method labels Sep 17, 2022
code423n4 added a commit that referenced this issue Sep 17, 2022
@MiguelBits MiguelBits added in discussion Discussion about this issue is ongoing, and not yet resolved. sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") and removed in discussion Discussion about this issue is ongoing, and not yet resolved. labels Sep 20, 2022
@MiguelBits MiguelBits added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label Sep 23, 2022
@HickupHH3
Copy link
Collaborator

dup of #69

@HickupHH3 HickupHH3 added duplicate This issue or pull request already exists satisfactory satisfies C4 submission criteria; eligible for awards labels Oct 18, 2022
@HickupHH3 HickupHH3 added partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) and removed satisfactory satisfies C4 submission criteria; eligible for awards labels Nov 5, 2022
@HickupHH3
Copy link
Collaborator

partial credit because it fails to elaborate on the consequences of the undeterministic outcome.

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 old-submission-method partial-50 Incomplete articulation of vulnerability; eligible for partial credit only (50%) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

5 participants