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.
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
- The principals enum
pis only used forunpaused(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
pauseis 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
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.