Skip to content
DoS Disclosed report Beginner

Race condition on the Federalist API endpoints can lead to the Denial of Service attack

The Federalist API lacked rate limiting, allowing an authenticated user to send many parallel requests that exhausted server resources. On a local instance, 1000 parallel GET requests to the /v0/me endpoint made the instance completely inaccessible.

sp1d3rs Follow

Originally disclosed on HackerOne

  • Triaged in 16 days
  • Fixed in 40 days
  • Paid in 40 days
  • Disclosed after 54 days

Summary by the researcher

Thanks to the 18F team for the great experience, fast fix and the bounty!

This report describes missing rate limiting on Federalist API endpoints. Missing rate limiting is usually considered as best practice, but in this particular case it was possible to make the server unresponsive using big count of API calls in the parallel mode from single machine. Issue was fixed by implementing rate limiting using express-rate-limit package.

##References Running Federalist locally

The report

##Description Hello. I discovered that the Federalist API doesn't have rate limiting in place, and executes any amount of request to the endpoint in parallel mode.

##The impact Since you are using the cloud, and i can't test the production environment, impact is theoretical in this case - it can be a problem, or it not. On my localhost instance executing of 1000 parallel GET requests to the http://localhost:1337/v0/me endpoint on behalf of authenticated user was lead to the complete instance inaccessibility. It is a light enough request, and executing of 1000 PUT requests (for example, saving site settings) will have greater impact.

n.PNG
n.PNG From the original on HackerOne

Each request cause execution of the PostgreSQL command, which can lead to the high resource usage.

l.PNG
l.PNG From the original on HackerOne

##Reproduction steps

  1. Login to the Federalist instance (unauthenticated requests is possible too, but it have too low impact)
  2. Look to the request to the /v0/me endpoint. Using Burp Intruder or Charles, repeat the request 1000 times in parallel mode. The server will accept and try to execute all of them in the same time. You can notice increased server resource consumption.
  3. You can repeat the test with more heavily site settings saving request.

##Suggested fix You can consider to implement rate-limiting on the API endpoints (for example, executing not more than 5 API requests in same time from the single user), or implement queue (accept requests from single user in сonsistent mode instead parallel), or use module like https://www.npmjs.com/package/express-rate-limit.

If your production environment somehow mitigates this issue (e.g. has load balancers in place, etc), let me know - i'll close the ticket.

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

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

The API had no rate limiting and processed unlimited parallel requests, each triggering a database command that consumed server resources.

Impact

An authenticated user could make the server unresponsive by sending many parallel requests, though the researcher notes the impact on production is theoretical because load balancers or other mitigations may exist.

What the attacker needed

Login to the instance; ability to send parallel requests

The fix

The issue was fixed by adding rate limiting using the express-rate-limit package.

How it was found

  1. Log in to the Federalist instance.
  2. Capture a request to the /v0/me endpoint.
  3. Repeat the request 1000 times in parallel using a tool such as Burp Intruder or Charles.
  4. Observe increased server resource consumption and the instance becoming inaccessible.
  5. Optionally repeat with a heavier site settings saving request.

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 rate limit caps how many requests a server accepts from one user in a short time. Without it, someone can flood the server with many parallel requests, using up resources until it stops responding. This report shows 1000 simultaneous requests made a local copy unreachable.

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 sp1d3rs

View all

62 more disclosed reports, best first.

More from GSA Bounty

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.