$1,024 for making Discourse choke on one really long draft
The drafts endpoint accepted oversized content without the length validation applied to published posts, and the server saved the draft even after returning a 502 error. An authenticated attacker could send several large drafts to degrade response times for all users on the instance.
Published on pawanjswal.medium.com
Bug Bounty
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.
Context
Discourse is forum software, and the target here is the hosted instance at try.discourse.org. The feature in question is drafts. Whenever a user starts typing a reply or a new topic, the client periodically autosaves the in-progress text to /drafts.json, so that a browser crash or a closed tab does not lose the work. The endpoint is designed for small, frequent writes.
Discourse does validate the length of a real forum post before it is published. Drafts do not pass through that same gate. That asymmetry is the whole story: a payload large enough to be rejected instantly as a published message is accepted as a draft.

Setup
The preconditions are minimal. The researcher needed only a regular account on try.discourse.org, with no special privileges. The tooling was Burp Suite, used to intercept a normal draft request and modify it before it reached the server. The payload was a large text file, roughly 800,000 characters, linked from the original report.
Finding it
The observation is that the draft endpoint accepts content far beyond anything a post would allow. The client sends a POST /drafts.json call on autosave, and nothing in that path enforces the size constraints applied to published posts. Sending a very large body produces a server error, but the draft is stored regardless. The client sees a failure; the backend has already done the expensive work and kept the result.

Exploitation
Step 1: log in
Log in with any regular account on try.discourse.org. No special role or privilege is required.
Step 2: intercept a draft request
With Burp Suite open, catch a normal autosave call. The request the report works with is:
POST /drafts.json
This is the endpoint the client uses for periodic autosave of an in-progress reply or topic.
Step 3: swap in a giant payload
Replace the draft content with the large text file from the report, roughly 800,000 characters. The body is sent as-is to the same endpoint.
Step 4: send it
The server responds with 502 Bad Gateway. On its own, that looks like the request failed.
Step 5: check anyway
Pull up the drafts list, or issue a GET against the endpoint. The oversized draft is there, saved. The 502 did not mean the write was discarded.
Step 6: escalate with nine unique drafts
A single draft proves the save-despite-502 behaviour. To show it is not a one-off, the report creates nine separate large drafts. Discourse returns an "already editing" error if the same draft key is reused, so the payloads carry slight variations, unique sequence numbers, to create nine distinct large drafts without tripping that guard.
After the ninth draft, response times on the same account reached up to 32.108 seconds. That is the resource-exhaustion signal: the server is visibly struggling under the accumulated load.
Step 7: prove it affects other users
The step that mattered most for severity was reproducing the impact on a second device, a separate account and a separate network. The researcher supplied a side-by-side video: one device sending the payloads, while a completely unrelated account on a different connection watched its own page loads crawl to 32+ seconds or time out entirely.

Root cause
The draft path does not apply the size constraints that the post path applies. Published posts are length-checked before they go live; drafts bypass that validation entirely because they arrive through a different endpoint. The expensive backend work of processing and storing the oversized content happens before, or regardless of, the error returned to the client, which is why a 502 and a saved draft coexist.
The duplicate guard is also not a rate limit. It rejects reuse of the same draft key with an "already editing" error, but unique sequence numbers in the payload sidestep it, so it functions as a naming collision check rather than an abuse control. Because the affected resource, backend request processing, is shared, unrelated endpoints and unrelated users suffer the same slowdown as the account running the attack.
Impact
This is an availability bug, not a data-leak bug: nothing here exposes credentials or private content. The impact is entirely about uptime, and it is serious:
- A single authenticated account, with no special role, can degrade response times instance-wide.
- The 502-but-saved behaviour means a naive client-side error message hides what is actually happening.
- Nine sequential requests were enough to cause 32+ second delays. The technique does not cap out there; the report notes it is straightforward to script across multiple accounts or IPs for a bigger effect.
- Because backend request processing is shared, unrelated endpoints and unrelated users are affected, not just the attacking account.
The report frames this as full compromise of availability. The program specifically asked for reproduction on a second, unrelated session, and the report notes this is what got the severity bumped to High.
Fix
Discourse shipped a commit that closes the gap directly: drafts are now checked against the same kind of size constraints that already applied to published posts. That removes the loophole whereby oversized content bypassed validation by travelling through the draft path instead of the post path. The report does not rank alternative remediation options; the commit is the fix.
Variants to test
- Autosave siblings of validated endpoints. For any endpoint with input limits, find the draft or autosave counterpart and send the same oversized body. A positive result is the draft being stored despite an error response.
- Verify server state after errors. After any 5xx on a write endpoint, re-read the resource. A positive result is the object existing even though the client was told the request failed.
- Probe duplicate guards for rate limiting. Send many requests with unique keys or sequence numbers. A positive result is that the guard rejects only identical keys and never throttles volume.
- Measure cross-session impact. Reproduce the load from one account while a second, unrelated account on a different network loads pages. A positive result is elevated latency or timeouts for the unrelated session.
- Script across accounts and IPs. Scale the same payload across multiple identities. A positive result is a larger, sustained degradation than a single account achieves.
Timeline
The report records over two months from submission to a validated severity call, and about four months in total to a shipped fix. That is not fast, but it is not unusual for infrastructure-level availability bugs that need a real backend change rather than a quick input filter.
What happened, in plain words
Imagine a forum website, the kind where people post messages and reply to each other. This one is called Discourse, and the specific site involved is a public test instance at try.discourse.org, which anyone can sign up to and play with. The researcher who found this bug had an ordinary account there, the same kind you or I would get by clicking "sign up".
While you type a reply or start a new topic, the website quietly saves your half-finished text every few seconds. That feature is called a draft, and it exists so that if your browser crashes or you close the tab by accident, your work is not lost. The saving happens automatically, in the background, without you pressing anything.
The bug is simple to describe: the website checks how long a real, published forum post is allowed to be, but it does not apply the same check to drafts. So the researcher pasted roughly 800,000 characters (about the length of a short novel) into a draft and sent it. The server replied with an error, a 502 Bad Gateway, which looks like the request failed. But the draft was saved anyway. Doing that nine times slowed the forum noticeably, including for an unrelated account on a different network.
No passwords were stolen. No private messages were read. The damage was purely to availability: the site became slow and some page loads timed out. That is still a serious bug, and the report was rated High severity once the researcher proved that strangers were affected too.

The pieces you need to know first
Before walking through the steps, here are the basic ideas, explained from scratch.
A server and a client. Your browser is the client: it asks for things. The server is the computer somewhere else that holds the website and answers those requests. When you load a page, your browser sends a request and the server sends back the page.
An API endpoint. Think of a restaurant. The menu lists dishes you can order, and the kitchen knows what to do with each one. An endpoint is like one line on that menu: a specific address the client can send a request to, and the server knows exactly what that request means. In this report the endpoint is /drafts.json. The .json part just means the server replies in a structured text format called JSON, which is easy for programs to read.
HTTP methods. Every request has a method, a verb that says what you want to do. GET means "give me something" (like reading a page). POST means "here is some data, please store or process it" (like submitting a form). The draft autosave uses POST, because it is sending your text to be saved.
A cookie or session. When you log in, the server gives your browser a small piece of data, a session cookie, which it sends back with every later request. That is how the server knows it is still you and not a stranger. Without it, the server would treat every request as anonymous.
Burp Suite. A tool that sits between your browser and the server, like a postal worker who opens every letter, lets you read it, change it, and then sends it on. Security researchers use it to see exactly what the browser is sending and to modify requests before they reach the server. You do not need it to understand this bug, but it is how the researcher changed the draft content.
A 502 Bad Gateway. A standard HTTP status code. Status codes are three-digit numbers the server uses to describe the outcome. 200 means "fine". 404 means "not found". 502 means a gateway or proxy in front of the application could not get a valid response from the application behind it. In plain terms: something in the chain broke, and the client is told the request failed.
A denial of service (DoS). A class of attack where the goal is not to steal data but to make a service unusable, by giving it more work than it can handle. Think of standing in a shop doorway and refusing to move: nothing is stolen, but nobody else can get in. This report is a DoS bug.
Resource exhaustion. The server has a limited amount of processing power and memory. If one request makes it do a huge amount of work, other requests have to wait. When many such requests pile up, everything slows down.
Rate limiting. A rule that says "you may only do this N times per minute". It protects servers from being flooded. The draft endpoint did not apply the length check that published posts go through.
A duplicate guard. A check that stops you from having two drafts with the same identifier at once. It is not the same thing as a rate limit, and this report shows why the difference matters.
What the drafts feature does
Discourse is forum software: it powers discussion sites. The feature in question is drafts. Whenever a user starts typing a reply or a new topic, the client periodically autosaves the in-progress text to /drafts.json, so that a browser crash or a closed tab does not lose the work. The endpoint is designed for small, frequent writes.
Discourse does validate the length of a real forum post before it is published. Drafts do not pass through that same gate. That asymmetry is the whole story: a payload large enough to be rejected instantly as a published message is accepted as a draft.

Setting up
The preconditions are minimal. The researcher needed only a regular account on try.discourse.org, with no special privileges. The tooling was Burp Suite, used to intercept a normal draft request and modify it before it reached the server. The payload was a large text file, roughly 800,000 characters, linked from the original report.
Why so little? Because the bug is not about tricking the login system or guessing a password. It is about what the server does with the content of a request once you are already allowed in. Any account will do.
Finding it
The observation is that the draft endpoint accepts content far beyond anything a post would allow. The client sends a POST /drafts.json call on autosave, and nothing in that path enforces the size constraints applied to published posts. Sending a very large body produces a server error, but the draft is stored regardless. The client sees a failure; the backend has already done the expensive work and kept the result.
That last sentence is the heart of it. The error message and the actual outcome disagree. A user watching the browser would think nothing happened. The server, meanwhile, has stored the giant draft.
Walking through the attack
Step 1: log in
Log in with any regular account on try.discourse.org. No special role or privilege is required.
A normal account is enough; there is no need for an administrator or moderator role.
Step 2: intercept a draft request
With Burp Suite open, catch a normal autosave call. The request the report works with is:
POST /drafts.json
Line by line:
POSTis the method. It tells the server "I am sending data for you to store"./drafts.jsonis the path, the address of the drafts endpoint on the server.
Why intercept a normal one first? Because you want to see exactly what the browser sends when it autosaves: which endpoint, which headers, which cookie, what the body looks like. Once you have a genuine request in front of you, you can change one thing at a time and see what the server does. Starting from a real request avoids guessing.
Step 3: swap in a giant payload
Replace the draft content with the large text file from the report, roughly 800,000 characters. The body is sent as-is to the same endpoint.
Why: the body is the part of the request that carries your draft text. The researcher replaced a normal sentence with an enormous block of text, keeping everything else (the endpoint, the login cookie) the same. That isolates the variable: if something breaks, it is because of the size of the body, not because of a different address or a missing login.
Step 4: send it
The server responds with 502 Bad Gateway. On its own, that looks like the request failed.
Why this matters: most people would stop here. An error means it did not work, right? That assumption is exactly what the next step tests.
Step 5: check anyway
Pull up the drafts list, or issue a GET against the endpoint. The oversized draft is there, saved. The 502 did not mean the write was discarded.
Why: an error response tells you what the client was told, not what the server did. The server may have finished the expensive part (processing and storing the content) and only then failed to send a clean reply. Checking the drafts list is the only way to know the real state. This is a general lesson: after an error on a write request, always verify what actually got written.
Step 6: escalate with nine unique drafts
A single draft proves the save-despite-502 behaviour. To show it is not a one-off, the report creates nine separate large drafts. Discourse returns an "already editing" error if the same draft key is reused, so the payloads carry slight variations, unique sequence numbers, to create nine distinct large drafts without tripping that guard.
After the ninth draft, response times on the same account reached up to 32.108 seconds. That is the resource-exhaustion signal: the server is visibly struggling under the accumulated load.
Why unique sequence numbers? A draft key is a label that identifies which draft you are editing. If you send the same key twice, the server thinks you are trying to edit the same draft from two places and refuses with "already editing". By changing the key slightly each time (adding a sequence number), the researcher made each draft look like a different one, so the guard never fired. The guard was checking for name collisions, not counting how much work you were asking for.
The response time climbing to 32.108 seconds is the measurable evidence that the server is running out of capacity.
Step 7: prove it affects other users
The step that mattered most for severity was reproducing the impact on a second device, a separate account and a separate network. The researcher supplied a side-by-side video: one device sending the payloads, while a completely unrelated account on a different connection watched its own page loads crawl to 32+ seconds or time out entirely.
Why this step is decisive: "my own account is slow" is a minor bug. "A stranger on a different network is slow because of what I did" is a site-wide outage. The video makes the comparison visible: one side sending, the other side suffering.

Why it happens
The draft path does not apply the size constraints that the post path applies. Published posts are length-checked before they go live; drafts bypass that validation entirely because they arrive through a different endpoint. The expensive backend work of processing and storing the oversized content happens before, or regardless of, the error returned to the client, which is why a 502 and a saved draft coexist.
The duplicate guard is also not a rate limit. It rejects reuse of the same draft key with an "already editing" error, but unique sequence numbers in the payload sidestep it, so it functions as a naming collision check rather than an abuse control. Because the affected resource, backend request processing, is shared, unrelated endpoints and unrelated users suffer the same slowdown as the account running the attack.
A useful comparison: a nightclub with a bouncer who checks your name against a list. He stops the same person entering twice under the same name, but he does not count how many people are inside. Change your name slightly each time and you walk straight past him, and the club fills up until nobody can move.
What the impact was
This is an availability bug, not a data-leak bug: nothing here exposes credentials or private content. The impact is entirely about uptime, and it is serious:
- A single authenticated account, with no special role, can degrade response times instance-wide.
- The 502-but-saved behaviour means a naive client-side error message hides what is actually happening.
- Nine sequential requests were enough to cause 32+ second delays. The technique does not cap out there; the report notes it is straightforward to script across multiple accounts or IPs for a bigger effect.
- Because backend request processing is shared, unrelated endpoints and unrelated users are affected, not just the attacking account.
The report frames this as full compromise of availability. The program specifically asked for reproduction on a second, unrelated session, and the report notes this is what got the severity bumped to High.
The fix
Discourse shipped a commit that closes the gap directly: drafts are now checked against the same kind of size constraints that already applied to published posts. That removes the loophole whereby oversized content bypassed validation by travelling through the draft path instead of the post path. The report does not rank alternative remediation options; the commit is the fix.
In plain terms: the side door now has the same size check as the front door.
Things worth testing on other sites
These are the general lessons the report draws out, phrased for someone starting out.
- Autosave siblings of validated endpoints. For any endpoint with input limits, find the draft or autosave counterpart and send the same oversized body. A positive result is the draft being stored despite an error response. The idea: whenever a site checks something on one door, look for the side door that skips the check.
- Verify server state after errors. After any 5xx on a write endpoint, re-read the resource. A positive result is the object existing even though the client was told the request failed. The idea: an error message is a claim, not a fact.
- Probe duplicate guards for rate limiting. Send many requests with unique keys or sequence numbers. A positive result is that the guard rejects only identical keys and never throttles volume. The idea: find out whether a guard is counting names or counting work.
- Measure cross-session impact. Reproduce the load from one account while a second, unrelated account on a different network loads pages. A positive result is elevated latency or timeouts for the unrelated session. The idea: prove the effect escapes your own account.
- Script across accounts and IPs. Scale the same payload across multiple identities. A positive result is a larger, sustained degradation than a single account achieves. The idea: show the ceiling is higher than one person.
Timeline
The report records over two months from submission to a validated severity call, and about four months in total to a shipped fix. That is not fast, but it is not unusual for infrastructure-level availability bugs that need a real backend change rather than a quick input filter.
Glossary
- API: a defined set of addresses and rules a program uses to talk to a server, like a menu of things you are allowed to ask for.
- Endpoint: one specific address in an API, such as
/drafts.json, that accepts a particular kind of request. - Client: the program making requests, usually your browser.
- Server: the remote computer that stores the site and answers requests.
- HTTP method: the verb on a request.
GETasks for something;POSTsends data to be stored or processed. - Request body: the part of a request that carries the data, such as the text of a draft.
- JSON: a structured text format for data, easy for programs to read.
- Cookie / session: a small piece of data your browser stores after login and sends with later requests, so the server knows who you are.
- Burp Suite: a tool that sits between browser and server, letting you inspect and modify requests.
- Status code: a three-digit number in a response describing the outcome, such as
200(fine),404(not found) or502(gateway error). - 502 Bad Gateway: a status code meaning a proxy or gateway could not get a valid response from the application behind it.
- Draft: an unsaved, in-progress piece of text that the site stores automatically so you do not lose it.
- Autosave: the periodic background saving of your in-progress text.
- Draft key: a label identifying which draft is being edited, used to tell drafts apart.
- Duplicate guard: a check that refuses a second draft with the same key, returning an "already editing" error.
- Rate limit: a rule capping how many requests you may make in a period of time.
- Payload: the content you send in a request, in this case the oversized draft text.
- Denial of service (DoS): an attack that makes a service unusable rather than stealing data.
- Resource exhaustion: running a server out of processing power or memory by making it do too much work.
- Availability: whether a service is up and responsive; the property this bug attacked.
- Severity: how serious a bug is judged to be, often Low, Medium, High or Critical.
- Commit: a recorded change to a codebase, in this case the fix Discourse shipped.
- Validation: checking that input meets rules, such as a maximum length, before accepting it.