Skip to content
DoS Write-up Beginner

I Tested an AI Chat API and Found a Missing Rate Limiting Vulnerability |by Samadhan Shimple

An AI chat endpoint accepted 100 automated requests without returning a rate-limit response, CAPTCHA, or cooldown. An attacker with an account could send many requests, potentially increasing AI inference costs or exhausting backend resources.

medium.com

Published on medium.com

Api Security

Samadhan shimple, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

AI chat features are now a common part of web applications: they answer customer questions, generate content and make an application more interactive. This write-up is about what happens when such a feature has no observable usage limit, so that a single client can keep sending AI requests without being throttled.

The researcher describes the issue as Missing Rate Limiting on an AI Chat Endpoint. Rate limiting restricts how often a client can perform an action within a defined period; for example, an application might allow 100 chat requests per minute under its usage policy. Without such controls, a client may submit requests at a much higher rate than intended.

The test was carried out during an authorised security assessment. The article does not name the application, the endpoint, the AI provider or the model behind the feature.

This image is a AI Generated From the original on medium.com

The image is an AI-generated illustration used as the article's header.

Setup

The test required a logged-in account on the application and Burp Suite, used first as a Proxy to intercept the chat request and then as Intruder to replay it. The report stresses that testing should only be done with explicit authorisation.

The article gives no product versions, no account roles beyond the logged-in user, and no details of the request itself: no host, path, parameters or headers are reproduced.

Finding it

The researcher logged in, opened the AI chat feature, submitted a test message and intercepted the resulting HTTP request with Burp Suite Proxy. The question behind the test was simple: does the endpoint enforce any observable restriction on request volume?

What made the behaviour look wrong was the response pattern. Repeated requests kept succeeding. Across 100 requests sent with Burp Suite Intruder, every one returned HTTP 201 Created. No rate-limit response, CAPTCHA challenge or cooldown appeared during the test.

Exploitation

Step 1: Capture a legitimate request

With Burp Suite Proxy running, the researcher logged in, opened the AI chat feature and submitted a test message. The resulting request was intercepted and the relevant endpoint identified. The request was then sent to Burp Suite Intruder for controlled testing. The article does not reproduce the captured request.

Step 2: Configure Intruder

Intruder was configured to send a sequence of requests using a numeric payload ranging from 0 to 100. The payload was used to distinguish requests during the test. The article notes that where a changing parameter is required, it should be a legitimate test parameter that does not alter the authentication context or invalidate the request. The test was then executed against the authorised target.

Step 3: Analyse the responses

The researcher stresses that the important part was not the number of requests sent but how the application responded. The observations were:

  • The requests continued to receive HTTP 201 Created responses.
  • No HTTP 429 Too Many Requests response was observed.
  • No CAPTCHA challenge or cooldown was triggered during the tested sequence.
  • The endpoint continued accepting the submitted requests.

These observations suggested that the application might not have been enforcing an effective rate limit at the endpoint or within the tested account's usage context.

The researcher is careful about what this proves. A successful HTTP response alone does not show that the backend completed an expensive AI inference call every time. A limit could exist at a different layer, or activate only after a higher threshold or a longer time window. The finding is stated as: no effective throttling was observed across the 100 requests tested.

Root cause

The article does not examine the application's code or configuration, so the underlying cause is not established. What the test shows is the absence of an observable control at the endpoint or in the account's usage context during the tested sequence. The report only notes that a limit could exist at a different layer or activate after a higher threshold or longer time window.

Impact

Missing rate limiting matters more for AI applications than for ordinary endpoints. A conventional API request may consume relatively little processing power, whereas an AI request can involve model inference, input and output token processing, orchestration services and calls to external providers. Depending on the architecture, these operations may incur a cost for every request or for the tokens processed.

Unexpected AI inference costs. If an application pays per inference request or per input and output token, automated requests without meaningful restrictions may increase AI consumption substantially. The article gives an illustrative figure of an average cost of $0.01 per request. It states explicitly that these figures are hypothetical and do not represent the actual cost of the application tested; real costs depend on the model, token volume, pricing structure, caching and other implementation details. The point is that even a small per-request cost can accumulate when usage is not adequately controlled.

Resource exhaustion and service disruption. AI workloads can consume compute capacity, memory, concurrency slots and other backend resources. A sufficiently high request volume may increase latency, exhaust available capacity or interfere with legitimate users. Whether this becomes a denial-of-service condition depends on infrastructure capacity, concurrency controls, provider limits and the application's ability to reject excess work. Rate limiting is one part of a broader resource-management strategy.

Automated abuse at scale. Depending on the application's functionality, excessive requests may support automated content generation, large-scale scraping, repeated prompt submissions or attempts to exhaust per-user quotas. The exact impact depends on what the endpoint can do and what other security controls are in place.

The article's disclaimer is explicit: the request counts and cost examples illustrate the described test, not proof of unlimited usage, actual financial loss or a confirmed service outage.

Classification and severity

The finding is mapped to:

  • OWASP API Security Top 10: API4:2023, Unrestricted Resource Consumption
  • CWE-770, Allocation of Resources Without Limits or Throttling

The researcher initially assessed the issue as High severity because of the potential for financial resource exhaustion and service disruption. A possible CVSS 3.1 vector is:

Text
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

That gives a CVSS 3.1 score of 7.5 (High). The score assumes the attacker needs a low-privilege account, the attack is remotely accessible and the vulnerability can cause a high availability impact. The article notes that these assumptions must be supported by evidence, and that a missing rate limit is not automatically Critical simply because the endpoint is unauthenticated; the final severity depends on the actual consequences and the applicable scoring methodology.

Fix

The article does not say whether anything was changed in the application. It sets out the controls developers should apply. The solution is not simply to block a user after a fixed number of HTTP requests; AI applications need layered controls covering request volume, token usage, concurrency and cost.

1. Implement server-side rate limiting

Apply limits to AI-related endpoints at the application or API gateway layer. Depending on the application, limits can be enforced per account, API key, session, IP address or a combination of these identifiers. Use algorithms such as token bucket or sliding window to control request frequency. IP-based limits alone are insufficient, because multiple users may share an IP address while an attacker may distribute requests across different addresses.

2. Enforce token and usage quotas

Request counts do not always reflect actual cost: one request may contain a short question, another a large context and a lengthy response. Consider enforcing limits on:

  • Requests per minute or hour.
  • Input and output tokens per user.
  • Daily or monthly usage.
  • Concurrent AI requests.
  • Maximum input and output sizes.

Quotas should match the application's legitimate usage patterns.

3. Return meaningful rate-limit responses

When a client exceeds a configured limit, reject excess requests with:

HTTP
HTTP/1.1 429 Too Many RequestsRetry-After: 30Content-Type: application/json

Example response body:

JSON
{  "error": "rate_limit_exceeded",  "message": "Too many requests. Please try again later."}

The value of Retry-After should reflect the actual cooldown or reset policy; the example above is illustrative. Returning HTTP 429 makes throttling behaviour clearer to clients and helps legitimate users understand when they can retry.

Lessons learned

A successful response does not necessarily mean an API is secure. Developers often focus on authentication, authorisation, input validation and data exposure; those controls are essential but do not cover every risk in AI-powered applications, and resource consumption deserves its own place in testing. In this case, 100 requests returned 201 Created without observable throttling, a useful signal of a potential resource-consumption weakness, although additional evidence would be needed to establish the full financial or availability impact.

For researchers, the lesson is to collect evidence carefully, distinguish observed behaviour from potential impact, and make every report reproducible. Testing should only be performed against systems for which there is explicit authorisation or within a program's published scope, and findings should go to the owner through its designated reporting channel with a reasonable opportunity to validate and remediate before publication.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

What happened, in plain words

Many websites now include an AI chat box: you type a question, and a computer program (an AI model) writes an answer. Behind that chat box sits a piece of software called an API (application programming interface), which is the part of the website that actually receives your message and passes it to the AI. Think of the chat box as the counter of a shop and the API as the person in the back room doing the work: you never see them, but every message you send is handed to them.

Most shops have a rule about how many orders one customer can place in an hour. Websites have the same idea, and it is called rate limiting: a cap on how many times a client may perform an action in a given period. The researcher in this article tested an AI chat API during an authorised security assessment and found that no such cap was visible. They sent 100 requests in a row, and every single one came back with the same success message, HTTP 201 Created. No error about too many requests, no puzzle to prove you are human, no waiting period.

That matters because AI answers cost money and computing power to produce. If nothing stops a client from asking again and again, the bill and the workload can grow far beyond what the site intended. The researcher is careful to say that this is a signal of a possible weakness, not proof of unlimited use or of any actual loss.

This image is a AI Generated From the original on medium.com

The image above is an AI-generated illustration used as the header of the article.

The idea behind the test

The issue is described as Missing Rate Limiting on an AI Chat Endpoint. An endpoint is simply a specific address on a server that accepts a particular kind of request, like a specific counter in a large building. Rate limiting restricts how often a client can perform an action within a defined period. For example, an application might allow 100 chat requests per minute under its usage policy. Without such controls, a client may submit requests at a much higher rate than intended.

The test was carried out during an authorised security assessment. The article does not name the application, the endpoint, the AI provider or the model behind the feature.

What you need before you start

The test required a logged-in account on the application and Burp Suite, used first as a Proxy to intercept the chat request and then as Intruder to replay it. The report stresses that testing should only be done with explicit authorisation.

A few words on those. Burp Suite is a tool that sits between your browser and the website, like a postal worker who opens every letter you send and every reply you get, so you can read and change them. Its Proxy mode is the part that catches a request on its way out. Its Intruder mode is the part that takes one captured request and sends it again and again, optionally changing a small piece each time. Authorisation means the owner of the system has given you written permission to test it; without that, sending repeated requests is not research, it is abuse.

The article gives no product versions, no account roles beyond the logged-in user, and no details of the request itself: no host, path, parameters or headers are reproduced.

How the problem was found

The researcher logged in, opened the AI chat feature, submitted a test message and intercepted the resulting HTTP request with Burp Suite Proxy. The question behind the test was simple: does the endpoint enforce any observable restriction on request volume?

What made the behaviour look wrong was the response pattern. Repeated requests kept succeeding. Across 100 requests sent with Burp Suite Intruder, every one returned HTTP 201 Created. No rate-limit response, CAPTCHA challenge or cooldown appeared during the test.

Some terms here. HTTP is the language browsers and servers use to talk to each other. Every reply carries a three-digit status code: 200 and 201 mean things went well (201 specifically means something was created), while 429 means "too many requests". A CAPTCHA is the little puzzle that asks you to tick boxes with traffic lights, used to tell humans from automated scripts. A cooldown is a forced pause before you may try again.

Walking through the test

Step 1: Capture a legitimate request

With Burp Suite Proxy running, the researcher logged in, opened the AI chat feature and submitted a test message. The resulting request was intercepted and the relevant endpoint identified. The request was then sent to Burp Suite Intruder for controlled testing. The article does not reproduce the captured request.

Why start with a normal message? Because you want to see exactly what a genuine request looks like before you repeat it. If you invent a request from scratch, the server may reject it for reasons that have nothing to do with rate limiting, and you learn nothing. Catching a real one gives you a known-good template.

Step 2: Configure Intruder

Intruder was configured to send a sequence of requests using a numeric payload ranging from 0 to 100. The payload was used to distinguish requests during the test. The article notes that where a changing parameter is required, it should be a legitimate test parameter that does not alter the authentication context or invalidate the request. The test was then executed against the authorised target.

A payload here just means the value that changes between requests. Sending the same request 100 times identically can be hard to tell apart in the results, so a number that counts up from 0 to 100 labels each attempt. The warning about the authentication context matters: when you log in, the site gives your browser a session cookie or token, a short string that acts like a wristband at an event. If your changing value touches that wristband, the server may treat you as logged out and refuse the request, and you would mistake a login problem for a rate-limit finding.

Step 3: Analyse the responses

The researcher stresses that the important part was not the number of requests sent but how the application responded. The observations were:

  • The requests continued to receive HTTP 201 Created responses.
  • No HTTP 429 Too Many Requests response was observed.
  • No CAPTCHA challenge or cooldown was triggered during the tested sequence.
  • The endpoint continued accepting the submitted requests.

These observations suggested that the application might not have been enforcing an effective rate limit at the endpoint or within the tested account's usage context.

The researcher is careful about what this proves. A successful HTTP response alone does not show that the backend completed an expensive AI inference call every time. A limit could exist at a different layer, or activate only after a higher threshold or a longer time window. The finding is stated as: no effective throttling was observed across the 100 requests tested.

Inference is the moment the AI model actually does its work and produces an answer. Throttling is the general name for slowing or blocking a client that asks too much. The caution is worth understanding: a website can be built in layers, like a building with a front desk, a lift and a locked floor. A limit might live on a floor the test never reached, or only switch on after 500 requests rather than 100.

Why it happens

The article does not examine the application's code or configuration, so the underlying cause is not established. What the test shows is the absence of an observable control at the endpoint or in the account's usage context during the tested sequence. The report only notes that a limit could exist at a different layer or activate after a higher threshold or longer time window.

What could go wrong because of it

Missing rate limiting matters more for AI applications than for ordinary endpoints. A conventional API request may consume relatively little processing power, whereas an AI request can involve model inference, input and output token processing, orchestration services and calls to external providers. Depending on the architecture, these operations may incur a cost for every request or for the tokens processed.

A token in this AI sense is a small chunk of text, roughly a word or part of a word, that the model reads and writes; providers often charge by the token. Orchestration services are the behind-the-scenes helpers that pass your message around between systems.

Unexpected AI inference costs. If an application pays per inference request or per input and output token, automated requests without meaningful restrictions may increase AI consumption substantially. The article gives an illustrative figure of an average cost of $0.01 per request. It states explicitly that these figures are hypothetical and do not represent the actual cost of the application tested; real costs depend on the model, token volume, pricing structure, caching and other implementation details. The point is that even a small per-request cost can accumulate when usage is not adequately controlled. Think of a vending machine that charges a penny per press: one press is nothing, ten thousand presses is a bill.

Resource exhaustion and service disruption. AI workloads can consume compute capacity, memory, concurrency slots and other backend resources. A sufficiently high request volume may increase latency, exhaust available capacity or interfere with legitimate users. Whether this becomes a denial-of-service condition depends on infrastructure capacity, concurrency controls, provider limits and the application's ability to reject excess work. Rate limiting is one part of a broader resource-management strategy. Latency is the delay before a reply arrives; concurrency slots are the limited number of jobs a server can handle at the same moment, like the number of tills open in a supermarket.

Automated abuse at scale. Depending on the application's functionality, excessive requests may support automated content generation, large-scale scraping, repeated prompt submissions or attempts to exhaust per-user quotas. The exact impact depends on what the endpoint can do and what other security controls are in place.

The article's disclaimer is explicit: the request counts and cost examples illustrate the described test, not proof of unlimited usage, actual financial loss or a confirmed service outage.

How the finding is classified and scored

The finding is mapped to:

  • OWASP API Security Top 10: API4:2023, Unrestricted Resource Consumption
  • CWE-770, Allocation of Resources Without Limits or Throttling

OWASP is a well-known community project that publishes lists of common security mistakes; the API Security Top 10 is its list for APIs, and API4:2023 is the entry about letting clients consume resources without limits. CWE is a catalogue of software weakness types, and CWE-770 is the entry for handing out resources without any cap.

The researcher initially assessed the issue as High severity because of the potential for financial resource exhaustion and service disruption. A possible CVSS 3.1 vector is:

Text
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

CVSS is a standard scoring system for vulnerabilities. The vector is a compact string of letters that records each judgement, and the score is calculated from it. Reading it piece by piece:

  • AV:N means the attack can be carried out over the network, not only by someone sitting at the machine.
  • AC:L means the attack complexity is low: no special conditions are needed.
  • PR:L means the attacker needs low privileges, in this case an ordinary logged-in account.
  • UI:N means no user interaction is required; nobody has to click anything.
  • S:U means the scope is unchanged: the impact stays within the vulnerable component.
  • C:N means there is no confidentiality impact; no data is exposed.
  • I:N means there is no integrity impact; no data is altered.
  • A:H means there is a high availability impact; the service could be disrupted.

That gives a CVSS 3.1 score of 7.5 (High). The score assumes the attacker needs a low-privilege account, the attack is remotely accessible and the vulnerability can cause a high availability impact. The article notes that these assumptions must be supported by evidence, and that a missing rate limit is not automatically Critical simply because the endpoint is unauthenticated; the final severity depends on the actual consequences and the applicable scoring methodology.

How to fix it

The article does not say whether anything was changed in the application. It sets out the controls developers should apply. The solution is not simply to block a user after a fixed number of HTTP requests; AI applications need layered controls covering request volume, token usage, concurrency and cost.

1. Implement server-side rate limiting

Apply limits to AI-related endpoints at the application or API gateway layer. Depending on the application, limits can be enforced per account, API key, session, IP address or a combination of these identifiers. Use algorithms such as token bucket or sliding window to control request frequency. IP-based limits alone are insufficient, because multiple users may share an IP address while an attacker may distribute requests across different addresses.

Server-side means the check happens on the server, where the user cannot switch it off; a check done only in the browser is like a shop trusting customers to count their own orders. An API gateway is a front door that all API traffic passes through, a convenient place to put a bouncer. An IP address is the numeric label of a device on the internet, and many people can share one, for example in an office or on mobile networks. A token bucket is a simple counting method: imagine a bucket that holds a fixed number of coins and refills slowly; each request spends a coin, and when the bucket is empty the requests wait. A sliding window counts requests over the last period of time, for example the last 60 minutes, and moves forward continuously rather than resetting on the hour.

2. Enforce token and usage quotas

Request counts do not always reflect actual cost: one request may contain a short question, another a large context and a lengthy response. Consider enforcing limits on:

  • Requests per minute or hour.
  • Input and output tokens per user.
  • Daily or monthly usage.
  • Concurrent AI requests.
  • Maximum input and output sizes.

Quotas should match the application's legitimate usage patterns. A quota is an allowance, like a monthly data bundle. The point is that counting messages alone is like charging by the number of letters rather than their weight: one short note and one thick parcel are not the same cost.

3. Return meaningful rate-limit responses

When a client exceeds a configured limit, reject excess requests with:

HTTP
HTTP/1.1 429 Too Many RequestsRetry-After: 30Content-Type: application/json

Line by line: HTTP/1.1 is the version of the protocol being used for this reply. 429 Too Many Requests is the status code that says the client has asked too often. Retry-After: 30 tells the client to wait 30 seconds before trying again. Content-Type: application/json says the body of the reply is formatted as JSON, a common text format for structured data that both machines and people can read.

Example response body:

JSON
{  "error": "rate_limit_exceeded",  "message": "Too many requests. Please try again later."}

This body is a small JSON object with two fields. error holds a short machine-readable code, rate_limit_exceeded, so software can react automatically. message holds a sentence meant for a human, explaining that too many requests were made and asking them to try again later.

The value of Retry-After should reflect the actual cooldown or reset policy; the example above is illustrative. Returning HTTP 429 makes throttling behaviour clearer to clients and helps legitimate users understand when they can retry.

Sequentially means one after another; in parallel means many at the same moment. Silent throttling is when a system pretends to accept a request but does not actually do the expensive work, which is why looking only at the status code can mislead you.

What to take away

A successful response does not necessarily mean an API is secure. Developers often focus on authentication, authorisation, input validation and data exposure; those controls are essential but do not cover every risk in AI-powered applications, and resource consumption deserves its own place in testing. In this case, 100 requests returned 201 Created without observable throttling, a useful signal of a potential resource-consumption weakness, although additional evidence would be needed to establish the full financial or availability impact.

For researchers, the lesson is to collect evidence carefully, distinguish observed behaviour from potential impact, and make every report reproducible. Testing should only be performed against systems for which there is explicit authorisation or within a program's published scope, and findings should go to the owner through its designated reporting channel with a reasonable opportunity to validate and remediate before publication.

Glossary

  • API: the part of a website that receives requests from other software and does the work behind the scenes.
  • API gateway: a front door that all API traffic passes through, often used to apply shared rules such as rate limits.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: permission to do something, including written permission to test a system.
  • Burp Suite: a tool that sits between your browser and a website so you can read, change and repeat requests.
  • CAPTCHA: a puzzle used to tell humans from automated scripts.
  • Concurrency slots: the limited number of jobs a server can process at the same moment.
  • Cooldown: a forced pause before a client may try again.
  • CVSS: a standard scoring system for vulnerabilities, calculated from a vector string.
  • CWE: a catalogue of software weakness types, each with a number.
  • Denial of service: a condition where a service becomes unavailable or unusable for legitimate users.
  • Endpoint: a specific address on a server that accepts a particular kind of request.
  • HTTP: the language browsers and servers use to exchange requests and replies.
  • Inference: the moment an AI model processes input and produces output.
  • Intruder: the part of Burp Suite that repeats a captured request many times, optionally changing a value each time.
  • IP address: the numeric label of a device on the internet.
  • JSON: a common text format for structured data.
  • Latency: the delay before a reply arrives.
  • Orchestration services: behind-the-scenes helpers that pass a request between systems.
  • OWASP: a community project that publishes lists of common security mistakes, including the API Security Top 10.
  • Payload: the value that changes between repeated requests in a test.
  • Proxy: the part of Burp Suite that catches requests on their way out of the browser.
  • Quota: an allowance, such as a number of requests or tokens per day.
  • Rate limiting: a cap on how often a client may perform an action in a given period.
  • Resource exhaustion: using up a system's capacity, memory or processing power until it struggles.
  • Retry-After: an HTTP header telling a client how long to wait before trying again.
  • Session cookie or token: a short string a site gives your browser after login, acting as proof that you are signed in.
  • Sliding window: a rate-limiting method that counts requests over the most recent period of time.
  • Status code: a three-digit number in an HTTP reply, such as 201 for success or 429 for too many requests.
  • Throttling: slowing or blocking a client that asks too much.
  • Token (AI): a small chunk of text, roughly a word or part of a word, that a model reads or writes and that providers often charge for.
  • Token bucket: a rate-limiting method using a refilling allowance of coins, one spent per request.
  • Vector (CVSS): a compact string of letters recording each judgement behind a CVSS score.

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.