Skip to content
Business logic Audit finding Intermediate

Easily bypassing admins ‘pause’ for swivel

The lender contract's function used the caller-supplied principal enum only for a pause check and an event, so an attacker could pass a different, unpaused principal to bypass the admin's pause on Swivel. This could let a paused, dangerous external principal continue to be used, risking loss of funds.

Metatron Follow

Originally disclosed on Code4rena

Submitted by Metatron, also found by cccz, kenzo, and Kulk0

Assuming admin decides to pause an external principle when it’s dangerous, malicious or unprofitable.

Bypassing the admins decision can result in loss of funds for the project.

Proof of Concept

https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L247-L305

  • The principals enum p is only used for unpaused(p) modifier, and to emit an event.
  • Attacker can bypass the unpaused(p) modifier check by simply passing an enum of another principle that is not paused.
  • The function will just continue as normal, without any other side-effect, as if the pause is simple ignored.

Recommended Mitigation Steps

Add this check at the beginning of the function (just like in similar functions of this solution) if (p != uint8(MarketPlace.Principals.Swivel)) { revert Invalid('principal'); }

sourabhmarathe (Illuminate) confirmed


The original report as published on Code4rena, by Metatron. 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 function trusts a caller-supplied principal enum for the pause check without verifying it matches the principal actually being used.

Impact

A paused, dangerous or malicious principal could still be used, which could result in loss of funds for the project.

What the attacker needed

Ability to call the lender function

The fix

The function should reject any principal other than the one it is meant to handle, as the report recommends.

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.

A smart contract lets an administrator pause a specific external partner (called a principal) when it becomes risky. The function that uses that partner checks a value supplied by the caller to decide whether it is paused, but never checks that the value matches the partner actually being used. So a caller can simply claim a different, unpaused partner and the pause is ignored.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Metatron

View all

1 more disclosed report, best first.

More from Illuminate contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.