Privilege Escalation using Api endpoint
A normal user account could create webhooks even though the UI only showed that option to admins, because the server did not check the permission when the webhook endpoint was called. An attacker with a basic account could therefore set up a webhook and receive candidate report notifications they should not have been able to subscribe to.
Published on medium.com
#### Ronak Patel
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
This is a bug found on a private program, to which the researcher was invited a few months before writing. The program's name is not disclosed, so the write-up uses example.com as a stand-in. The application provides an employee background check service. With the normal user permission level, a user can create candidates, read reports and manage reports, and that is about the extent of the basic functionality.
The application used AngularJS as its client-side JavaScript framework. That detail matters for the rest of the story: the routing, the permission names and the API endpoints were all readable from the JavaScript files served to the browser.
Setup
On invitation, the program assigned test accounts to researchers. Those test accounts had normal user level permissions. The researcher worked with such an account and used Burp as an intercepting proxy, configured to intercept all responses. No other tooling or version information is given in the report.
Finding it
With only the basic access, the researcher could not find anything. Because the application was built on AngularJS, the next step was to open the developer console and read the application's JavaScript file to learn more about routing, permissions and the endpoints available.
Reading that code revealed a functionality to create webhooks, used to receive candidate reports and other notifications.

The screenshot shows the create webhook endpoint as it appears in the application code.
The next question was which permission is required to create webhooks. According to the code, it is manage_dev_settings, which by default is assigned only to admin users.
The screenshot shows the manage_dev_settings permission reference in the code.
At this point the researcher reasoned that, since the check appeared to be client side, editing the response that carries the user permissions could grant UI level access to the developer settings.
Exploitation
Step 1: Inspect the permissions response
The researcher logged in again and set Burp to intercept all responses. The response to the HTTP request to api.example.com/user contains the user permissions.
The screenshot shows the response with the user permission values, with the relevant field highlighted.
Step 2: Flip the permission in the response
In that response, manage_dev_settings was switched from false to true, and the modified response was forwarded. The normal user test account then had UI level access to the developer settings.
Step 3: Create the webhook through the UI
With the developer settings visible, the researcher navigated to the create webhook functionality and created a webhook pointing at a requestbin link. Creating a new candidate generated a POST request to the endpoint api.example.com/v1/webhooks.
There was no permission validation at server level, and the webhook was created successfully. A new candidate was created immediately afterwards, and the webhook log arrived on the requestbin link.

The screenshot shows the webhook log received on the requestbin link.
That is how a normal user permission account was able to create a webhook and receive notifications, by escalating privileges.
A note on the path taken
The researcher addresses the obvious objection: the UI step could have been skipped by firing a request directly at the webhook API endpoint found in the JavaScript file. That was possible, but the goal was to learn as much about the application as possible, so UI level access was obtained first and the endpoint was verified afterwards.
Root cause
The permission check for manage_dev_settings was enforced in the client, on the permissions returned by api.example.com/user. Because the browser trusts that response, editing it in the proxy revealed the developer settings UI. The server side, however, did not validate the permission when the webhook was created: the POST to api.example.com/v1/webhooks succeeded for an account that did not hold manage_dev_settings. The UI gate and the API authorisation were therefore out of step.
Impact
A user with normal user level permissions could create webhooks and receive candidate reports and other notifications that the manage_dev_settings permission is meant to restrict to admins. The report does not describe any further use of the webhook, such as exfiltration of data beyond the notifications themselves, and does not state what data the notifications contained.
Fix
The report does not say what the program changed. The fix implied by the finding is to enforce the manage_dev_settings permission on the server for the webhook creation endpoint, rather than relying on the client-side permission value, so that a modified api.example.com/user response cannot grant the capability.
Variants to test
- Read the client-side JavaScript for permission names and endpoint paths, then check whether each privileged endpoint enforces the same permission server side. A positive result is a request from a low-privileged account that succeeds where the UI would have hidden the feature.
- Intercept the response that carries the user's permissions and flip privileged flags from
falsetotrue. A positive result is privileged UI appearing for a normal account, which then points at the endpoints worth testing directly. - Call privileged endpoints directly, bypassing the UI entirely, once their paths are known from the JavaScript. A positive result is a successful create, read or update that the account's role should not allow.
- Test notification and webhook features specifically, since they push data outward. A positive result is a webhook registered by a low-privileged account that then receives events it should not see.
What happened, in plain words
A security researcher was invited to test a private bug bounty program, which is a company's offer to pay people for finding security problems in its systems before criminals do. The program did not allow him to name the company, so throughout his write-up he calls it example.com. The product was an employee background check service: a website where a company can register job candidates and read reports about them.
When you join such a program, the company gives you a test account. This one had "normal user" permissions, meaning the lowest level of access: you can create a candidate, read reports and manage reports, and not much else. The researcher poked around with that account and found nothing.
Then he noticed something useful. The website was built with AngularJS, a tool for making interactive web pages. With AngularJS, a lot of the application's logic, including the list of features and the names of the permissions needed to use them, is shipped to the browser as readable JavaScript files. So he opened the browser's developer console and read that code. In it he found a feature for creating webhooks, which are automatic notifications sent from one system to another when something happens, and he found that creating one required a permission called manage_dev_settings, normally given only to administrators.
His idea was simple: if the website decides what buttons to show you based on a permission value that arrives from the server, and he could change that value on its way into the browser, the admin-only screens might appear. He used Burp, a tool that sits between the browser and the website and lets you pause and edit the traffic, to intercept the response from api.example.com/user, which lists the user's permissions. He changed manage_dev_settings from false to true and let the response continue. The developer settings appeared in his normal account.
He then used that screen to create a webhook pointing at a requestbin link, a free service that gives you a URL which records every request sent to it, so you can see what arrives. Creating a new candidate caused the application to send a request to api.example.com/v1/webhooks. The server accepted it even though his account did not really have the permission. A new candidate was created and the notification arrived at his requestbin link.
He submitted the bug. It was initially triaged, but a month later he was told it was a duplicate, so he was not paid. He closes by saying the learning was the reward.
The pieces you need to know first
Before walking through the steps, here are the ideas the story depends on, explained from scratch.
- A web application is a program that runs in your browser but keeps its data and its rules on a server, a computer somewhere else that answers requests. Your browser asks, the server answers.
- An API (Application Programming Interface) is the set of addresses and rules a program uses to talk to a server. Think of a restaurant: the menu is the API, the kitchen is the server, and you can only order what is on the menu. In this story the API lives at
api.example.com, and each feature has its own address, called an endpoint, such asapi.example.com/userorapi.example.com/v1/webhooks. - A request and a response: your browser sends a request ("give me my profile") and the server sends back a response (the data, plus a status code saying whether it worked). A POST request is a request that sends data to the server to create or change something, as opposed to a GET request which just asks for something.
- Permissions are the rules about what an account is allowed to do. A normal user can do some things; an administrator can do more. Each capability is often named, like
manage_dev_settingshere. - Client side and server side: the client is your browser; the server is the machine holding the data. Code that runs in your browser is client-side code, and you, the user, control your browser completely. Code on the server is out of your reach. A rule enforced only on the client is like a nightclub that checks your wristband at the door but never again inside: anyone who can change their wristband gets in.
- AngularJS is a JavaScript framework, a toolkit for building web pages. Applications built with it often send the browser a file describing the routes (which page corresponds to which address) and the permissions. Anyone can read that file.
- The developer console is a panel built into every browser (usually opened with F12) where you can see the page's code, the network traffic and error messages.
- A proxy is a program that sits between your browser and the internet and can pause, inspect and modify traffic in both directions. Burp is a well-known proxy used for security testing. Setting it to intercept responses means every answer from the server waits for you to look at it before the browser sees it.
- A webhook is a reverse notification. Instead of you asking a service "has anything happened?", you give the service a URL and it sends a message to that URL whenever something happens. Here, the application would send candidate reports and other notifications to a URL of your choosing.
- Requestbin is a service that gives you a URL and shows you every request that arrives at it, which makes it a convenient place to receive webhook messages while testing.
- Privilege escalation is the vulnerability class in the title: using an account with low permissions to do something that should require higher permissions. It is like a hotel guest finding that the door to the staff room opens with their own key.
Setting up
On invitation, the program assigned test accounts to researchers, and those accounts had normal user level permissions. The researcher worked with one of them. His only tool, as described, was Burp configured as an intercepting proxy for all responses. The report gives no version numbers and no other tooling.
Finding the hidden feature
With only the basic access, nothing turned up. The turning point was noticing AngularJS. Because the application's routing, permission names and endpoints were all readable in the JavaScript files served to the browser, the researcher opened the developer console and read the application's JavaScript file to learn more about routing, permissions and the endpoints available.
Reading that code revealed a functionality to create webhooks, used to receive candidate reports and other notifications.

The screenshot shows the create webhook endpoint as it appears in the application code.
The next question was which permission is required to create webhooks. According to the code, it is manage_dev_settings, which by default is assigned only to admin users.
The screenshot shows the manage_dev_settings permission reference in the code.
At this point the researcher reasoned that, since the check appeared to be client side, editing the response that carries the user permissions could grant UI level access to the developer settings. "UI level access" means the screens and buttons appear in the browser; it says nothing yet about whether the server will actually accept the actions.
Exploitation
Step 1: Inspect the permissions response
The researcher logged in again and set Burp to intercept all responses. The response to the HTTP request to api.example.com/user contains the user permissions.
The screenshot shows the response with the user permission values, with the relevant field highlighted.
Why this step: he needed to see the exact response that tells the browser what the account may do. If the browser builds the menu from that response, that response is the thing to change.
Step 2: Flip the permission in the response
In that response, manage_dev_settings was switched from false to true, and the modified response was forwarded. The normal user test account then had UI level access to the developer settings.
Why this step: the browser has no way to know the value was edited. It simply believes what the server's response says, so the developer settings screens appeared. This is the client-side half of the problem: the gate was in the browser, and the browser belongs to the user.
Step 3: Create the webhook through the UI
With the developer settings visible, the researcher navigated to the create webhook functionality and created a webhook pointing at a requestbin link. Creating a new candidate generated a POST request to the endpoint api.example.com/v1/webhooks.
There was no permission validation at server level, and the webhook was created successfully. A new candidate was created immediately afterwards, and the webhook log arrived on the requestbin link.

The screenshot shows the webhook log received on the requestbin link.
Why this step matters: this is where the real flaw shows itself. Showing a screen is one thing; the server accepting the action is another. The server should have checked whether the account really held manage_dev_settings before creating the webhook. It did not, so a normal user account ended up with a webhook receiving notifications meant for administrators.
That is how a normal user permission account was able to create a webhook and receive notifications, by escalating privileges.
A note on the path taken
The researcher addresses the obvious objection: the UI step could have been skipped by firing a request directly at the webhook API endpoint found in the JavaScript file. That was possible, but the goal was to learn as much about the application as possible, so UI level access was obtained first and the endpoint was verified afterwards. In other words, the UI trick was a way to explore; the direct request would have been the shortcut.
Root cause
The permission check for manage_dev_settings was enforced in the client, on the permissions returned by api.example.com/user. Because the browser trusts that response, editing it in the proxy revealed the developer settings UI. The server side, however, did not validate the permission when the webhook was created: the POST to api.example.com/v1/webhooks succeeded for an account that did not hold manage_dev_settings. The UI gate and the API authorisation were therefore out of step.
In everyday terms: the bouncer checked the wristband at the door, but the bar staff never looked at it again.
Impact
A user with normal user level permissions could create webhooks and receive candidate reports and other notifications that the manage_dev_settings permission is meant to restrict to admins. The report does not describe any further use of the webhook, such as exfiltration of data beyond the notifications themselves, and does not state what data the notifications contained.
Fix
The report does not say what the program changed. The fix implied by the finding is to enforce the manage_dev_settings permission on the server for the webhook creation endpoint, rather than relying on the client-side permission value, so that a modified api.example.com/user response cannot grant the capability.
Variants to test
If you want to look for similar issues yourself, these are the same ideas generalised. Each one is a way of asking the same question: does the server check, or does it trust the browser?
- Read the client-side JavaScript for permission names and endpoint paths, then check whether each privileged endpoint enforces the same permission server side. A positive result is a request from a low-privileged account that succeeds where the UI would have hidden the feature.
- Intercept the response that carries the user's permissions and flip privileged flags from
falsetotrue. A positive result is privileged UI appearing for a normal account, which then points at the endpoints worth testing directly. - Call privileged endpoints directly, bypassing the UI entirely, once their paths are known from the JavaScript. A positive result is a successful create, read or update that the account's role should not allow.
- Test notification and webhook features specifically, since they push data outward. A positive result is a webhook registered by a low-privileged account that then receives events it should not see.
Glossary
- API: the set of addresses and rules a program uses to talk to a server, like a menu you can order from.
- AngularJS: a JavaScript framework for building interactive web pages, which often ships routing and permission information to the browser in readable files.
- Bug bounty program: a company's offer to reward people for reporting security problems in its systems.
- Burp: a proxy tool used in security testing that can pause, inspect and modify traffic between browser and server.
- Candidate: in this product, a person whose background is being checked; creating one is a basic action in the application.
- Client side: code that runs in your browser, which you control.
- Developer console: a panel in the browser (usually F12) showing the page's code, network traffic and errors.
- Endpoint: a specific address on a server that performs one function, such as
api.example.com/user. - Exfiltration: secretly moving data out of a system.
- GET request: a request that only asks the server for something.
- Intercepting proxy: a tool that sits between browser and internet and lets you pause and edit traffic in both directions.
- JavaScript: the programming language browsers run to make pages interactive.
- Normal user level permissions: the lowest level of access, allowing only basic actions.
- POST request: a request that sends data to the server to create or change something.
- Privilege escalation: using a low-permission account to do something that should require higher permissions.
- Proxy: a program that relays traffic between two parties and can inspect or alter it.
- Request: a message your browser sends to a server asking for something or asking it to do something.
- Requestbin: a service that gives you a URL and records every request sent to it, useful for receiving webhook messages.
- Response: the server's answer to a request, containing data and a status code.
- Root cause: the underlying reason a vulnerability exists, as opposed to its symptoms.
- Server side: code and checks that run on the server, out of the user's reach.
- Triage: the process of reviewing a submitted bug report and deciding whether it is a real, valid issue.
- UI (user interface): the screens, buttons and menus you see and click in the browser.
- UI level access: the privileged screens appearing in the browser, without any guarantee that the server will accept the actions.
- Vulnerability class: a category of security flaw, such as privilege escalation.
- Webhook: an automatic notification a service sends to a URL you provide when an event happens.
manage_dev_settings: the permission name that, according to the application code, is required to create webhooks and is by default assigned only to admins.