Skip to content

Immunefi

Swaylend

Every publicly disclosed report for Swaylend and what kind of bugs they were.

disclosed reports
25
most reported class
Business logic
bug classes found
4
first disclosure
2024
Find Swaylend on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Swaylend chose to make public.

Business logic

Market.update_collateral_asset should reuse old configuration's asset_id

The update_collateral_asset function stores the caller-supplied configuration without forcing its asset_id to match the key it is stored under, unlike update_market_configuration which reuses the old base_token. An owner could therefore save a configuration whose asset_id disagrees with its storage key, leaving inconsistent collateral data.

Swaylend

Informational
DoS

Absorb_internal might be DOSed

The absorb function processes a list of accounts and reverts entirely if any one account is not liquidatable. An attacker could make a transaction fail by ensuring one account in the list is no longer liquidatable, for example by repaying debt first, thereby blocking the liquidation of other accounts.

Swaylend

Medium
Business logic

Permanent freezing of tokens when user sends extra tokens as update fee

The contract's price update function accepts a payment larger than the required update fee but does not refund the excess, so the extra tokens remain stuck in the contract. An attacker could cause a user to lose funds by inducing them to overpay, though the report frames it as a user mistake.

Swaylend

High
Business logic

If the collateral token''s decimal is <= the base token decimal in a market, collateral_value_to_sell() will always revert & available_to_borrow() will return a wrong amount tha

In markets where a collateral token has fewer decimals than the base token, the scale calculation in collateral_value_to_sell() underflows and reverts, while available_to_borrow() computes an incorrect borrow limit. This can prevent liquidators from calculating collateral to sell, wasting time and potentially causing bad debt.

Swaylend

Low
Business logic

By bypassing base_borrow_min limitation borrows can create inabsorbable loans

The withdraw_base function enforces a minimum borrow amount, but the supply_base function does not, allowing a user to borrow a large amount and then repay most of it to leave a debt below the minimum. This could create small loans that are not worth liquidating, potentially leaving collateral stuck in the contract.

Swaylend

High
Audit finding

Market.present_value_borrow should be roundUp

The function that converts a borrower's principal into the current debt amount uses integer division that rounds down, so the debt is slightly understated. An attacker could repay slightly less than owed, and repeated rounding in the protocol's favour of the borrower could contribute to insolvency.

Swaylend

Medium
Business logic

Market.absorb can be called when Market.supply_collateral is paused

The contract's pause configuration lets the admin pause collateral supply and base supply while leaving the absorb (liquidation) function active. If a borrower's collateral price falls during that state, the borrower cannot add collateral or repay, but other users can still call absorb and take the collateral.

Swaylend

Informational
Smart contracts

Src-20.burn should use "==" instead of ">="

The burn function in the src-20 contract checks that the sent amount is greater than or equal to the burn amount, but only burns the specified amount and subtracts it from total supply. An attacker can send more tokens than they burn, leaving the excess stuck in the contract with no way to recover them, and if the total supply cap is reached, no further tokens can be minted.

Swaylend

High
Smart contracts

Market.set_pyth_contract_id should emit an event

The market contract's function that updates the Pyth oracle contract identifier writes the new value to storage without emitting an event. As a result, off-chain observers would not be notified when this important configuration changes.

Swaylend

Informational
Audit finding

Constanct value is used to check price.confidence

The contract's price validation uses a single hard-coded confidence threshold for every Pyth price feed, but different feeds have very different confidence widths. A feed with a wide confidence interval can fail the check and cause transactions to revert, while a feed with a narrow interval may pass even when the price is unreliable.

Swaylend

Critical
Business logic

Unhandled smaller base decimals than 6 or bigger than the collateral's decimals

The market contract calculates decimal scaling factors using subtraction and division that can underflow or divide by zero when the base token has more decimals than the collateral, or fewer than six decimals. This causes view functions to revert or the market to become unusable, requiring redeployment.

Swaylend

Low
Business logic

Loss of yield to the protocol due to incorrect interest rate applied

The liquidation check in the absorb function used the supply rate instead of the borrow rate when calculating a borrower's present debt value, making the debt appear smaller. This delayed liquidation until collateral prices fell further, reducing the yield the protocol could earn from liquidating the position.

Swaylend

Critical
Business logic

Users can withdraw collateral even when the admin pauses the contract.

The contract's pause mechanism blocks supplying collateral but not withdrawing it, so a user can still remove collateral while the market is paused. An attacker could keep exploiting the protocol during a pause that the admin intended to stop activity.

Swaylend

Low
DoS

Adding too many collaterals will halt the protocol operation

The Market contract loops over all collateral configurations in several functions, and since configurations cannot be removed, adding enough of them would exceed the transaction gas limit, making functions like withdraw_base unexecutable and permanently locking funds.

Swaylend

Informational