Skip to content
IDOR Disclosed report Beginner

Deleting all DMs on RedditGifts.com

A DELETE request to the messages API lacked a permission check, so any logged-in user could delete another user's private message by changing the message ID, and all 4.4M messages were deletable.

hakercic Follow

Originally disclosed on HackerOne

Bounty$5,000 High View original
  • Triaged in 35 hours
  • Fixed in 43 hours
  • Paid in 43 hours
  • Disclosed after 5 months

Summary:

It's possible to delete all 4.4M private messages on RedditGifts.com due to missing permission check on DELETE request

Steps To Reproduce:

  1. Set up 3 accounts on RedditGifts.com (FriendA, FriendB, Attacker)
  2. Have FriendA send message to FriendB
  3. As Attacker send the following request (with cookies):
DELETE /api/v1/messages/4423007/ HTTP/1.1
Host: www.redditgifts.com
X-CSRFTOKEN: rYxQcijrs6viZxyLZt2os9gNvLgmEeXfSrH5wOe10GcOg3ABOvL3ebDbAXmeXojj
Referer: https://www.redditgifts.com/api/
Cookie: csrftoken=rYxQcijrs6viZxyLZt2os9gNvLgmEeXfSrH5wOe10GcOg3ABOvL3ebDbAXmeXojj; sessionid=osymp6sp6bb83gyt8of7qbeurtuo2450

Change cookies/csrf token and 4423007 to your own message ID

Supporting Material/References:

recording-1622426911152.webm From the original on HackerOne
Screenshot_3.png
Screenshot_3.png

Impact

It's possible to delete all 4.4M private messages on RedditGifts.com

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What the report shows

The target is RedditGifts.com, the gift-exchange site operated under the Reddit program, and the feature is the private messaging API. The researcher reports that a DELETE request to a message endpoint does not check whether the caller owns the message, so any authenticated user can delete any other user's private message by referencing its identifier.

The summary states the scale plainly: it is possible to delete all 4.4M private messages on the site because of a missing permission check on the DELETE request. The weakness is classified as an insecure direct object reference, the severity is high, and the report was disclosed on 21 October 2021 with a bounty of 5,000 USD.

The reproduction steps are short:

  1. Set up three accounts on RedditGifts.com: FriendA, FriendB and Attacker.
  2. Have FriendA send a message to FriendB.
  3. As Attacker, send the following request, carrying the attacker's own cookies:
HTTP
DELETE /api/v1/messages/4423007/ HTTP/1.1
Host: www.redditgifts.com
X-CSRFTOKEN: [redacted]
Referer: https://www.redditgifts.com/api/
Cookie: csrftoken=[redacted]; sessionid=[redacted]

The report then instructs the reader to change the cookies and CSRF token to their own and to replace 4423007 with their own message ID. In other words, the attacker authenticates normally, then points the request at a message that belongs to someone else. The message ID is the only thing that selects the target object, and the server acts on it without confirming that the session's user is the owner.

The supporting material is a screen recording and a screenshot.

recording-1622426911152.webm From the original on HackerOne
Screenshot_3.png
Screenshot_3.png

Root cause

The report points to a missing permission check on the DELETE handler for the message resource. The endpoint identifies the object to delete purely by the numeric ID in the path, and the server appears to authorise the request only on the basis that the caller is logged in and supplied a valid CSRF token. Authentication is enforced, but object-level authorisation is not: the handler likely loads the message by ID and deletes it without comparing the message's owner to the session user. The CSRF token protects against cross-site request forgery, not against a logged-in attacker acting deliberately.

Impact

The report's own framing is that all 4.4M private messages on RedditGifts.com could be deleted. The consequence is integrity loss and permanent data destruction of private communications, not disclosure: the request deletes rather than reads. The report does not describe any confidentiality impact, and it does not state whether a fix was deployed or how.

How this kind of bug works

Object-level authorisation failures arise when an application separates two questions that must both be answered: who are you (authentication) and may you act on this specific record (authorisation). Frameworks make the first easy, through sessions, tokens or middleware, and it is tempting to treat a valid session as sufficient. The second requires the handler to bind the requested object to the caller, usually by scoping the database query to the session user or by an explicit ownership check before the action.

Direct object references make the gap easy to exploit. When identifiers are predictable, such as auto-incrementing integers, an attacker does not need to discover another user's ID: they can enumerate. The bug class covers read, update and delete operations alike, and the destructive variants are the most serious because the effect cannot be undone by the victim.

Defences are structural rather than cosmetic. Every handler that acts on a record should resolve the record through a query constrained by the authenticated principal, so that a record belonging to another user simply does not exist from the caller's perspective. Where records are shared or role-based, an explicit policy check belongs in the handler or a central authorisation layer. Unguessable identifiers reduce the ease of enumeration but are not a substitute for the check, since identifiers leak through logs, exports, referrers and shared links.

How to test for it

A practical method for this class:

  1. Map the object-bearing endpoints. Look for paths and parameters that carry identifiers: numeric path segments, query parameters, JSON body fields, and hidden form fields. Cover read, edit and delete actions, and note which HTTP methods each accepts.
  2. Create two accounts, a victim and an attacker, and generate at least one object of each interesting type under the victim (a message, an order, a document, a profile setting). Record its identifier.
  3. Authenticate as the attacker and replay the victim's action against the victim's identifier, changing only the identifier and keeping the attacker's own session and anti-CSRF tokens. Send the request with a tool that lets you edit the raw request, so headers and body stay under your control.
  4. Compare the response with the same request made as the victim. A positive result is a success status and a real state change: the object is returned, modified or deleted, confirmed by re-reading it as the victim. Error text that leaks the object's existence is a weaker but still useful signal.
  5. Test identifier manipulation beyond simple substitution: decrement and increment numeric IDs, try IDs from a neighbouring tenant, and check whether the server trusts an owner or user field supplied in the body over the session.

Common false positives: the endpoint returns a generic success page while doing nothing; the object is genuinely public or shared with the attacker's account; the application enforces the check only on the UI and the API is a separate, correctly scoped service; or the response is a redirect to a login or error page that a naive script reads as success. Always confirm the state change out of band, and never run destructive enumeration against production data: prove the issue with one or two objects you control.

How it is fixed

Scope every query that loads or mutates an object to the authenticated user, so ownership is part of the lookup rather than a separate afterthought. Add an explicit authorisation check before destructive actions, returning a not-found or forbidden response without revealing whether the object exists. Apply the same policy consistently across all methods on the resource, including bulk operations. Where identifiers must remain guessable, add rate limiting and audit logging of failed ownership checks so enumeration is visible. Regression tests should include a second user attempting each action on the first user's objects.

Hunting notes

This bug class hides wherever an identifier appears in a request and the handler is written per-resource rather than through a shared scoped accessor. API versions are a strong signal: a newer API may enforce ownership while an older one still accepts raw IDs, so enumerate version prefixes and compare behaviour. Mobile and internal APIs, export and bulk-delete endpoints, and anything with a numeric path segment are worth attention. Recon signals include sequential IDs in URLs, GraphQL nodes addressed by global ID, and endpoints that accept both an ID and a user field.

To make a report land, demonstrate a concrete state change with two accounts you control, show the before and after from the victim's side, and quantify the blast radius only as far as you can evidence it, for example by showing that IDs are sequential. Keep the proof minimal and non-destructive, and state clearly what an attacker gains: unauthorised deletion, modification or disclosure of another user's data.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

RedditGifts.com was a gift-exchange site run under Reddit's bug bounty program. Like most community sites, it let people send each other private messages. Those messages were stored on the site's servers, and each one had its own number, called an ID, so the site could tell them apart.

The researcher found that the part of the site responsible for deleting a message did not check who the message belonged to. If you were logged in, you could ask the site to delete a message by its number, and the site would do it, even if the message belonged to somebody else. The report's summary puts the scale at all 4.4 million private messages on the site.

The weakness is classified as an insecure direct object reference, the severity is high, and the report was disclosed on 21 October 2021 with a bounty of 5,000 USD.

The reproduction steps

The report gives three steps:

  1. Set up three accounts on RedditGifts.com: FriendA, FriendB and Attacker.
  2. Have FriendA send a message to FriendB.
  3. As Attacker, send the following request, carrying the attacker's own cookies:
HTTP
DELETE /api/v1/messages/4423007/ HTTP/1.1
Host: www.redditgifts.com
X-CSRFTOKEN: [redacted]
Referer: https://www.redditgifts.com/api/
Cookie: csrftoken=[redacted]; sessionid=[redacted]

The report then says to change the cookies and CSRF token to your own and to replace 4423007 with your own message ID.

Line by line, the request means the following:

  • DELETE /api/v1/messages/4423007/ HTTP/1.1 is the instruction. DELETE is the HTTP method that asks a server to remove something. The path points at the site's programming interface (the API, a set of URLs meant for software rather than for a browser page) and names one message by its number, 4423007. The HTTP/1.1 is simply the version of the web protocol being spoken.
  • Host: www.redditgifts.com tells the server which site the request is for. One server can host many sites, so this line picks out the right one.
  • X-CSRFTOKEN: ... is an anti-CSRF token. CSRF, cross-site request forgery, is an attack where a malicious page makes your browser send a request to another site while you are logged in there. To prevent it, the site gives your browser a secret value and expects it back in a custom header on state-changing requests. A page on another site cannot read that value, so it cannot forge the request. Here the token is the attacker's own, which is exactly the point: the attacker is a legitimate logged-in user, not a forger.
  • Referer: https://www.redditgifts.com/api/ says which page the request came from. Some servers check it as an extra signal.
  • Cookie: csrftoken=...; sessionid=... carries the browser's cookies. A cookie is a small piece of data a site stores in your browser and gets back on every request. The sessionid cookie is the important one: it is the site's proof that the request comes from a particular logged-in account. The csrftoken cookie is the matching value for the header above.

The key detail is that the attacker's own valid session is used throughout. The only thing that changes is the number in the path. The server looks up the message with that number and deletes it, without asking whether the logged-in user owns it.

The supporting material is a screen recording and a screenshot.

recording-1622426911152.webm From the original on HackerOne
Screenshot_3.png
Screenshot_3.png

Why it worked

The report attributes the bug to a missing permission check on the DELETE handler for messages. The endpoint identifies what to delete purely by the number in the path, and the server seems to accept the request on the basis that the caller is logged in and supplied a valid CSRF token. Being logged in is authentication: the site knows who you are. Being allowed to touch a particular record is authorisation: the site decides whether you may. Here the first was enforced and the second was not. The CSRF token protects against a forged request from another site; it does nothing against a logged-in user acting deliberately.

What the impact is

The report's own framing is that all 4.4 million private messages on RedditGifts.com could be deleted. The harm is destruction of private communications, not disclosure: the request deletes rather than reads. The report does not describe any confidentiality impact, and it does not say whether or how a fix was deployed.

In general, how this kind of bug works

Applications have to answer two separate questions: who are you, and may you act on this specific record. Frameworks make the first easy, through sessions and tokens, and it is tempting to treat a valid session as enough. The second requires the code handling the request to tie the requested record to the caller, usually by looking the record up only among the caller's own records, or by an explicit ownership check before acting.

Predictable identifiers make the gap easy to exploit. When IDs are auto-incrementing integers, an attacker does not need to discover someone else's ID: they can simply count. The bug class covers reading, changing and deleting alike, and the destructive variants are the worst because the victim cannot undo them.

Defences are structural. Every handler that acts on a record should fetch that record through a query limited to the logged-in user, so another user's record simply does not exist from the caller's point of view. Where records are shared or role-based, an explicit policy check belongs in the handler or a central authorisation layer. Hard-to-guess identifiers make counting harder but are no substitute for the check, since identifiers leak through logs, exports, referrer headers and shared links.

In general, how to test for it

  1. Map the endpoints that carry identifiers: numeric path segments, query parameters, body fields and hidden form fields. Cover read, edit and delete actions, and note which HTTP methods each accepts.
  2. Create two accounts, a victim and an attacker, and generate at least one object of each interesting type under the victim, such as a message, an order or a document. Record its identifier.
  3. Authenticate as the attacker and replay the victim's action against the victim's identifier, changing only the identifier and keeping the attacker's own session and anti-CSRF tokens. Use a tool that lets you edit the raw request, so headers and body stay under your control.
  4. Compare the response with the same request made as the victim. A positive result is a success status and a real state change, confirmed by re-reading the object as the victim. Error text that reveals the object exists is a weaker but still useful signal.
  5. Go beyond simple substitution: decrement and increment numeric IDs, try IDs from a neighbouring tenant, and check whether the server trusts an owner field supplied in the body over the session.

Common false positives: the endpoint returns a generic success page while doing nothing; the object is genuinely public or shared with the attacker's account; the check exists in the user interface but the API is a separate service; or the response is a redirect to a login page that a naive script reads as success. Always confirm the state change out of band, and never run destructive enumeration against production data: prove the issue with one or two objects you control.

In general, how it is fixed

Scope every query that loads or changes an object to the logged-in user, so ownership is part of the lookup rather than an afterthought. Add an explicit authorisation check before destructive actions, returning a not-found or forbidden response without revealing whether the object exists. Apply the same policy across all methods on the resource, including bulk operations. Where identifiers must remain guessable, add rate limiting and audit logging of failed ownership checks so enumeration is visible. Regression tests should include a second user attempting each action on the first user's objects.

Glossary

  • API: a set of URLs meant for software to talk to a site, rather than for a person clicking pages.
  • Authentication: proving who you are, for example by logging in.
  • Authorisation: deciding whether you are allowed to do a particular thing.
  • Bug bounty: a program that pays researchers for reporting security flaws.
  • Cookie: a small piece of data a site stores in your browser and receives back on each request.
  • CSRF (cross-site request forgery): an attack where a malicious page makes your logged-in browser send a request to another site.
  • CSRF token: a secret value the site expects back on state-changing requests, which another site cannot read.
  • DELETE: the HTTP method that asks a server to remove something.
  • Endpoint: one specific URL on a server that performs an action.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • ID / identifier: a value, often a number, that names one particular record.
  • IDOR (insecure direct object reference): a bug where a request names a record directly and the server does not check that the caller may access it.
  • Referer: a request header saying which page the request came from.
  • Request header: extra information sent alongside a request, such as cookies and tokens.
  • Session: the server's record of your logged-in state, usually tied to a session ID cookie.
  • Severity: a rating of how serious a vulnerability is.

More from Reddit

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.