Skip to content
Access control Audit finding Beginner

Halting the protocol should be onlyGovernance and not onlyStrategist

The setHalted() function in the Manager contract was protected by onlyStrategist instead of onlyGovernance, allowing a strategist to halt the entire protocol. A malicious strategist could use the 7-day window to permanently shut down the protocol if they disagreed with a governance decision to replace them.

0xRajeev Follow

Originally disclosed on Code4rena

Submitted by 0xRajeev

Impact

A malicious strategist can halt the entire protocol and force a permanent shutdown once they observe that governance is trying to set a new strategist and they do not agree with that decision. They may use the 7 day window to halt the protocol. The access control on setHalted() should be onlyGovernance.

Proof of Concept

Tools Used

Manual Analysis

Recommended Mitigation Steps

Change access control to onlyGovernance fromonlyStrategist for setHalted()

GainsGoblin (yAxis) acknowledged

uN2RVw5q commented:

Implemented in https://github.com/code-423n4/2021-09-yaxis/pull/35

GalloDaSballo (judge) commented:

Agree that such critical functionality should be limited to the highest permission access role. Sponsor has mitigated

The original report as published on Code4rena, by 0xRajeev. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The setHalted() function had its access control set to onlyStrategist rather than onlyGovernance, giving a lower-privileged role the power to halt the protocol.

Impact

A malicious strategist could halt the entire protocol and force a permanent shutdown, especially during a governance attempt to replace them.

What the attacker needed

Strategist role

The fix

The access control for setHalted() was changed from onlyStrategist to onlyGovernance, as confirmed by the sponsor's implementation.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In a smart contract, certain functions are restricted to specific roles. Here, the function that can stop the whole protocol could be called by a 'strategist' (a role that manages investments) instead of only by 'governance' (the top-level decision-makers). This meant a strategist could unilaterally shut down the system, especially if they were about to be replaced.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by 0xRajeev

View all

61 more disclosed reports, best first.

More from yAxis contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.