Skip to content
IDOR Disclosed report Intermediate

IDOR in API applications (able to see any API token, leads to account takeover)

An API application update endpoint accepted an application ID from the request without checking ownership, so an attacker could change the ID to another user's application and, by omitting other fields, cause the server to return that application's page containing its client ID and secret. With those credentials the attacker could perform API actions on the victim's account, leading to account takeover.

bugra Follow

Originally disclosed on HackerOne

Critical View original
  • Triaged in 3 hours
  • Fixed in 4 days
  • Paid in 4 days
  • Disclosed after 54 days

Summary:

Hi,

@ehtis, thank you for the test account. Here is a critical report. :) On Pressable, we can create API applications at https://my.pressable.com/api/applications, and we can access many things using the API token via following the API docs

I created an API application and tried to update it, I saw this request :

████████

As you can see there is an application[id] parameter that contains the application ID. I changed it to my second account's application ID and that API app moved to my account. So, there is an IDOR but it doesn't have a great impact because it just removes the API application from the victim's account.

So I tried to escalate its impact and I noticed if we remove all parameters except application[id] and authenticity_token, then send the request, the endpoint gives an error with Name must be provided and prints the given application ID's page. And, that page contains Client ID and Client Secret!

With this information, the attacker can make many actions on the victim's account. (https://my.pressable.com/documentation/api/v1)

Steps To Reproduce:

  1. Go to https://my.pressable.com/api/applications and create an API app
  2. Click on the application and turn on your proxy program
  3. Click Update and you will send a POST request to /api/applications
  4. In this request, change the application%5Bid%5D parameter's value to the target app ID, then remove all parameters except application%5Bid%5D and authenticity_token
  5. The page will give an error and you will see the victim app's page which contains Client ID and Client Secret
  6. Now, you can use these API credentials on the Pressable API.

Notes:

Impact

The attacker can access all API credentials using this vulnerability, and that leads to account takeover (via adding collaborator etc.)

Regards, Bugra

The original report as published on HackerOne, by bugra. 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. 7 min read.

Context

Pressable is a WordPress hosting product, and its customer control panel lives at my.pressable.com. One of the features of that panel is API applications: a customer can create an application at https://my.pressable.com/api/applications and receive a Client ID and Client Secret, which are then used as credentials against the Pressable API described in the documentation at https://my.pressable.com/documentation/api/v1.

Those credentials are not cosmetic. The API exposes a broad set of operations on the account, and the report points specifically at the collaborator endpoint, https://my.pressable.com/documentation/api/v1#collaborator-bulk-create, as one of the things reachable with a token. In other words, an API application is an object that belongs to an account, and its secret is the key to that account's API surface.

The report describes an insecure direct object reference in the endpoint that updates an API application. The identifier of the application is supplied by the client, and the server acts on whatever identifier it is given without checking that the application belongs to the caller.

Setup

Two Pressable accounts were used. The researcher thanks @ehtis for a test account, and refers to a second account whose application ID was used as the target. The precondition is simply that the attacker holds a valid, authenticated session on my.pressable.com and has created at least one API application of their own, so that the update request can be captured and replayed.

A proxy that can intercept and modify requests is needed, because the attack is a modification of a form submission. No special role, plan or privilege is described beyond having an account and an application.

Finding it

The researcher created an API application and then tried to update it. Intercepting the update revealed a request containing an application[id] parameter holding the application's ID.

The request body is redacted in the published report, but the two parameters that matter are named: application[id], the identifier of the application being updated, and authenticity_token, the form's anti-CSRF token.

The first experiment was to replace the value of application[id] with the application ID belonging to the second account. The result was that the other account's API application moved to the attacker's account. That is a genuine IDOR, but on its own the impact is limited: as the researcher puts it, it just removes the API application from the victim's account. Moving an object is not the same as reading its secret.

Exploitation

The escalation came from a second observation about how the endpoint behaves when the request is incomplete. If every parameter is removed except application[id] and authenticity_token, and the request is sent, the endpoint responds with an error saying Name must be provided, and alongside that validation error it renders the page for the application ID that was supplied. That page contains the Client ID and Client Secret.

So the same missing authorisation check that allowed the application to be moved also allows its credentials to be disclosed, because the failure path renders the object rather than rejecting the request outright.

Step 1: Create an application

Go to https://my.pressable.com/api/applications and create an API application. This gives the attacker a legitimate application of their own, and therefore a legitimate update request to work from.

Step 2: Capture the update request

Click on the application, turn on the proxy, and click Update. This sends a POST request to /api/applications.

Step 3: Swap the identifier

In that request, change the value of the application%5Bid%5D parameter to the target application's ID. The URL-encoded name decodes to application[id].

Step 4: Strip the request down

Remove all parameters except application%5Bid%5D and authenticity_token, then send the request. The authenticity_token has to stay because it is the form's CSRF protection; the other fields, including the application name, are dropped deliberately.

Step 5: Read the credentials from the error page

The endpoint returns an error stating Name must be provided, and the response includes the victim application's page, which displays its Client ID and Client Secret.

Step 6: Use the credentials

With those two values the attacker can authenticate to the Pressable API and act on the victim's account, following the operations documented at https://my.pressable.com/documentation/api/v1.

Two properties make this worse than a single-object leak. First, API application IDs are sequential, so the attacker does not have to guess: every application can be walked in order. Second, the credentials obtained are account-level API credentials, so the reach of the attack is the reach of the API itself.

Root cause

The update endpoint takes the application identifier from the request body and loads the corresponding application without verifying that it belongs to the authenticated user. Authorisation is missing on the object lookup, which is the classic IDOR condition.

The disclosure itself comes from the error handling. When validation fails because the name is absent, the endpoint renders the application page for the supplied ID instead of returning a bare validation error. That page includes the Client ID and Client Secret, so a request that should have changed nothing ends up returning the secret. The report does not describe the server-side code, so the exact ordering of the lookup, the validation and the rendering is likely as described here rather than confirmed.

The authenticity_token is present and valid in the exploit, so CSRF protection is not the barrier being bypassed; it only ensures the request is a well-formed authenticated form submission. Nothing in the flow ties the object to the session.

Impact

The attacker can access the API credentials of other applications, because the IDs are sequential and no ownership check stands in the way. Those credentials allow many actions on the victim's account through the API, and the report names the collaborator endpoint, https://my.pressable.com/documentation/api/v1#collaborator-bulk-create, as one of them. Adding a collaborator to the victim's account is the path the researcher gives to account takeover.

The report rates the issue critical on that basis. The precondition is an authenticated Pressable account.

Fix

The report does not state what was changed. The fix that follows from the root cause is to scope the application lookup to the authenticated user, so that an application[id] belonging to another account is treated as not found, and to stop rendering the application page, with its Client ID and Client Secret, on a validation failure. Returning a plain validation error without the object would close the disclosure even if the ownership check were ever missed again.

Variants to test

  1. Identifier swap on update endpoints. Take any form that updates an object you own, change the object ID to one belonging to another account, and submit. A positive result is that the other object is modified, moved or deleted.
  2. Truncated request bodies. Remove every field except the object ID and the CSRF token, then send. A positive result is a validation error whose response still contains the object's data, such as secrets, keys or configuration.
  3. Sequential identifiers. Where IDs are small integers, enumerate them with the same truncated request. A positive result is a stream of distinct objects, each returning its own credentials or details.
  4. Credential-bearing objects. Focus on objects that hold secrets: API applications, integrations, webhooks, tokens and service accounts. A positive result is a Client ID and Client Secret, a token, or a signing key appearing in a response you should not be able to see.
  5. Error paths. Trigger validation failures on purpose, for example by omitting required fields, and inspect the response for rendered object pages rather than bare error messages.

Hunting notes

This bug sits in the customer-facing control panel of a hosting product, in the part of the UI that manages API credentials. That is a high-value area: the objects are few, they are created by the user, they are addressed by simple IDs, and each one carries a secret that unlocks the rest of the account through the API.

During recon, the signals are forms that submit an object identifier in the body, especially when the identifier is a small sequential integer, and endpoints whose validation errors render a full page rather than a short message. Capturing a normal update and then stripping the body down to the identifier and the CSRF token is a cheap test that often reveals what the error path returns.

The researcher showed impact in two stages. The first stage, moving another account's application, was real but weak, and the report says so plainly. The second stage turned the same missing check into credential disclosure, and then connected those credentials to a documented API operation, the collaborator endpoint, that leads to account takeover. That chain, from a low-impact IDOR to a named API capability with a named consequence, is what makes the severity of the report legible to the program.

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

What happened, in plain words

Pressable is a service that hosts WordPress websites. Customers manage their sites through a control panel at my.pressable.com. One feature of that panel lets a customer create an "API application". Think of an API application as a spare key to your account: the panel gives you a Client ID and a Client Secret, and those two values let a program talk to Pressable on your behalf without you typing your password each time.

An API (Application Programming Interface) is a way for one computer program to talk to another. Instead of a human clicking buttons in a browser, a script sends requests to the service and gets answers back. The Pressable API is documented at https://my.pressable.com/documentation/api/v1, and it can do a lot on an account, including adding collaborators (other people who can work on your sites).

The bug in this report is that the page which updates an API application trusts a number the browser sends it. That number is the application's ID. If you change it to someone else's application ID, the server happily works with that other application, without checking whether it belongs to you. Security people call this an Insecure Direct Object Reference, or IDOR: the server takes an object identifier straight from the request and acts on it, with no ownership check.

On its own, the first version of the bug was mild: you could move another person's API application into your account, which just removes it from theirs. But the researcher then found that if you send an incomplete request, the server shows an error and, along with the error, prints the page of whichever application ID you supplied. That page contains the Client ID and Client Secret. So the mild bug became a way to read anyone's API credentials, and those credentials can be used to take over the account.

The pieces you need to know

Before the steps make sense, here are the ideas involved, from zero.

  • Control panel: the website where a customer logs in and manages their product. Here it is my.pressable.com.
  • API application: an object you create in the panel that holds a Client ID and a Client Secret. It is like a username and password pair made for programs rather than people.
  • Client ID and Client Secret: the two values a program presents to prove it is allowed to act for your account. The secret is the sensitive part, like a password.
  • Token / credentials: a general word for a value that proves identity. If someone else gets your token, they can act as you, the same way a copied house key lets a stranger in.
  • IDOR (Insecure Direct Object Reference): when a website lets you name an object by its ID and does not check that the object is yours. If your order is number 100 and you change the number in the request to 101, and the site shows you someone else's order, that is an IDOR.
  • Proxy: a tool that sits between your browser and the website, letting you pause a request, look at it, edit it, and then send it on. It is like opening a letter, changing a word, and sealing it again before delivery.
  • POST request: a way a browser sends data to a server, usually when you submit a form. The data travels in the request body.
  • Parameter: one named field inside that data, for example application[id].
  • URL encoding: some characters cannot appear literally in a request, so they are written in a coded form. %5B means [ and %5D means ], so application%5Bid%5D is the same field as application[id].
  • CSRF token / authenticity_token: a random value the website puts in each form to prove the form really came from its own pages and not from a malicious site. It is a guard against Cross-Site Request Forgery, where another site tricks your browser into submitting a form you did not intend.
  • Sequential IDs: IDs that go 1, 2, 3, 4 and so on. If they are sequential, an attacker does not need to guess; they can simply try every number in order.
  • Account takeover: the end state where an attacker can control someone else's account, for example by adding themselves as a collaborator.

Setting up

The researcher used two Pressable accounts. One was a test account provided by @ehtis, and the second account's application ID was used as the target. To repeat the attack you need:

  1. A normal, logged-in Pressable account.
  2. At least one API application of your own, so you have a real update request to capture and edit.
  3. A proxy tool that can pause and modify requests.

No special role or paid plan is mentioned. An ordinary account with an application is enough.

Finding the bug

The researcher created an API application and then tried to update it. With the proxy on, the update request was captured. It contained an application[id] parameter holding the application's ID.

The published report blanks out the full request, so the exact body is not shown. What matters are two fields it names: application[id], which says which application is being updated, and authenticity_token, the anti-CSRF guard described above.

The first experiment was simple: replace the value of application[id] with the application ID of the second account. The result was that the other account's API application moved into the attacker's account. That is a real IDOR, but the researcher is honest about its size: it only removes the application from the victim's account. Moving an object is not the same as reading its secret.

Turning it into credential theft

The escalation came from a second observation. If you remove every parameter except application[id] and authenticity_token, and send the request, the server answers with an error saying Name must be provided. But alongside that error it renders the page for the application ID you supplied. That page shows the Client ID and Client Secret.

So the same missing ownership check that let an application be moved also lets its credentials be read, because the failure path shows the object instead of just rejecting the request.

Step 1: Create an application

Go to https://my.pressable.com/api/applications and create an API application. This gives you a legitimate application of your own, and therefore a legitimate update request to work from. You cannot study a request you have never made.

Step 2: Capture the update request

Click on the application, turn on your proxy, and click Update. This sends a POST request to /api/applications. The proxy pauses it so you can inspect and edit it.

Step 3: Swap the identifier

In that request, change the value of the application%5Bid%5D parameter to the target application's ID. Remember that application%5Bid%5D is just the URL-encoded spelling of application[id]. This is the IDOR test: you are asking the server to work on an object that is not yours.

Step 4: Strip the request down

Remove all parameters except application%5Bid%5D and authenticity_token, then send the request. The authenticity_token must stay because it is the form's CSRF protection. The other fields, including the application name, are dropped on purpose. The idea is to make the request invalid in a controlled way and see what the server does when it complains.

Step 5: Read the credentials from the error page

The server returns an error stating Name must be provided, and the response includes the victim application's page, which displays its Client ID and Client Secret. The error message is the bait; the leaked page is the catch.

Step 6: Use the credentials

With those two values the attacker can authenticate to the Pressable API and act on the victim's account, following the operations documented at https://my.pressable.com/documentation/api/v1.

Two things make this worse than a single leak. First, API application IDs are sequential, so the attacker does not have to guess: every application can be walked in order, one after another. Second, the credentials are account-level API credentials, so the reach of the attack is the reach of the API itself.

Why it works

The update endpoint takes the application identifier from the request body and loads the matching application without checking that it belongs to the logged-in user. That missing check is the classic IDOR condition.

The disclosure itself comes from the error handling. When validation fails because the name is missing, the endpoint renders the application page for the supplied ID instead of returning a bare validation error. That page includes the Client ID and Client Secret, so a request that should have changed nothing ends up returning the secret. The report does not describe the server-side code, so the exact order of lookup, validation and rendering is a reasonable reading rather than a confirmed one.

The authenticity_token is present and valid in the exploit, so CSRF protection is not what is being bypassed. It only ensures the request is a well-formed, authenticated form submission. Nothing in the flow ties the object to the session.

Impact

The attacker can access the API credentials of other applications, because the IDs are sequential and no ownership check stands in the way. Those credentials allow many actions on the victim's account through the API, and the report names the collaborator endpoint, https://my.pressable.com/documentation/api/v1#collaborator-bulk-create, as one of them. Adding a collaborator to the victim's account is the path the researcher gives to account takeover.

The report rates the issue critical on that basis. The only precondition is an authenticated Pressable account.

How it should be fixed

The report does not state what was changed. The fix that follows from the cause is to scope the application lookup to the logged-in user, so that an application[id] belonging to another account is treated as not found. It should also stop rendering the application page, with its Client ID and Client Secret, on a validation failure. Returning a plain validation error without the object would close the disclosure even if the ownership check were ever missed again.

Similar things to test

  1. Identifier swap on update forms. Take any form that updates an object you own, change the object ID to one belonging to another account, and submit. A positive result is that the other object is modified, moved or deleted.
  2. Truncated request bodies. Remove every field except the object ID and the CSRF token, then send. A positive result is a validation error whose response still contains the object's data, such as secrets, keys or configuration.
  3. Sequential identifiers. Where IDs are small integers, walk through them with the same truncated request. A positive result is a stream of distinct objects, each returning its own credentials or details.
  4. Objects that hold secrets. Focus on objects that carry secrets: API applications, integrations, webhooks, tokens and service accounts. A positive result is a Client ID and Client Secret, a token, or a signing key appearing in a response you should not be able to see.
  5. Error paths. Trigger validation failures on purpose, for example by omitting required fields, and inspect the response for rendered object pages rather than bare error messages.

Where to look when hunting

This bug sits in the customer-facing control panel of a hosting product, in the part of the interface that manages API credentials. That is a high-value area: the objects are few, they are created by the user, they are addressed by simple IDs, and each one carries a secret that unlocks the rest of the account through the API.

During recon, the signals are forms that submit an object identifier in the body, especially when the identifier is a small sequential integer, and endpoints whose validation errors render a full page rather than a short message. Capturing a normal update and then stripping the body down to the identifier and the CSRF token is a cheap test that often reveals what the error path returns.

The researcher showed impact in two stages. The first stage, moving another account's application, was real but weak, and the report says so plainly. The second stage turned the same missing check into credential disclosure, and then connected those credentials to a documented API operation, the collaborator endpoint, that leads to account takeover. That chain, from a low-impact IDOR to a named API capability with a named consequence, is what makes the severity of the report clear to the program.

Glossary

  • API: a way for one program to talk to another over the network, sending requests and receiving answers.
  • API application: an object created in the Pressable panel that holds a Client ID and Client Secret for use with the API.
  • Account takeover: gaining control of someone else's account, for example by adding yourself as a collaborator.
  • Authenticity token: a random value placed in a form to prove the submission came from the site's own pages, guarding against CSRF.
  • Client ID: the public half of an API application's credentials, identifying which application is calling.
  • Client Secret: the private half of an API application's credentials, acting like a password for the application.
  • Collaborator: another person given access to work on an account's sites; the report names the collaborator endpoint as a route to takeover.
  • Credentials: values that prove identity, such as a Client ID and Client Secret.
  • CSRF (Cross-Site Request Forgery): an attack where another site tricks your browser into submitting a form you did not intend; the authenticity_token defends against it.
  • Error path: the code that runs when a request is invalid, which here rendered the application page instead of a plain error.
  • IDOR (Insecure Direct Object Reference): a flaw where a site takes an object ID from the request and acts on it without checking that the object belongs to the caller.
  • Parameter: a named field in a request body, such as application[id].
  • POST request: an HTTP request that carries data to the server, typically from a form submission.
  • Proxy: a tool that intercepts requests between your browser and a site so you can inspect and edit them.
  • Sequential IDs: identifiers that increase by one each time, making them easy to enumerate.
  • Token: a value that proves identity or grants access, like a key.
  • URL encoding: writing special characters in a coded form, for example %5B for [ and %5D for ].
  • Validation error: a message the server returns when required data is missing or wrong, such as Name must be provided.
  • WordPress hosting: a service that runs WordPress websites for customers; Pressable is one such service.

More by bugra

View all

21 more disclosed reports, best first.

More from Automattic

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.