Skip to content

Code4rena

HydraDX

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

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

Disclosed reports

Newest first. Only what HydraDX chose to make public.

DoS

complete liquidity removal will result in permanent disable of the liquidity addition and prevent minting shares for the liquidity providers.

Removing all liquidity from an Omnipool asset leaves the pool with zero reserve and zero shares, after which the add_liquidity function divides by the zero reserve and always reverts. This permanently prevents any liquidity provider from adding liquidity or minting shares, and if a small donation is made first, providers receive zero shares and their funds are locked.

HydraDX

Medium
Business logic

A huge loss of funds for all the users who try to remove liquidity after swapping got disabled at manipulated price.

The report describes an edge case where an asset's tradability state is set to allow only adding and removing liquidity while its price is manipulated, so the price check is skipped and the withdrawal fee becomes 100%, causing liquidity providers to lose all their funds when removing liquidity. The attacker could front-run the setting of this state to exploit the manipulated price.

HydraDX

Medium
Smart contracts

Missing hook call will lead to incorrect oracle results

The remove_token function in the Omnipool contract does not call the on_liquidity_changed hook, so the oracle and circuit breaker are not updated when liquidity is withdrawn. This can cause the oracle to calculate prices based on outdated liquidity and the circuit breaker to fail to enforce limits correctly.

HydraDX

Medium
Business logic

Re-adding assets to the omnipool can cause a problem with the oracle

When an asset is removed from the omnipool, its oracle entries are not deleted, so if the asset is later re-added at a different price, the oracle's exponential moving average mixes old and new data, producing an incorrect price for a short period. This can cause liquidity providers to be unable to add liquidity due to a price difference check, or cause protocols relying on the oracle to use a wrong price.

HydraDX

Medium
Business logic

No safe_withdrawal option in withdraw_protocol_liquidity function in omnipool can be abused by frontrunners to cause losses to the admin when removing liquidity

The withdraw_protocol_liquidity function lacks the safe_withdrawal price check present in remove_liquidity, so an attacker can frontrun the admin's withdrawal and manipulate the spot price to cause slippage losses. The report claims these losses can be much higher than the 2% limit enforced elsewhere.

HydraDX

Medium
Business logic

No slippage check in remove_liquidity function in omnipool can lead to slippage losses during liquidity withdrawal.

The liquidity removal function in the omnipool pallet lacks a minimum amount out parameter, so a liquidity provider can suffer slippage losses if a malicious actor frontruns the withdrawal by swapping to move the price. The report demonstrates losses of up to about 1% in test scenarios, capped at 2% by an existing price deviation check.

HydraDX

Medium
Business logic

Malicious liquidity provider can put pool into highly manipulatable state

The withdraw_asset_amount function in HydraDx's StableSwap AMM lacks a check on total pool liquidity, allowing a user to transfer a tiny share to another address and then withdraw all their shares, leaving the pool with very low liquidity. This can break the minimum liquidity invariant, making the pool easily manipulatable, or prevent other users from withdrawing via remove_liquidity_one_asset.

HydraDX

Medium
Business logic

Users can MAKE EMA-Oracle price outdated with direct transfers to StableSwap

The EMA oracle only updates when StableSwap hooks fire, so direct token transfers to StableSwap change pool prices without updating the oracle. An attacker could make the oracle report an outdated price, potentially affecting external protocols that rely on it.

HydraDX

Medium
DoS

Storage can be bloated with low value liquidity positions

The Omnipool allows users to add liquidity and then immediately withdraw almost all of it, leaving a tiny position that still occupies storage. An attacker could repeatedly create such dust positions to bloat the chain's storage at very low cost, potentially leading to a denial of service.

HydraDX

Medium
DoS

Complete liquidity removals fail from stableswap pools

The stableswap pallet lacks a function to withdraw liquidity in all pool tokens at once, so redeeming the entire LP supply through the single-asset withdrawal function causes an arithmetic overflow and reverts. This can leave the initial liquidity locked in the pool.

HydraDX

Medium