Skip to content
DoS Disclosed report Beginner

Unrestricted POST request size on roomlogin endpoint

The `/roomlogin/<user>` endpoint does not limit the size of POST requests, unlike the main login endpoint. An attacker can send a very large password field, causing the server to spend excessive time processing each request, which can be parallelised to cause a denial of service.

lucach Follow

Originally disclosed on HackerOne

Bounty$200 Low View original
  • Triaged in 34 hours
  • Fixed in 2 days
  • Paid in 34 hours
  • Disclosed after 4 days

POST requests to endpoint /roomlogin/<user> are not limited in size. While the main website login endpoint correctly limits the size of request, this endpoint does not. This can be a mean to perform a DOS attack.

Steps To Reproduce:

  1. <user> has a password-protected stream.
  2. Send a large POST request to /roomlogin/<user> (e.g., a really long password).

Expected behaviour

HTTP error 413 is promptly returned.

Actual behaviour

Server reads and processes the whole request, consuming long amounts of time.

POC

This Python snippet can reproduce the issue. A ~10MB request consumes about 30 seconds of server time. I did not proceed further to avoid disrupting the service and because this attack which can be easily parallelized has itself a pretty serious impact.

import requests
url = "https://it.chaturbate.com/roomlogin/█████/"
csrf = "███████"

password_size = 10 * 1000 * 1000
payload = {'password': 'a' * password_size, 'next': '/████/', 'csrfmiddlewaretoken' : csrf}

s = requests.Session()
s.headers.update({'referer': url})
s.cookies.set("csrftoken", csrf)
s.cookies.set("sessionid", "█████████")
r = s.post(url, data=payload)

print r.elapsed
0:00:40.249484

Suggested resolution steps

  • Put a reasonable low limit to request size, as it already happens with main login.
  • (Optional) Limit the max-size of input element #id_password to 64 characters.

Impact

DOS of the main website. The attack can be easily parallelized, leading to potentially severe DDOS.

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

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. 4 min read.

Context

Chaturbate is a live streaming site. A broadcaster can protect their room with a password, and viewers who want to enter a protected room submit that password through a dedicated endpoint, /roomlogin/<user>, where <user> is the room owner. The endpoint accepts a POST request carrying the submitted password together with the usual Django form fields (next and csrfmiddlewaretoken).

The report is about how that endpoint handles the size of the request body. The main website login endpoint, according to the researcher, already limits request size. The room login endpoint does not.

Setup

No special account, role or tooling is needed beyond a normal session against the site. The researcher used Python with the requests library to send the oversized POST. The preconditions for the test are:

  1. A target user <user> who has a password-protected stream.
  2. A valid CSRF token and session cookie for the site, so the request is accepted by the form handling rather than rejected earlier for missing CSRF.

The researcher used the Italian host it.chaturbate.com in the proof of concept.

Finding it

The researcher compared two endpoints that do the same kind of job: the main website login and the per-room login. The main login endpoint limits the size of the request. The room login endpoint does not. That difference is the whole finding: a POST to /roomlogin/<user> is read and processed in full regardless of how large the body is.

Exploitation

Step 1: pick a password-protected room

The target must be a user whose stream is password-protected, so that /roomlogin/<user> is the endpoint that handles entry to the room.

Step 2: send a large POST to the room login endpoint

The researcher's reproduction sends a password field of roughly 10 MB. The snippet is reproduced exactly as published, with the user, CSRF token, next path and session identifier redacted:

Python
import requests
url = "https://it.chaturbate.com/roomlogin/[redacted]/"
csrf = "[redacted]"

password_size = 10 * 1000 * 1000
payload = {'password': 'a' * password_size, 'next': '/[redacted]/', 'csrfmiddlewaretoken' : csrf}

s = requests.Session()
s.headers.update({'referer': url})
s.cookies.set("csrftoken", csrf)
s.cookies.set("sessionid", "[redacted]")
r = s.post(url, data=payload)

print r.elapsed

The important parts:

  • url is the room login endpoint for the chosen user.
  • password_size is 10 million characters, so the password field alone is about 10 MB of form data.
  • next and csrfmiddlewaretoken are the other fields the form expects; the CSRF token is also set as the csrftoken cookie, and the referer header is set to the same URL, matching what a browser would send.
  • The session cookie is set so the request is made as an authenticated session.
  • r.elapsed measures how long the request took from the client side.

The measured result was:

Text
0:00:40.249484

So a single ~10 MB request kept the server busy for roughly 30 to 40 seconds. The researcher describes the request as consuming about 30 seconds of server time, and stopped at this size deliberately, to avoid disrupting the service.

Step 3: what the server does with it

The expected behaviour is that an HTTP 413 is returned promptly. The actual behaviour is that the server reads and processes the whole request, consuming a long amount of time. Nothing in the oversized password is rejected early on size grounds.

Root cause

The room login endpoint has no limit on the size of the POST body, while the main login endpoint does. Because the body is processed in full, the cost to the server scales with the size the client chooses to send.

Impact

The impact is denial of service against the main website. The researcher notes that the attack can be easily parallelised, which turns a single slow request into a potentially severe distributed denial of service. The demonstration was kept at one ~10 MB request per measurement, and the researcher explicitly did not go further in order to avoid disrupting the service.

Fix

The report suggests two resolution steps:

  1. Put a reasonable low limit on request size, as already happens with the main login.
  2. Optionally, limit the maximum size of the input element #id_password to 64 characters.

The report suggests both steps and does not state which change was actually made. The report does not state which change was actually made.

Variants to test

  • A positive result is a large body being read and processed instead of a prompt 413.
  • A positive result is the same slow response on the alternate host.
  • A positive result is a measurable increase in response time that scales with body size.

Hunting notes

During recon, the signal is a pair of endpoints doing the same job where only one is documented or obviously protected; comparing their behaviour with a moderately large body is enough to tell them apart. The researcher showed impact by measuring elapsed time for a single request and by explaining that the attack parallelises easily, while deliberately stopping at ~10 MB to avoid harming the service.

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. 9 min read.

What happened, in plain words

Chaturbate is a live streaming site. A broadcaster can put a password on their room, so that only people who know the password can watch. When a viewer types that password and submits it, the browser sends the password to a specific address on the site: /roomlogin/<user>, where <user> is the name of the room owner. That address is called an endpoint, which is simply a particular URL that a feature of the site listens on.

The researcher noticed that this endpoint does not care how big the message sent to it is. You can send a password that is ten million characters long, and the server will read all of it and work through all of it before deciding anything. The main login page of the site, the one you use to sign in to your account, does have a limit on how big a message it will accept. The room login does not.

Why does that matter? Because a server has a fixed amount of time and processing power. If one request can keep it busy for tens of seconds, then many such requests sent at the same time can keep it busy for a very long time, and other people cannot use the site. That is called a denial of service, or DoS. When the requests come from many places at once, it is called a distributed denial of service, or DDoS. Think of it like a shop with one cashier: one customer with a trolley full of thousands of items blocks the queue for everyone behind them, and a hundred such customers at once close the shop.

The researcher measured the effect with a single request of about 10 MB and saw the server take around 30 to 40 seconds. He deliberately stopped there so as not to actually disrupt the service. The report was rated low severity and a bounty of 200.00 USD was awarded.

The pieces involved

Before the steps, a few words that come up throughout, explained from zero.

  • Endpoint: a specific URL on a website that does a specific job. /roomlogin/<user> is the endpoint that handles the password for one room. <user> is a placeholder for the room owner's name.
  • POST request: when you fill in a form on a web page and press submit, your browser usually sends a POST request. It carries the values you typed in the body of the message, separate from the address. A GET request, by contrast, is what happens when you just click a link or load a page.
  • Request body: the part of the message that carries the data, here the password and a couple of hidden fields. Its size is whatever the sender chooses, unless the server sets a limit.
  • Cookie: a small piece of data that a website asks your browser to store and send back with every request, so the site can recognise you between page loads. The session cookie is what tells the site you are already signed in.
  • CSRF token: a secret value that the site puts into forms and also into a cookie, so that it can check a submitted form really came from its own pages and not from some other site tricking your browser. CSRF stands for cross-site request forgery. The token appears in the form as a field called csrfmiddlewaretoken and in the cookie as csrftoken.
  • Django: the web framework the site is built with. It is the software that receives the request, reads the form fields and passes them to the site's own code. The report mentions Django form fields because the form expects certain names.
  • HTTP 413: a standard status code a server can send back meaning "the thing you sent is too large". The researcher expected this to come back quickly.
  • Uncontrolled resource consumption: the vulnerability class. It means the software lets a user decide how much of some limited resource (here, server processing time) gets used, with no cap.

Setting up the test

No special account or tool is needed beyond a normal signed-in session on the site. The researcher wrote a short Python program using a library called requests, which lets a program send web requests the same way a browser does. Two things had to be true before the test could run:

  1. A target user <user> whose stream is password-protected, so that /roomlogin/<user> is the endpoint that handles entry to that room.
  2. A valid CSRF token and session cookie for the site, so the request is treated as a normal form submission rather than rejected straight away for missing CSRF protection.

The proof of concept used the Italian host it.chaturbate.com.

Finding it

The researcher compared two endpoints that do the same kind of job: the main website login and the per-room login. The main login limits the size of the request. The room login does not. That difference is the whole finding: a POST to /roomlogin/<user> is read and processed in full, no matter how large the body is.

Reproducing it

Step 1: pick a password-protected room

The target must be a user whose stream is password-protected, so that /roomlogin/<user> is the endpoint that handles entry to the room. Without a protected room there is nothing for this endpoint to do, and the test would not exercise the same code path.

Step 2: send a large POST to the room login endpoint

The researcher's reproduction sends a password field of roughly 10 MB. The snippet is reproduced exactly as published, with the user, CSRF token, next path and session identifier redacted:

Python
import requests
url = "https://it.chaturbate.com/roomlogin/[redacted]/"
csrf = "[redacted]"

password_size = 10 * 1000 * 1000
payload = {'password': 'a' * password_size, 'next': '/[redacted]/', 'csrfmiddlewaretoken' : csrf}

s = requests.Session()
s.headers.update({'referer': url})
s.cookies.set("csrftoken", csrf)
s.cookies.set("sessionid", "[redacted]")
r = s.post(url, data=payload)

print r.elapsed

Line by line, in plain words:

  • import requests loads the library that can send web requests from Python.
  • url = "https://it.chaturbate.com/roomlogin/[redacted]/" is the address of the room login endpoint for the chosen user. The user's name is redacted here.
  • csrf = "[redacted]" holds the CSRF token, the secret value the site expects in the form. It is redacted.
  • password_size = 10 * 1000 * 1000 sets the password length to ten million characters, which is about 10 MB of text.
  • payload = {'password': 'a' * password_size, 'next': '/[redacted]/', 'csrfmiddlewaretoken' : csrf} builds the form data. The password field is ten million letter as. next is where the site should send the viewer after a successful login, and csrfmiddlewaretoken carries the token. These are the fields the form expects.
  • s = requests.Session() creates a session object, which keeps cookies and settings together across requests, like a browser tab does.
  • s.headers.update({'referer': url}) sets the referer header to the same URL. Browsers send this header to say which page the request came from, so this makes the request look like a normal form submission.
  • s.cookies.set("csrftoken", csrf) puts the CSRF token into the cookie jar under the name the site uses for it.
  • s.cookies.set("sessionid", "[redacted]") sets the session cookie, so the request is made as a signed-in session. The value is redacted.
  • r = s.post(url, data=payload) sends the POST request to the endpoint with the form data as the body. This is the moment the oversized password goes to the server.
  • print r.elapsed prints how long the request took from the client side, which is the measurement the researcher used.

The measured result was:

Text
0:00:40.249484

So a single ~10 MB request kept the server busy for roughly 30 to 40 seconds. The researcher describes the request as consuming about 30 seconds of server time, and stopped at this size deliberately, to avoid disrupting the service.

Step 3: what the server does with it

The expected behaviour is that an HTTP 413 is returned promptly, meaning the server notices the message is too large and refuses it straight away. The actual behaviour is that the server reads and processes the whole request, consuming a long amount of time. Nothing in the oversized password is rejected early on size grounds.

Why it happens

The room login endpoint has no limit on the size of the POST body, while the main login endpoint does. Because the body is processed in full, the cost to the server grows with whatever size the client chooses to send.

Impact

The impact is denial of service against the main website. The researcher notes that the attack can be easily parallelised, meaning many copies of the same request can be sent at the same time, which turns a single slow request into a potentially severe distributed denial of service. The demonstration was kept at one ~10 MB request per measurement, and the researcher explicitly did not go further in order to avoid disrupting the service.

The fix

The report suggests two resolution steps:

  1. Put a reasonable low limit on request size, as already happens with the main login.
  2. Optionally, limit the maximum size of the input element #id_password to 64 characters.

The report suggests both steps and does not state which change was actually made. The report does not state which change was actually made.

Other places to look

  • A positive result is a large body being read and processed instead of a prompt 413.
  • A positive result is the same slow response on the alternate host.
  • A positive result is a measurable increase in response time that grows with body size.

How to hunt for this kind of bug

During recon, the signal is a pair of endpoints doing the same job where only one is documented or obviously protected; comparing their behaviour with a moderately large body is enough to tell them apart. The researcher showed impact by measuring elapsed time for a single request and by explaining that the attack parallelises easily, while deliberately stopping at ~10 MB to avoid harming the service.

Glossary

  • Endpoint: a specific URL on a website that performs a specific job.
  • POST request: a web request that carries data in its body, typically sent when a form is submitted.
  • Request body: the part of a request that carries the data, such as form fields.
  • Cookie: a small piece of data a site asks the browser to store and send back with later requests, used to recognise the user.
  • Session cookie: the cookie that identifies a signed-in session.
  • CSRF token: a secret value placed in forms and cookies so the site can verify a submission came from its own pages.
  • CSRF (cross-site request forgery): an attack where another site tricks a user's browser into submitting a request to a site the user is signed in to.
  • Django: the web framework the site is built with, which receives requests and reads form fields.
  • HTTP 413: a standard status code meaning the request is too large.
  • Denial of service (DoS): making a service unavailable to its normal users, for example by keeping it busy.
  • Distributed denial of service (DDoS): a denial of service carried out with many requests at once, often from many sources.
  • Parallelise: to run many copies of the same action at the same time.
  • Uncontrolled resource consumption: a vulnerability where a user can decide how much of a limited resource, such as server processing time, is used, with no cap.
  • requests: a Python library for sending web requests from a program.
  • referer header: a header a browser sends to say which page a request came from.
  • next field: a form field telling the site where to send the user after a successful login.
  • #id_password: the identifier of the password input element in the page's HTML.
  • Recon: the information-gathering phase of security testing, where you map out what a site exposes.

More from Chaturbate

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.