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

M-05 MitigationConfirmed #27

Open
c4-bot-7 opened this issue Sep 17, 2024 · 2 comments
Open

M-05 MitigationConfirmed #27

c4-bot-7 opened this issue Sep 17, 2024 · 2 comments
Labels
confirmed for report This issue is confirmed for report mitigation-confirmed MR-M-05 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@c4-bot-7
Copy link
Contributor

Lines of code

Vulnerability details

Users can potentially control their losses because the era and draftEra can be increased independently in the seizeRSR function.

Mitigation

To mitigate this, governance can call the resetStakes function when the draftRate exceeds the safe range.
This allows the governor to reset both the stakeRate and draftRate to 1 simultaneously, preventing users from manipulating their losses.

function resetStakes() external {
    _requireGovernanceOnly();
    require(
        draftRate <= MIN_SAFE_DRAFT_RATE ||
            draftRate >= MAX_SAFE_DRAFT_RATE ||
            stakeRate <= MIN_SAFE_STAKE_RATE ||
            stakeRate >= MAX_SAFE_STAKE_RATE,
        "rates still safe"
    );

    beginEra();
    beginDraftEra();
}

While this is not a perfect solution, as it relies on the governor properly executing the function, the likelihood and impact of the issue are low.
Therefore, I have marked it as confirmed

c4-bot-10 added a commit that referenced this issue Sep 17, 2024
@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Sep 18, 2024
@c4-judge
Copy link

thereksfour marked the issue as satisfactory

@c4-judge c4-judge added the confirmed for report This issue is confirmed for report label Sep 18, 2024
@c4-judge
Copy link

thereksfour marked the issue as confirmed for report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed for report This issue is confirmed for report mitigation-confirmed MR-M-05 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants