Skip to content
IDOR Write-up Beginner

Critical IDOR Vulnerability on Medium?

The author believed that draft stories on Medium could be accessed by changing the draft ID in the URL, allowing one user to view another user's private drafts. However, Medium responded that this was a feature, not a bug, and the author did not test it due to bug bounty rules.

zer0d Follow

Published on infosecwriteups.com

Hope you are very well. I will tell you a little lunch adventure story of me, hope it will inspire you.

zer0dac, on infosecwriteups.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. 6 min read.

Context

Medium is a publishing platform where users write and store stories. A story that has not been published yet lives as a draft, and each draft is reachable through an editor URL that contains the draft's identifier. The researcher's target here was the Medium web application at medium.com, and the feature under scrutiny was the draft editor and the redirect that resolves a draft id to its author's profile path.

The author's starting point was a list published on Medium, linked as humans.txt, which prompted the idea of spending a lunch break probing Medium's systems. Seeing that list prompted the idea of spending a lunch break probing Medium's systems.

From the original on infosecwriteups.com

Setup

Two test accounts were used, referred to as account A and account B. Both belonged to the researcher, which matters because Medium's bug bounty rules forbid accessing another user's account or data and require cross-account testing to be done with your own test accounts. The tools were a browser and an intercepting proxy, plus the intention (never carried out) of writing a small Python script. No versions are given.

The researcher first observed that almost everything on Medium carries a unique id and that many requests are made over GraphQL. Creating an account was the deliberate next step, on the reasoning that having an authenticated session is the best way to look for Insecure Direct Object Reference (IDOR) issues.

From the original on infosecwriteups.com

Finding it

The reasoning was straightforward: account A should not be able to read account B's drafts, because a draft belongs to its author. Draft stories are addressed by an id of the form:

Text
ac274abe6d0

When you open your own drafts, Medium sends you to an editor URL of this shape:

HTTP
https://medium.com/p/ac274abe6d0/edit?source=your_stories_page-------------------------------------

The id is therefore visible in the URL, and the researcher noted that it consists of only 12 digits, which in principle makes it enumerable by bruteforce. A second observation followed: visiting the short form of a story URL, such as https://medium.com/p/94aa1588d3d, automatically redirects to a path that includes the author's nickname:

HTTP
https://medium.com/{{@targetnickname}}/94aa1588d3d

That redirect, the researcher reasoned, would let an attacker map an id to the user it belongs to. The write-up qualifies this with "At least i thought so", which is the first hint that the conclusion did not survive contact with the vendor.

From the original on infosecwriteups.com

Exploitation

The proof of concept is a cross-account test between the researcher's own two accounts.

Step 1: open drafts from test account B

The first screenshot shows the draft list of account B, establishing that B owns a draft with a known id.

From the original on infosecwriteups.com

Step 2: open drafts from test account A

The same view is then taken while authenticated as account A.

From the original on infosecwriteups.com

Step 3: intercept the request from test account A

With the proxy in place, the request made by account A is captured.

From the original on infosecwriteups.com

Step 4: swap in the other draft id

The URL is changed to carry account B's draft id, with no other edit to the request. The aim is to see whether A can reach B's draft.

From the original on infosecwriteups.com

Following the link redirects to a path containing the nickname, as described above.

Step 5: follow the link

Following the redirect, the whole draft is displayed.

From the original on infosecwriteups.com

Step 6: view it in the browser

Loaded in a normal browser, the page shows the complete draft.

From the original on infosecwriteups.com

At this point the researcher believed a real access control flaw had been found, and sketched the follow-on attack: a small Python script that would download many people's drafts together with their nicknames, without permission. The stated worst cases were a user who keeps sensitive material such as credit card details in drafts, and a user whose unpublished blog posts could be taken and reused. That script was never run, because Medium's programme rules prohibit accessing another user's data and require cross-account testing to stay within your own test accounts. The researcher states that the rules were checked before testing and that only accounts belonging to the researcher were used.

Root cause

The report does not describe the server-side implementation, so the mechanism can only be inferred. After the vendor's reply the researcher concluded the behaviour was a feature rather than a bug, and noted that there is no rate limit, which could not be tested because of the programme rule.: the id space is small enough (12 digits) that enumeration would be the realistic attack, and the researcher could not test enumeration because doing so would have meant touching other users' data, which the programme rules forbid. The vendor treated the behaviour as a feature, not a bug, and the brute force over the id space was left untested. The report does not say what access control check, if any, exists on the editor endpoint.

Impact

As demonstrated, the impact is limited to what the researcher could show with two accounts they controlled: one account's draft being rendered when the other account's session requested it by id. The researcher's own framing of the wider risk, mass download of drafts with author nicknames, theft of secrets kept in drafts, and theft of unpublished posts, was explicitly not verified. The vendor's response, as reported, was that this was a feature, not a bug.

From the original on infosecwriteups.com

Fix

The researcher's own takeaway is that the finding was incomplete rather than that a patch was issued, and no remediation is described.

Variants to test

  1. Enumerate the id space on a similar editor endpoint. If ids are short and numeric or hex, request a range of ids from a single account and record which return content versus a redirect or error. A positive result is any id that renders another user's content rather than a permission error.
  2. Check the redirect for author disclosure. Request the short story URL form and see whether the redirect leaks the owner's nickname for objects the current session should not know about. A positive result is a redirect that resolves an id to an author you have no relationship with.
  3. Test the same object across methods. If a GET is refused, try the same id with the editor, preview, publish or API variants of the path. A positive result is any method that returns the object body.
  4. Look for the same pattern in GraphQL. Since the researcher noted heavy GraphQL use, query for a draft by id under a different account and inspect whether the response is filtered by ownership. A positive result is a draft node returned to a session that does not own it.
  5. Check rate limiting before concluding. If enumeration is the only realistic path, confirm whether the endpoint throttles repeated id requests. A positive result is a large number of id lookups completing without throttling, which turns a design quirk into a practical exposure.
From the original on infosecwriteups.com

The lesson the author draws is that a bug bounty hunt does not always end well: you can miss a point and believe you have found something large. Keep trying the next day.

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

What happened, in plain words

A security researcher who goes by the name zer0d spent a lunch break looking at Medium, the website where people publish articles. Medium is a publishing platform: you write a story, save it, and later publish it. A story that has not been published yet is called a draft. A draft is private in the sense that it belongs to the person writing it, and it is stored on Medium's servers under a short identifier, a kind of label made of letters and numbers.

The researcher wondered whether one person's account could open another person's draft just by knowing that label. To test this safely, they made two accounts, both their own, called account A and account B. They opened a draft in B, then, while logged in as A, intercepted A's request and changed the address to point at B's draft. The draft appeared. It looked like a serious flaw: if you can guess labels, you could read strangers' unpublished writing.

They reported it to Medium's bug bounty programme. A bug bounty programme is a scheme where a company invites outside people to report security problems and sometimes pays them for it. Medium's answer was disappointing: this was a feature, not a bug. The researcher had missed a point, and the report explains what that point was. This article walks through the whole story slowly, explaining each idea as it comes up, so that someone who has never done security testing can follow it.

The starting point: a public list of names

When the researcher was looking through bug bounty services, they came across a list published on Medium itself. The list is a file called humans.txt, which many websites publish at a fixed address. It is a plain text file that names the people who build and run the site, a bit like the credits at the end of a film. It is public on purpose and contains nothing secret.

Seeing that list was the spark: the researcher was at lunch and decided to give Medium a chance. So they started looking at Medium's systems.

From the original on infosecwriteups.com

First observations: ids and GraphQL

The first thing the researcher noticed was that almost everything on Medium has a unique id, and that a lot of the requests the website makes are sent using GraphQL.

Two ideas need unpacking here.

A unique id is a short string of characters that identifies one specific thing, the way a passport number identifies one person. Two drafts never share an id. On Medium, a draft's id looks like this:

Text
ac274abe6d0

That is twelve characters, mixing letters and digits. Because the id is unique, if you know it you can ask the server for exactly that draft, and nothing else.

GraphQL is a way for a web page to ask a server for data. Think of a restaurant. In an ordinary restaurant you order from a fixed menu: you say "number 4" and you get whatever number 4 is. GraphQL is more like a restaurant where you write your own order: you say exactly which ingredients you want and in what quantity, and the kitchen sends back precisely that. It is efficient, and it is very common in modern websites. The researcher simply noted that Medium uses it heavily; that observation matters later, because GraphQL is one of the places where access control mistakes tend to hide.

Next, the researcher created an account. Why? Because to test whether one account can reach another account's private things, you first need to be logged in as somebody. A logged-in session is the state where the server knows who you are, usually because your browser sends back a session cookie, a small piece of data the server gave you when you logged in. Every request your browser makes afterwards carries that cookie, like a wristband at an event that proves you paid to get in. Without a wristband you are just a stranger; with one, the server treats you as a known user and shows you your own private pages.

This is the best way to find Insecure Direct Object Reference(IDOR) vulnerability.

That quoted line introduces the main idea of the whole article, so let us define it properly.

Insecure Direct Object Reference, usually shortened to IDOR, is a class of bug where a website lets you reach an object by its id without properly checking that the object is yours. The word "object" here just means a thing stored on the server: a draft, a photo, an invoice, a message. The word "reference" means the id you put in the address. The bug is that the server trusts the id you supply and forgets to ask "does this person own this thing?". A simple everyday comparison: a hotel where every room key is numbered, and the reception hands you key number 12 for your room, but the door of room 13 also opens with key 12 because nobody wired the lock to check the room number. You did not break anything; you just tried a different number.

From the original on infosecwriteups.com

The idea being tested

The researcher then set out the reasoning in the simplest possible terms. Suppose there are two accounts, A and B. Account A should not be able to read account B's drafts, because a draft belongs to the person who wrote it. Your drafts are yours, in the same way your notebook is yours even if it is lying on a café table.

From the original on infosecwriteups.com

So the question was: if A asks the server for B's draft by its id, does the server say no? Or does it hand the draft over?

How a draft is addressed

To ask that question, you need to know how Medium addresses a draft. The researcher found that when you open your own drafts, Medium sends your browser to an editor address of this shape:

HTTP
https://medium.com/p/ac274abe6d0/edit?source=your_stories_page-------------------------------------

Let us read that address piece by piece.

  • https:// is the secure version of the protocol browsers use to talk to websites. The s stands for secure: the traffic is encrypted, so nobody between you and the server can read it.
  • medium.com is the website's domain, the equivalent of a street address.
  • /p/ac274abe6d0 is a path. The /p/ part means "a post", and ac274abe6d0 is the id of that particular draft. This is the part that matters: the id is sitting right there in the address bar, visible to anyone who looks.
  • /edit says you want the editing view, the page where you can change the text.
  • ?source=your_stories_page------------------------------------- is a query string. Everything after the ? is extra information passed to the server, here telling it where the click came from. It is not secret and does not affect who is allowed to see the draft.

The important consequence is that the id is not hidden. It is in the URL, and URLs get copied, shared, logged and bookmarked. The researcher also noted that the id consists of only 12 characters, which means it could in principle be found by bruteforce.

Bruteforce means trying many possibilities one after another until one works. If a lock has only a thousand combinations, a patient person can try them all. If it has a trillion, nobody can. Twelve characters is a small enough space that a computer could try a very large number of them, which is why the length mattered to the researcher.

A second observation followed. If you visit the short form of a story address, without the /edit part, like this:

HTTP
https://medium.com/p/94aa1588d3d

Medium automatically redirects you to an address that includes the author's nickname:

HTTP
https://medium.com/{{@targetnickname}}/94aa1588d3d

A redirect is when the server answers your request by saying "not here, go there instead", and your browser follows automatically. You have seen this when an old web address sends you to a company's new homepage without you doing anything.

Reading the second address: medium.com/ followed by the author's nickname, followed by the story id. The nickname is the public name a person uses on Medium, the handle that appears on their profile. So the redirect, the researcher reasoned, would let anyone work out which id belongs to which user: ask for the short address, and the server tells you the owner's name in the address it sends you to.

The write-up adds a cautious line: "At least i thought so." That is the first hint that this conclusion did not survive contact with the company.

From the original on infosecwriteups.com

The test, step by step

The proof of concept is a cross-account test: you log in as one account, then try to reach something that belongs to another account. Here both accounts belong to the researcher, which is the safe and permitted way to do it. The proof of concept is presented as screenshots, so let us go through them in order and say what each step is for.

Step 1: open drafts from test account B

The first screenshot shows the draft list of account B. The purpose is simply to establish that B exists, is logged in, and owns a draft whose id the researcher knows. You cannot test whether A can reach B's draft unless you first know exactly which draft you are aiming at.

From the original on infosecwriteups.com

Step 2: open drafts from test account A

The same view is then taken while logged in as account A. This gives the researcher the normal, legitimate request that A's browser makes when A opens A's own drafts. That request is the template: it already contains A's session cookie and the correct shape of the address, so the only thing that will need changing later is the id.

From the original on infosecwriteups.com

Step 3: intercept the request from test account A

With an intercepting proxy in place, the request made by account A is captured. An intercepting proxy is a tool that sits between your browser and the website and lets you pause a request, look at it, change it, and then send it on. Think of a postal worker who is allowed to open your letter, swap a page, and seal it again before delivery. It is the standard way to test what a server does when it receives a request that a normal browser would never send.

From the original on infosecwriteups.com

Step 4: swap in the other draft id

The address is changed to carry account B's draft id, with no other edit to the request. The aim is to see whether A can reach B's draft. This is the heart of the test: everything about the request still says "I am account A", except the id, which now points at something that belongs to B. If the server checks ownership, it should refuse. If it only looks at the id, it will answer.

From the original on infosecwriteups.com

Following the link redirects to a path containing the nickname, as described above.

Step 5: follow the link

Following the redirect, the whole draft is displayed. This is the moment the researcher believed a real access control flaw had been found. Access control is the set of rules a server uses to decide who may do what: which pages you may open, which data you may read, which buttons you may press. A flaw in access control means those rules are missing or too loose.

From the original on infosecwriteups.com

Step 6: view it in the browser

Loaded in a normal browser, the page shows the complete draft. Doing this last step matters because it removes any doubt that the proxy was showing something odd: an ordinary browser, with an ordinary session, renders the other account's draft in full.

From the original on infosecwriteups.com

What the researcher thought could be done next

At this point the researcher sketched the follow-on attack. The plan was a small Python script that would download many people's drafts together with their nicknames, without their permission. Python is a programming language often used for exactly this kind of automation: writing a short program that repeats a request many times, far faster than a person clicking.

The stated worst cases were two. First, a user who keeps sensitive material in drafts, such as credit card details, treating the draft editor like a private notebook; a stranger reading those drafts would learn the card details. Second, a user whose unpublished blog posts could be copied and published by someone else before the real author got the chance.

That script was never run. Medium's programme rules forbid accessing another user's data and require cross-account testing to stay within your own test accounts. The researcher quotes the rule directly:

Rules for You

  • Don’t attempt to gain access to another user’s account or data. Use your own test accounts for cross-account testing.

This is worth pausing on, because it is the ethical core of the story. A bug bounty programme is an invitation to test, but the invitation has conditions. The researcher states that the rules were checked before testing and that only accounts belonging to the researcher were used. That is why the test stopped at two accounts the researcher owned, instead of being run against real users.

The reply, and the missing point

The researcher sent the finding to Medium's bug bounty team and waited for a reply. The result was a disappointment. The reason given, as the researcher reports it, was that one point had been missed: there is no rate limit, and the researcher could not test that because of the rule above. And even then, the behaviour was a feature, not a bug.

Two terms need explaining.

A rate limit is a cap on how many requests you may make in a given period. A website might allow, say, a hundred requests a minute from one person and start refusing after that. Rate limits exist to stop exactly the kind of mass guessing that bruteforce depends on. Without one, a script can try id after id as fast as the network allows; with one, the same script is slowed to a crawl and the attack stops being practical.

"A feature, not a bug" is a phrase you will meet often in this field. It means the behaviour you observed is intentional, part of how the product is designed to work, and the company does not consider it a security problem. Sometimes that is a fair answer and sometimes it is not, but it is always the company's call to make.

Put together, the missing point was this. The researcher had shown that one account's request for another account's draft id returned the draft, which the vendor treated as a feature. But the realistic attack, the one that would turn this into a mass exposure of strangers' writing, was guessing ids in bulk. That requires no rate limit. And testing it would have meant sending requests at other people's drafts, which the programme rules forbid. So the one experiment that could have settled the question was the one experiment the researcher was not allowed to run. The report does not say what access control check, if any, exists on the editor endpoint.

From the original on infosecwriteups.com

What the impact actually was

As demonstrated, the impact is limited to what the researcher could show with two accounts they controlled: one account's draft being rendered when the other account's session requested it by id. The researcher's own framing of the wider risk, mass download of drafts with author nicknames, theft of secrets kept in drafts, and theft of unpublished posts, was explicitly not verified. The company's response, as reported, was that this was a feature, not a bug.

The report does not state that anything was changed. The researcher's own takeaway is that the finding was incomplete rather than that a patch was issued, and no fix is described.

Things worth trying if you meet a similar case

These are the follow-up checks the technical write-up lists. They are written for someone who has just learned the terms above.

  1. Enumerate the id space on a similar editor endpoint. If ids are short and made of digits or hex characters, request a range of ids from a single account and record which ones return content versus a redirect or an error. A positive result is any id that renders another user's content rather than a permission error. "Enumerate" simply means going through possibilities one by one in an orderly way.
  2. Check the redirect for author disclosure. Request the short story address form and see whether the redirect leaks the owner's nickname for objects the current session should not know about. A positive result is a redirect that resolves an id to an author you have no relationship with.
  3. Test the same object across methods. If a GET is refused, try the same id with the editor, preview, publish or API variants of the path. A GET is the ordinary kind of request a browser makes when you open a page; other kinds of request exist for other actions, and a server may guard one and forget another.
  4. Look for the same pattern in GraphQL. Since the researcher noted heavy GraphQL use, query for a draft by id under a different account and inspect whether the response is filtered by ownership. A positive result is a draft returned to a session that does not own it.
  5. Check rate limiting before concluding. If enumeration is the only realistic path, confirm whether the endpoint throttles repeated id requests. A positive result is a large number of id lookups completing without throttling, which turns a design quirk into a practical exposure.
From the original on infosecwriteups.com

The lesson the author draws is that a bug bounty hunt does not always end well: you can miss a point and believe you have found something large. Keep trying the next day.

Glossary

  • Access control: the rules a server uses to decide who may read or change which data.
  • API: a way for one piece of software to ask another for data or actions, without a human clicking through pages.
  • Bruteforce: trying many possible values one after another until one works.
  • Bug bounty programme: a scheme where a company invites outside researchers to report security problems, often for a reward, under agreed rules.
  • Cookie (session cookie): a small piece of data a site stores in your browser after you log in, sent back with each request so the server knows who you are.
  • Cross-account test: testing whether one account can reach another account's data, done with accounts you own.
  • Draft: a story that has been written and saved but not yet published.
  • Enumerate: to go through a set of possible values in order, one by one.
  • Feature, not a bug: a company's answer that the behaviour you observed is intentional design, not a security flaw.
  • GET: the ordinary request a browser makes when you open a page or follow a link.
  • GraphQL: a way for a web page to ask a server for exactly the data it wants, rather than a fixed menu of responses.
  • humans.txt: a public plain text file some websites publish, naming the people behind the site.
  • Id: a short unique string that identifies one specific thing, such as one draft.
  • IDOR (Insecure Direct Object Reference): a bug where a site lets you reach an object by its id without checking that the object belongs to you.
  • Intercepting proxy: a tool that sits between your browser and a website so you can pause, inspect and modify requests before they are sent.
  • Nickname: the public handle a person uses on a site, shown in their profile address.
  • Proof of concept (POC): a demonstration, often with screenshots or a small script, that shows a claimed problem really happens.
  • Python: a programming language commonly used to automate repeated tasks such as sending many requests.
  • Query string: the part of a web address after the ?, carrying extra information to the server.
  • Rate limit: a cap on how many requests may be made in a period, used to stop mass guessing and abuse.
  • Redirect: a server's answer telling the browser to go to a different address instead.
  • Session: the state of being logged in, maintained by the server and recognised through a cookie.
  • URL: the address of a page or resource on the web.
  • Unique id: an id that no other object shares.

More by zer0d

View all

2 more disclosed reports, best first.

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.