Skip to content

The seawater_admin cannot update the emergency_council. #7

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

Closed
c4-bot-6 opened this issue Aug 31, 2024 · 2 comments
Closed

The seawater_admin cannot update the emergency_council. #7

c4-bot-6 opened this issue Aug 31, 2024 · 2 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-162 🤖_41_group AI based duplicate group recommendation satisfactory satisfies C4 submission criteria; eligible for awards sufficient quality report This report is of sufficient quality upgraded by judge Original issue severity upgraded from QA/Gas by judge

Comments

@c4-bot-6
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2024-08-superposition/blob/4528c9d2dbe1550d2660dac903a8246076044905/pkg/seawater/src/lib.rs#L1121

Vulnerability details

Impact

Due to a logic error in the update_emergency_council_7_D_0_C_1_C_58 function, the emergency_council in the contract cannot be updated by the seawater_admin.
This will result in the emergency_council contract being unable to be upgraded after it becomes outdated, and the nft_manager may be incorrectly set.

Proof of Concept

    /// Update the emergency council that can disable the pools.
    #[allow(non_snake_case)]
    pub fn update_emergency_council_7_D_0_C_1_C_58(
        &mut self,
        manager: Address,
    ) -> Result<(), Revert> {
        assert_eq_or!(
            msg::sender(),
            self.seawater_admin.get(),
            Error::SeawaterAdminOnly
        );

        self.nft_manager.set(manager);

        Ok(())
    }

The update_emergency_council_7_D_0_C_1_C_58 function mistakenly sets the nft_manager to the provided emergency_council address. This results in the nft_manager being incorrectly set, and the emergency_council not being updated.

Tools Used

Manual Review

Recommended Mitigation Steps

    /// Update the emergency council that can disable the pools.
    #[allow(non_snake_case)]
    pub fn update_emergency_council_7_D_0_C_1_C_58(
        &mut self,
-       manager: Address,
+       emergency: Address,
    ) -> Result<(), Revert> {
        assert_eq_or!(
            msg::sender(),
            self.seawater_admin.get(),
            Error::SeawaterAdminOnly
        );

-       self.nft_manager.set(manager);
+       self.emergency_council.set(emergency);

        Ok(())
    }

Assessed type

Error

@c4-bot-6 c4-bot-6 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 Aug 31, 2024
c4-bot-8 added a commit that referenced this issue Aug 31, 2024
@c4-bot-13 c4-bot-13 added the 🤖_41_group AI based duplicate group recommendation label Sep 13, 2024
@howlbot-integration howlbot-integration bot added sufficient quality report This report is of sufficient quality duplicate-64 labels Sep 16, 2024
@c4-judge c4-judge added duplicate-162 3 (High Risk) Assets can be stolen/lost/compromised directly upgraded by judge Original issue severity upgraded from QA/Gas by judge and removed duplicate-64 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Sep 23, 2024
@c4-judge
Copy link
Contributor

alex-ppg changed the severity to 3 (High Risk)

@c4-judge
Copy link
Contributor

alex-ppg marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Sep 23, 2024
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-162 🤖_41_group AI based duplicate group recommendation satisfactory satisfies C4 submission criteria; eligible for awards sufficient quality report This report is of sufficient quality upgraded by judge Original issue severity upgraded from QA/Gas by judge
Projects
None yet
Development

No branches or pull requests

3 participants