Wrong starting price when listing on Seaport for assets that has less than 18 decimals
The liquidation initial ask is stored in 18-decimal format but is passed unchanged to Seaport as the auction starting price, even when the settlement asset has fewer decimals. For a 6-decimal asset such as USDC, the listed price becomes far too high, making the NFT unlikely to sell.
Submitted by Koolex
According to Astaria’s docs: https://docs.astaria.xyz/docs/protocol-mechanics/loanterms
Liquidation initial ask: Should the NFT go into liquidation, the initial price of the auction will be set to this value. Note that this set as a starting point for a dutch auction, and the price will decrease over the liquidation period. This figure is should also be specified in 10^18 format.
The liquidation initial ask is specified in 18 decimals. This is then used as a starting price when the NFT goes under auction on OpenSea. However, if the asset has less than 18 decimals, then the starting price goes wrong to Seaport.
This results in listing the NFT with too high price that makes it unlikely to be sold.
Proof of Concept
The starting price is set to the liquidation initial ask:
listedOrder = s.COLLATERAL_TOKEN.auctionVault(
ICollateralToken.AuctionVaultParams({
settlementToken: stack[position].lien.token,
collateralId: stack[position].lien.collateralId,
maxDuration: auctionWindowMax,
startingPrice: stack[0].lien.details.liquidationInitialAsk,
endingPrice: 1_000 wei
})
);
https://github.com/code-423n4/2023-01-astaria/blob/main/src/AstariaRouter.sol#L639-L647
Let’s assume the asset is USDC which has 6 decimals:
- Strategist signs a strategy with liquidationInitialAsk 1000e18.
- Following the docs, this means the starting price is supposed to be 1000 USDC
- The NFT is being liquidated
- 1000e18 is passed to Seaport along with asset USDC
- Seaport lists the NFT, and the price will be too high as1000e18 will be 1000000000000000 USDC
Recommended Mitigation Steps
- Either fetch the asset’s decimals on-chain or add it as a part of the strategy.
- Convert liquidationInitialAsk to the asset’s decimals before passing it as a starting price.
SantiagoGregory (Astaria) 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
Likely the code assumes every settlement token uses 18 decimals and passes the 18-decimal liquidation initial ask to Seaport without scaling it to the asset's actual decimals.
Impact
The NFT could be listed at a starting price far above the intended amount, making it unlikely to be sold during liquidation.
What the attacker needed
Asset with fewer than 18 decimals; NFT goes into liquidation
The fix
The liquidation initial ask should be converted to the settlement asset's decimals, either by fetching the decimals on-chain or storing them in the strategy, before it is passed as the starting price.
How it was found
- A strategist signs a strategy with a liquidation initial ask of 1000e18.
- Following the docs, this is meant to represent a starting price of 1000 USDC.
- The NFT goes into liquidation.
- The 1000e18 value is passed to Seaport together with the USDC asset.
- Seaport lists the NFT at a price that is far too high.
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.
Tokens can have different numbers of decimal places. A value written for an 18-decimal token means something very different when used for a 6-decimal token. Here the code passed the 18-decimal figure straight to the auction without converting it, so the starting price was much larger than intended.
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.