[Twitter Bug Bounty] Misconfigured JSON endpoint on ads.twitter.com lead to Access control issue and Information Disclosure of role privileged users.
Peerzada Fawaz Ahmad Qureshi Follow
Published on web.archive.org
{{media:0}}
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
Twitter Ads lets an account administrator delegate work on an advertising account through role privileges. The management screen lives at a URL of this shape:
https://ads.twitter.com/account_management/18xxxxx/account_users
The report describes four roles:
| Role | Permissions as described in the report |
|---|---|
| Account administrator | Full access to modify campaigns and view data, including ability to add/remove users and change settings. |
| Ad manager | Full access to modify campaigns and view data, but cannot add/remove users or change settings. |
| Campaign analyst | Access to view paid campaign data and pull reports, but no access to modify or create campaigns. |
| Organic analyst | Access to view organic analytics and audience insights, but no access to modify or view campaigns. |
Separately, an "App Manager" area sits under:
https://ads.twitter.com/accounts/18xxxxx/tools/manage_apps
That page discloses the managed app name, conversion tracking data and the deep link scheme. Access to it was restricted from the Organic analyst and Campaign analyst roles, because it does not fall under the permissions granted to either of them.
Setup
The captured request headers show Firefox 59.0 on macOS 10.13. The report does not state which role the researcher was logged in as. No other preconditions are described.
Finding it
Requesting the App Manager URL with the Organic or Campaign analyst role returned a 404:
https://ads.twitter.com/accounts/18xxxxx/tools/manage_apps
That is the expected behaviour: the page is outside those roles' permissions. But a Campaign analyst could still open the campaign creation URL for an app promotion campaign directly:
https://ads.twitter.com/accounts/18xxxx/campaigns/new/app_promotion
That URL should not have been reachable for the role either. Following it through did not let the researcher create a campaign, so the campaign creation flow itself was not the problem. The interesting part was what the page loaded: it listed every managed app and associated data by calling a JSON endpoint with a GET request of this shape:
https://ads.twitter.com/accounts/18xxxx/apps.json?account=18xxxxx&lang=en
So the campaign creation page, reachable by direct URL, loaded the managed app data through the JSON endpoint.
Exploitation
Step 1: reach the campaign creation page as a Campaign analyst
Open the app promotion campaign URL directly while authenticated with the lower-privileged role:
https://ads.twitter.com/accounts/18xxxx/campaigns/new/app_promotion
The page loaded even though the role should not have access to it. Creating a campaign from it still failed, so the page itself was only a way in, not the objective.
Step 2: observe the JSON request the page makes
While the page was open, it issued a GET request to the apps JSON endpoint. The captured request was:
GET /accounts/18xxxxx/apps.json?action=delete&account=18xxxx&lang=en HTTP/1.1
Host: ads.twitter.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:59.0) Gecko/20100101 Firefox/59.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://ads.twitter.com/accounts/18ce54fw885/campaigns/new/app_promotion
X-Requested-With: XMLHttpRequest
RT=xxxxx
DNT: 1
Connection: close
Cookie : xxxxxxxxx
The report notes that other GET request data was removed for clarity. The parts that matter are the path /accounts/18xxxxx/apps.json, the query parameters action=delete, account=18xxxx&lang=en, and the Referer pointing at the app promotion page. The request is a normal authenticated XHR: it carries the session cookie and X-Requested-With: XMLHttpRequest, and asks for JSON.
Step 3: read the response
The server answered with a 200 and a JSON body:
HTTP/1.1 200 OK
connection: close
content-disposition: attachment; filename=json.json
Content-Length: 8410
content-type: application/json;charset=utf-8
date: Tue, 03 Apr 2018 18:43:29 GMT
server: tsa_k
strict-transport-security: max-age=631138519
x-connection-hash: [redacted]
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-response-time: 212
x-transaction: 0032a30100b23d6b
x-xss-protection: 1; mode=block; report=https://twitter.com/i/xss_report
{"groups":[],"apps_info":{"xxxxxx":{"app_store_identifier":"**com.twitter.android**","description":"xxxxxx{"app_store_identifier":"**com.instagram.android**","description"xxxx"\u003Cdiv jsname=\"C4s9Ed\"\u003xxxxxxxxx{"app_store_identifier":**"com.tumblr**","description":xxxxxx"\u003Cdiv jsname=\"C4s9Ed\"\u003ETxxxxx
The body shows a top-level groups array and an apps_info object keyed by app identifiers, each entry carrying an app_store_identifier and a description. In the captured data the researcher saw Twitter, Instagram and Tumblr listed under applications, with identifiers such as com.twitter.android, com.instagram.android and com.tumblr. The description values contain HTML fragments, with < written as \u003C.
So the endpoint returned the full list of managed apps and their associated data to a Campaign analyst, the same data the App Manager page had been withholding from that role.
Root cause
The report frames this as a misconfigured JSON endpoint leading to an access control issue. The App Manager page enforced the role check and returned 404 to Organic and Campaign analysts, but the JSON endpoint that feeds the app promotion page, /accounts/<id>/apps.json, did not apply the same restriction. The campaign creation page was also reachable by direct URL for a Campaign analyst, which gave that role a legitimate-looking page from which to trigger the request. The report does not describe the server-side implementation, so the exact location of the missing check is not stated.
Impact
A user holding only the Campaign analyst role could read the managed app list and associated data that the role was not meant to see. The researcher could not create a campaign through the reachable page, so the impact described is information disclosure and broken access control rather than account takeover or campaign manipulation.
Fix
The fix implied by the finding is to enforce the same role check on the JSON endpoint that the App Manager page already enforced, so that requests from roles without the App Manager permission are rejected regardless of which page issues them, and to apply the same check to the campaign creation page that was reachable by direct URL.
Variants to test
- Page versus API mismatch. Find a page that returns 404 or redirects for a low-privileged role, then look at the XHR calls it would make and request those endpoints directly with the low-privileged session. A positive result is a 200 with the data the page was hiding.
- Direct URL to privileged pages. Request campaign creation or settings URLs by hand with a restricted role, as was done with
/campaigns/new/app_promotion. A positive result is the page rendering instead of a 404, even if the final submit fails. - Query parameter tampering on the JSON endpoint. Change
accountto another account identifier while keeping the low-privileged session, and try theactionparameter values seen in the request. A positive result is data for an account the session does not belong to. - Role matrix sweep. For each role (Account administrator, Ad manager, Campaign analyst, Organic analyst), request the same set of endpoints and record status codes and body sizes. A positive result is any endpoint returning data to a role that the UI says cannot see it.
- Content negotiation. Repeat the request with
Accept: application/jsonand withX-Requested-With: XMLHttpRequestremoved, to see whether the check is tied to the header rather than the session. A positive result is the same data returned under a different request shape.
What happened, in plain words
Twitter runs an advertising service called Twitter Ads. A company or an individual can have an ads account, and the owner of that account can invite other people to help run it. Not everyone gets the same powers: some people can do everything, some can only look at numbers, and so on. These different levels of power are called roles.
The report describes a low-powered role on an ads account, called a Campaign analyst. A Campaign analyst is meant to look at paid campaign data and pull reports, but not to change or create campaigns. The researcher found that a page which should have been off-limits to that role could still be opened by typing its address directly into the browser. That page, in turn, quietly asked the Twitter servers for a list of data, and the servers handed that list over without checking whether the person asking was allowed to see it. The list contained details about the apps connected to the ads account, which the role was not supposed to see.
In security language this is a broken access control problem, also called an access control issue: the system knows who you are (you are logged in), but it fails to check whether you are allowed to do a particular thing. The second half of the problem is information disclosure: data that should have stayed hidden was shown to someone who should not have seen it. The report also calls the endpoint misconfigured, meaning it was set up in a way that left out a check it should have had.
Twitter paid a bounty of 280.00 USD for the report.

The product and the feature
Twitter Ads lets an account administrator hand out work to other people. The screen where this happens is at a web address of this shape:
https://ads.twitter.com/account_management/18xxxxx/account_users
A web address (URL) is just the location of a page, like a street address for a shop. The 18xxxxx part is a placeholder for a number that identifies a particular ads account; the report hides the real number with x's. account_management is the section of the site, and account_users is the page listing the people who have access.
The report describes four roles:
| Role | Permissions as described in the report |
|---|---|
| Account administrator | Full access to modify campaigns and view data, including ability to add/remove users and change settings. |
| Ad manager | Full access to modify campaigns and view data, but cannot add/remove users or change settings. |
| Campaign analyst | Access to view paid campaign data and pull reports, but no access to modify or create campaigns. |
| Organic analyst | Access to view organic analytics and audience insights, but no access to modify or view campaigns. |
Think of it like an office building: the administrator has keys to every room, the ad manager has keys to most rooms but not the one with the staff files, and the two analyst roles have keys only to the rooms where their own reports are kept.
Separately, there is an area called App Manager, at this address:
https://ads.twitter.com/accounts/18xxxxx/tools/manage_apps
This page shows information about the apps connected to the ads account: the managed app name, conversion tracking data and the deep link scheme. In plain terms, an app here is a mobile application (such as a phone app) that the advertiser has linked to their ads account. Conversion tracking is the mechanism that records when someone who saw an ad later did something valuable, like installing the app. A deep link scheme is a custom address format that opens a specific place inside an app, the way a normal web link opens a page in a browser.
Access to App Manager was restricted from the Organic analyst and Campaign analyst roles, because it does not fall under the permissions granted to either of them. In the office comparison, App Manager is the locked room that only the administrator and the ad manager may enter.
Setting up the test
The testing was done with a Campaign analyst role on an ads account. The captured request headers show Firefox 59.0 on macOS 10.13. No other preconditions are described.
Why this matters: to test whether a low-powered role can reach something it should not, you need to actually be logged in as that low-powered role. If you tested as the administrator, everything would work and you would learn nothing.
Finding it
Requesting the App Manager URL with the Organic or Campaign analyst role returned a 404:
https://ads.twitter.com/accounts/18xxxxx/tools/manage_apps
A 404 is the standard web response for "not found". Here it is the server's way of saying "this page does not exist for you". That is the expected behaviour: the page is outside those roles' permissions, so the server pretends it is not there.
But a Campaign analyst could still open the campaign creation URL for an app promotion campaign directly:
https://ads.twitter.com/accounts/18xxxx/campaigns/new/app_promotion
This is a different page: the form used to create a new advertising campaign of the "app promotion" type. That URL should not have been reachable for the role either. Following it through did not let the researcher create a campaign, so the campaign creation flow itself was not the problem. The interesting part was what the page loaded: it listed every managed app and associated data by calling a JSON endpoint with a GET request of this shape:
https://ads.twitter.com/accounts/18xxxx/apps.json?account=18xxxxx&lang=en
Let us unpack that. An endpoint is a specific address on a server that answers a particular kind of request, like a service counter in a large building: you go to the right counter to get the thing you need. JSON is a plain-text format for structured data, made of names and values in curly braces, which programs can read easily. A GET request is the basic way a browser asks a server for something: "please give me this". The part after the ? is the query string, a set of named values sent along with the request; here account names the ads account and lang=en asks for English.
So the campaign creation page, reachable by direct URL, still pulled the managed app data through the JSON endpoint. The lock was on one door, but the same room had a second door with no lock.
Exploitation
Step 1: reach the campaign creation page as a Campaign analyst
Open the app promotion campaign URL directly while authenticated with the lower-privileged role:
https://ads.twitter.com/accounts/18xxxx/campaigns/new/app_promotion
The page loaded even though the role should not have access to it. Creating a campaign from it still failed, so the page itself was only a way in, not the objective.
The App Manager page said 404, but this page did not. That difference is a clue: perhaps the check was placed on some pages and forgotten on others.
Step 2: observe the JSON request the page makes
While the page was open, it issued a GET request to the apps JSON endpoint. The captured request was:
GET /accounts/18xxxxx/apps.json?action=delete&account=18xxxx&lang=en HTTP/1.1
Host: ads.twitter.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:59.0) Gecko/20100101 Firefox/59.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://ads.twitter.com/accounts/18ce54fw885/campaigns/new/app_promotion
X-Requested-With: XMLHttpRequest
RT=xxxxx
DNT: 1
Connection: close
Cookie : xxxxxxxxx
The report notes that other GET request data was removed for clarity.
Line by line, in plain words:
GET /accounts/18xxxxx/apps.json?action=delete&account=18xxxx&lang=en HTTP/1.1is the request itself.GETis the method (asking for data). The path points at the apps JSON endpoint. The query string carries three named values:action=delete,account=18xxxxandlang=en.HTTP/1.1is the version of the web protocol being spoken.Host: ads.twitter.comsays which website the request is for. One server can host many sites, so the request names the one it wants.User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:59.0) Gecko/20100101 Firefox/59.0is the browser introducing itself: Firefox 59.0 on macOS 10.13. Servers often use this to decide what to send back.Accept: application/json, text/javascript, */*; q=0.01tells the server which formats the browser is willing to receive, with JSON first.Accept-Language: en-US,en;q=0.5says the browser prefers US English.Accept-Encoding: gzip, deflatesays the browser can accept compressed responses, which saves bandwidth.Referer: https://ads.twitter.com/accounts/18ce54fw885/campaigns/new/app_promotiontells the server which page the request came from. Here it is the app promotion page from Step 1. This is how the researcher could see that the campaign page was the one making the call.X-Requested-With: XMLHttpRequestis a custom header that browsers add when a page fetches data in the background with JavaScript, rather than the user clicking a link. Such background requests are often called XHR (XMLHttpRequest). It is a hint that this is a programmatic call, not a normal page load.RT=xxxxxis a header whose value is hidden in the report. The report does not say what it is for.DNT: 1is the "Do Not Track" preference, a signal that the user does not want to be tracked.Connection: closeasks the server to close the network connection after answering.Cookie : xxxxxxxxxis the most important line for security. A cookie is a small piece of data the browser stores for a website and sends back with every request. When you log in, the server gives your browser a cookie that acts like a wristband at an event: it proves you already checked in, so you do not have to show your ID at every door. The value is hidden here because anyone holding it could act as that logged-in user.
The parts that matter are the path /accounts/18xxxxx/apps.json, the query parameters action=delete, account=18xxxx&lang=en, and the Referer pointing at the app promotion page. The request is a normal authenticated XHR: it carries the session cookie and X-Requested-With: XMLHttpRequest, and asks for JSON.
Once you know the address of the service counter, you can walk up to it yourself, without going through the page.
Step 3: read the response
The server answered with a 200 and a JSON body:
HTTP/1.1 200 OK
connection: close
content-disposition: attachment; filename=json.json
Content-Length: 8410
content-type: application/json;charset=utf-8
date: Tue, 03 Apr 2018 18:43:29 GMT
server: tsa_k
strict-transport-security: max-age=631138519
x-connection-hash: [redacted]
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-response-time: 212
x-transaction: 0032a30100b23d6b
x-xss-protection: 1; mode=block; report=https://twitter.com/i/xss_report
{"groups":[],"apps_info":{"xxxxxx":{"app_store_identifier":"**com.twitter.android**","description":"xxxxxx{"app_store_identifier":"**com.instagram.android**","description"xxxx"\u003Cdiv jsname=\"C4s9Ed\"\u003xxxxxxxxx{"app_store_identifier":**"com.tumblr**","description":xxxxxx"\u003Cdiv jsname=\"C4s9Ed\"\u003ETxxxxx
Line by line:
HTTP/1.1 200 OKis the status line. 200 is the standard code for "here is what you asked for". Compare it with the 404 from earlier: the App Manager page said "not found", but this endpoint said "here you go".connection: closeconfirms the connection will be closed after this answer.content-disposition: attachment; filename=json.jsonsuggests to the browser that the body is a file to download, namedjson.json.Content-Length: 8410is the size of the body in bytes, so the browser knows how much to expect.content-type: application/json;charset=utf-8says the body is JSON text, encoded in UTF-8 (a standard way of representing characters).date: Tue, 03 Apr 2018 18:43:29 GMTis when the server produced the answer.server: tsa_knames the server software. The report does not explain whattsa_kis.strict-transport-security: max-age=631138519is a security instruction telling the browser to keep using encrypted HTTPS connections to this site for a long period. HTTPS is the encrypted version of the web, so nobody in between can read or change the traffic.x-connection-hash: [redacted]is an internal identifier for the connection.x-content-type-options: nosnifftells the browser not to guess the file type, but to trust the declared one. This prevents certain attacks where a browser misreads a file as a different kind.x-frame-options: SAMEORIGINstops other websites from embedding this page inside a frame. That protects against clickjacking, where an attacker hides a real button under a fake one.x-response-time: 212is how long the server took, in milliseconds.x-transaction: 0032a30100b23d6bis an identifier for this particular request, useful for tracing it in logs.x-xss-protection: 1; mode=block; report=https://twitter.com/i/xss_reportis an old browser instruction about XSS (cross-site scripting, where an attacker injects their own script into a page). The browser is told to block such pages and report them to the given address.- The last line is the body, the actual data. It is truncated in the report, but it shows the structure: a top-level
groupsarray and anapps_infoobject keyed by app identifiers, each entry carrying anapp_store_identifierand adescription.
In plain words, the body is a list of apps. groups is a list (empty here). apps_info is a collection of entries, each named by an identifier, and each entry has an app_store_identifier (the app's package name in the app store) and a description. The response listed Twitter, Instagram and Tumblr under applications, with identifiers such as com.twitter.android, com.instagram.android and com.tumblr. The description values contain HTML fragments, with < written as \u003C.
So the endpoint returned the full list of managed apps and their associated data to a Campaign analyst, the same data the App Manager page had been withholding from that role.
Root cause
The report frames this as a misconfigured JSON endpoint leading to an access control issue. The App Manager page enforced the role check and returned 404 to Organic and Campaign analysts, but the JSON endpoint that feeds the app promotion page, /accounts/<id>/apps.json, did not apply the same restriction. The campaign creation page was also reachable by direct URL for a Campaign analyst, which gave that role a legitimate-looking page from which to trigger the request.
Two ideas need explaining here. An API is the set of service counters a program can talk to, as opposed to the pages a person clicks. The page layer is the part that draws what you see in the browser; the API layer is the part that actually hands out data. If you put the lock on the page but not on the counter behind it, anyone who knows the counter's address can walk straight up to it. Authorisation is the check that asks "are you allowed to do this?", as opposed to authentication, which asks "who are you?". The cookie proves who you are; the missing check was about what you may do.
Impact
A user holding only the Campaign analyst role could read the managed app list and associated data that the role was not meant to see. The researcher could not create a campaign through the reachable page, so the impact described is information disclosure and broken access control rather than account takeover or campaign manipulation.
In everyday terms: the analyst could read a file they were not given the key to, but could not change anything in the building.
Fix
The fix implied by the finding is to enforce the same role check on the JSON endpoint that the App Manager page already enforced, so that requests from roles without the App Manager permission are rejected regardless of which page issues them, and to apply the same check to the campaign creation page that was reachable by direct URL.
In other words: put the lock on the service counter itself, not only on the door that leads to it, and lock the second door into the room as well.
Variants to test
If you want to look for similar problems yourself, these are the patterns to try. Each one is a way of asking the same question: does the server check permission every time, or only in some places?
- Page versus API mismatch. Find a page that returns 404 or redirects for a low-privileged role, then look at the XHR calls it would make and request those endpoints directly with the low-privileged session. A positive result is a 200 with the data the page was hiding.
- Direct URL to privileged pages. Request campaign creation or settings URLs by hand with a restricted role, as was done with
/campaigns/new/app_promotion. A positive result is the page rendering instead of a 404, even if the final submit fails. - Query parameter tampering on the JSON endpoint. Change
accountto another account identifier while keeping the low-privileged session, and try theactionparameter values seen in the request. A positive result is data for an account the session does not belong to. - Role matrix sweep. For each role (Account administrator, Ad manager, Campaign analyst, Organic analyst), request the same set of endpoints and record status codes and body sizes. A positive result is any endpoint returning data to a role that the UI says cannot see it.
- Content negotiation. Repeat the request with
Accept: application/jsonand withX-Requested-With: XMLHttpRequestremoved, to see whether the check is tied to the header rather than the session. A positive result is the same data returned under a different request shape.
Glossary
- 404: the standard web response meaning "not found"; here used to hide a page from roles that may not see it.
- Access control: the rules that decide who may do what; broken access control means those rules are missing or not enforced everywhere.
- Account administrator: the role with full access, including adding and removing users and changing settings.
- Ad manager: the role with full access to campaigns and data, but without user management or settings changes.
- API: the set of addresses a program can call to get or change data, as opposed to pages a person clicks.
- API layer: the part of a system that actually serves data to callers.
- App Manager: the Twitter Ads page that shows managed app name, conversion tracking and deep link scheme data.
- Authentication: proving who you are, for example by logging in and receiving a cookie.
- Authorisation: deciding whether an authenticated user is allowed to do a particular thing.
- Bounty: a reward paid by a company for a valid security report.
- Campaign analyst: the role that can view paid campaign data and pull reports, but cannot modify or create campaigns.
- Clickjacking: an attack that hides a real button under a fake one so a user clicks something unintended;
x-frame-optionshelps prevent it. - Content-Type: a response header naming the format of the body, such as JSON.
- Conversion tracking: the mechanism that records when someone who saw an ad later performs a valuable action, such as installing an app.
- Cookie: a small piece of data stored by the browser for a site and sent with each request; a session cookie proves you are logged in.
- Deep link scheme: a custom address format that opens a specific place inside an app.
- Endpoint: a specific address on a server that answers a particular kind of request.
- GET request: the basic web method for asking a server to return something.
- Header: a named line in a request or response carrying extra information, such as the browser type or the cookie.
- HTML: the language web pages are written in; fragments of it appear inside the JSON descriptions.
- HTTPS: the encrypted version of the web, so traffic cannot be read or changed in transit.
- Information disclosure: showing data to someone who should not have seen it.
- JSON: a plain-text format for structured data, made of names and values.
- Misconfiguration: a setting left out or set wrongly, so a check that should exist does not.
- Organic analyst: the role that can view organic analytics and audience insights, but cannot modify or view campaigns.
- Page layer: the part of a system that draws what you see in the browser.
- Query string: the part of a URL after the
?, carrying named values such asaccountandlang. - Referer: a request header naming the page the request came from.
- Role: a named set of permissions given to a user.
- Status code: a number in a response saying how the request went, such as 200 for success or 404 for not found.
- UTF-8: a standard way of representing characters in text.
- XHR (XMLHttpRequest): a background request a page makes with JavaScript to fetch data without reloading.
- XSS (cross-site scripting): an attack where an attacker injects their own script into a page.