Skip to content
Access control Write-up Beginner

Broken Access Control in bingmapsportal !!!

The Bing Maps portal did not check that the user owned the application being updated, so an attacker could change the applicationId in a PUT request to move another user's application into their own account. This allowed unauthorised transfer of application ownership.

Sai Krishna Kothapalli Follow

Published on medium.com

{{media:0}}

Sai Krishna Kothapalli, on medium.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. 4 min read.

Context

Bing Maps API keys are managed through bingmapsportal. An account holder can create applications, each with its own key, and can rename or otherwise update those applications from the portal. This write-up covers the third vulnerability the author reported to Microsoft, in the application update flow of that portal.

Setup

Two accounts were used, both ordinary Outlook accounts:

  1. The author's own account, holding an application named bounty_1.
  2. The author's sister's account, holding an application named bounty_2.

No special tooling is described beyond the ability to intercept and modify the portal's requests. The precondition for the attack is that the attacker has a valid account on the portal and knows the identifier of an application belonging to someone else.

Finding it

While updating the name of an application, the author noticed that the portal does not use a POST for the update. It sends a PUT request. The author points out the relevant difference: a PUT overwrites whatever was there previously.

Image for post
Screenshot From the original on medium.com

The screenshot shows the intercepted update request. The body is JSON and carries both an applicationId and an accountId, alongside the application's other properties. Those two fields are what drew the author's attention: if the application identifier is part of the request body, what happens when it is changed?

Exploitation

Step 1: Create one application per account

The author created an application named bounty_1 in his own account, and asked his sister to create an application named bounty_2 in hers, using her Outlook account.

Image for post
Image for post From the original on medium.com

Step 2: Intercept the update request

With the sister's account, the author intercepted the PUT request that the portal sends when an application is updated. The body looks like this:

JSON
{"applicationId":1707630,"applicationName":"testing xml","applicationUri":null,"ticket":"[redacted]","accountId":1418767,"keyTypeId": 2,"keyType":"Basic","keySubtypeId":39,"keySubtype":"Universal Windows App","validFrom":"12/23/2015","validTo":"None","isMutable":true," showButtonTextEnable":false,"keyStatus":"Enabled","showKeyEnableDisableButton":true}

The important parts are applicationId, which identifies the application being updated, and accountId, which identifies the owning account. The request also carries a ticket value, which is redacted here. The remaining fields describe the key: its type (Basic), subtype (Universal Windows App), validity window, mutability and status.

Step 3: Swap the application identifier

Still intercepting the request from the sister's account, the author changed the applicationId from bounty_2's application ID to bounty_1's application ID, and forwarded it.

Image for post
Image for post From the original on medium.com

The response was:

Text
Key updated successfully

Step 4: Check the result

After refreshing his own account, the author found that bounty_1 had been transferred out of his account and into his sister's account.

Image for post
Image for post From the original on medium.com

The update had moved ownership of the application: it was transferred from one account to another. The server accepted a PUT that named an application belonging to a different account, and applied it.

Root cause

The author's conclusion is that the backend does not validate whether the caller owns the application referenced by applicationId. The request is authenticated as the sister's account, but the object being modified is chosen entirely by a client-supplied identifier in the body, and no ownership check is performed against that identifier before the update is applied. Because the operation is a PUT, the request replaces the target object's state.

Impact

An authenticated user of the portal could take over another user's Bing Maps application by submitting that application's identifier in an update request. The author demonstrated the transfer of an application from one account to another. The report does not describe what happens to the API key material itself after the transfer, nor whether the original owner retains any access.

Fix

The author states that the issue was reported to Microsoft and is patched. The report does not describe the change that was made. The fix that the finding calls for is a server-side ownership check: before applying an update, the backend should confirm that the application identified by applicationId belongs to the authenticated account, rather than trusting the identifier supplied in the request body.

Timeline

Date Event
23-12-2015 Initial report sent
Following days Follow-ups
05-01-2016 Asked for updates
06-01-2016 Reply: no updates
21-01-2016 Asked again for updates
22-01-2016 Reply: issue is fixed

The author says he will be listed in Microsoft's Hall of Fame for January 2016.

Variants to test

  1. Identifier swap in other update endpoints. Take any PUT or PATCH request whose body contains an object identifier and replace it with an identifier from a second account. A positive result is a success response plus a visible change on the victim's object.
  2. Ownership fields in the body. Where the body also carries an account or owner identifier, change it alongside the object identifier. A positive result is the object appearing under the attacker's account.
  3. Sequential identifiers. If identifiers are small integers, as in the example above, enumerate neighbouring values against your own authenticated session. A positive result is a success response for an identifier you do not own.
  4. Read paths with the same identifier. Apply the same swap to GET requests for application details or keys. A positive result is another account's data being returned.
  5. Method substitution. If POST is rejected for cross-account updates, try PUT or PATCH on the same resource. A positive result is the update being applied under a method the server did not guard.

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

A security researcher found a way to move a Bing Maps application from one person's account into another person's account, without the first person agreeing to it. Bing Maps is Microsoft's online map service. Developers who build apps that show maps or use location data need a special code, called an API key, to talk to Bing Maps. Those keys are managed on a website called the Bing Maps portal (bingmapsportal). On that portal you can create an "application", give it a name, and the portal gives you a key for it.

The researcher noticed that when you rename an application, the portal sends a request to Microsoft's servers that includes the application's ID number. An ID number is just a unique label, like a customer number, that tells the server which application you mean. He wondered what would happen if he changed that number to point at somebody else's application. He tested it with his sister's account, and the server accepted the change: his application ended up inside her account. The server never checked whether the person sending the request actually owned the application they were naming.

This kind of mistake is called broken access control. Access control means the rules about who is allowed to do what. When a website checks that you are logged in but forgets to check that the thing you are touching belongs to you, that is broken access control. A simple comparison: a hotel receptionist who checks that you have a room key, but never checks that the room number on the key is actually yours, has broken access control. You can open any door as long as you hold some key.

This was the third vulnerability the researcher reported to Microsoft. He reported it in December 2015, Microsoft fixed it in January 2016, and he says he will be listed in Microsoft's Hall of Fame for that month.

Background you need first

A few ideas come up again and again below, so here they are from zero.

API and API key. An API (application programming interface) is a way for one piece of software to ask another piece of software to do something, without a human clicking buttons. Think of a restaurant: the menu and the waiter are the API, and the kitchen is the service. An API key is like a membership card you show the waiter so the kitchen knows the request comes from a paying customer. Bing Maps gives out API keys so that only registered developers can use its map data, and so Microsoft can count and limit usage.

The portal. The Bing Maps portal is an ordinary website where you log in with a Microsoft (Outlook) account. Inside, you create applications. Each application has a name, an ID number, and an API key. You can rename an application later, and the portal sends that change to Microsoft's servers.

HTTP requests and methods. When your browser talks to a website, it sends an HTTP request. Each request has a method, which is a verb telling the server what kind of action you want. The two that matter here are POST and PUT. A POST usually means "create something new". A PUT usually means "replace the thing at this address with what I am sending". The researcher points out the practical difference: a PUT overwrites whatever was there before. If you PUT a new version of a record, the old version is gone, replaced wholesale.

Request body and JSON. The body is the part of the request that carries data, as opposed to the address and headers. The portal sends its data as JSON, a text format for structured data that looks like {"name": "value"}. Curly braces hold an object, and each entry is a field name in quotes, a colon, and a value.

Intercepting a request. Normally your browser sends a request and you never see it. With a proxy tool, you place something between your browser and the internet that lets you pause a request, read it, edit it, and then send it on. That is what "intercept" means throughout this article. The report does not name the tool used.

Ticket. The request body contains a field called ticket. It is a long random-looking string. In practice this is a session token: a value the server gave the browser when the user logged in, which the browser sends back on every request so the server knows who is asking. It works like the wristband you get at an event: show it and you are let back in without proving who you are again. Because a ticket lets someone act as the logged-in user, it is a secret and is redacted in the code below.

Identifier enumeration. IDs like 1707630 are just numbers. If a website uses small sequential numbers as IDs, anyone can guess neighbouring numbers. That matters later, in the variants section.

Setting up the test

Two ordinary Outlook accounts were used:

  1. The researcher's own account, holding an application named bounty_1.
  2. His sister's account, holding an application named bounty_2.

Why two accounts? Because to prove that one person can touch another person's data, you need two separate people, or at least two separate logins. If you only use one account, you cannot tell whether the server is checking ownership or not: everything you touch is yours anyway. The only precondition for the attack is that the attacker has a valid account on the portal and knows the ID of somebody else's application.

Image for post
Image for post From the original on medium.com

The image shows the second account with its own application created, which is what makes the cross-account test possible.

Finding it

While renaming an application, the researcher noticed that the portal does not use a POST for the update. It sends a PUT request. He highlights the relevant difference: a PUT overwrites whatever was there previously. That matters because an overwrite can change more than the field you think you are editing.

Image for post
Screenshot From the original on medium.com

The screenshot shows the intercepted update request. The body is JSON and carries both an applicationId and an accountId, alongside the application's other properties. Those two fields are what drew his attention. If the application identifier travels in the request body, and the body is under the user's control, then the user can change which application the request is about. The natural next question is: what happens if I change it?

Exploitation

Step 1: Create one application per account

The researcher created an application named bounty_1 in his own account, and asked his sister to create an application named bounty_2 in hers, using her Outlook account. Two applications in two accounts gives a clean experiment: one application to attack from, one to attack.

Step 2: Intercept the update request

Logged in as his sister, he intercepted the PUT request the portal sends when an application is updated. The body looks like this:

JSON
{"applicationId":1707630,"applicationName":"testing xml","applicationUri":null,"ticket":"[redacted]","accountId":1418767,"keyTypeId": 2,"keyType":"Basic","keySubtypeId":39,"keySubtype":"Universal Windows App","validFrom":"12/23/2015","validTo":"None","isMutable":true," showButtonTextEnable":false,"keyStatus":"Enabled","showKeyEnableDisableButton":true}

Line by line, in plain words:

  • applicationId is the unique number of the application being updated. This is the field that decides which record on the server gets changed.
  • applicationName is the display name, here testing xml.
  • applicationUri is a web address associated with the application; here it is null, meaning empty.
  • ticket is the session token described earlier, redacted here because it would let anyone reading act as the logged-in user.
  • accountId is the unique number of the account that owns the application.
  • keyTypeId, keyType, keySubtypeId and keySubtype describe the kind of API key: here a Basic key of the Universal Windows App subtype.
  • validFrom and validTo are the dates the key is valid between; validTo is None, so it does not expire.
  • isMutable says whether the key can be changed.
  • showButtonTextEnable and showKeyEnableDisableButton are display settings for buttons in the portal's interface.
  • keyStatus says the key is Enabled.

The important parts are applicationId, which identifies the application being updated, and accountId, which identifies the owning account. The rest describes the key itself.

Step 3: Swap the application identifier

Still intercepting the request from the sister's account, he changed the applicationId from bounty_2's application ID to bounty_1's application ID, and forwarded it. In other words: the request was still authenticated as the sister, but it now named the researcher's application as the thing to update. If the server checked ownership, it should have refused, because the sister does not own bounty_1.

Image for post
Image for post From the original on medium.com

The image shows the edited request with the swapped identifier.

The response was:

Text
Key updated successfully

That single line is the server saying it did the update. It did not say "forbidden" or "not yours". It accepted the request.

Step 4: Check the result

After refreshing his own account, the researcher found that bounty_1 had been transferred out of his account and into his sister's account.

Image for post
Image for post From the original on medium.com

The image relates to his account after the refresh.

The update had moved ownership of the application: it was transferred from one account to another. The server accepted a PUT that named an application belonging to a different account, and applied it.

Root cause

The researcher's conclusion is that the backend does not validate whether the caller owns the application referenced by applicationId. "Backend" means the server-side software behind the website, the part you never see. The request is authenticated as the sister's account, but the object being modified is chosen entirely by an identifier the client supplies in the body, and no ownership check is performed against that identifier before the update is applied. Because the operation is a PUT, the request replaces the target object's state.

A comparison: a bank teller who checks your ID at the counter but then transfers money out of whichever account number you write on the slip, without checking that the account is yours, has exactly this problem. The login check is present; the ownership check is missing.

Impact

An authenticated user of the portal could take over another user's Bing Maps application by submitting that application's identifier in an update request. The researcher demonstrated the transfer of an application from one account to another.

Fix

The researcher states that the issue was reported to Microsoft and is patched. The fix that the finding calls for is a server-side ownership check: before applying an update, the backend should confirm that the application identified by applicationId belongs to the authenticated account, rather than trusting the identifier supplied in the request body.

Timeline

Date Event
23-12-2015 Initial report sent
Following days Follow-ups
05-01-2016 Asked for updates
06-01-2016 Reply: no updates
21-01-2016 Asked again for updates
22-01-2016 Reply: issue is fixed

The researcher was listed in Microsoft's Hall of Fame for January 2016.

Variants to test

These are the same idea applied in other places. Each one follows the pattern: take a request that names an object, swap the name for one you do not own, and see whether the server objects.

  1. Identifier swap in other update endpoints. Take any PUT or PATCH request whose body contains an object identifier and replace it with an identifier from a second account. A positive result is a success response plus a visible change on the victim's object. PATCH is like PUT but for partial changes.
  2. Ownership fields in the body. Where the body also carries an account or owner identifier, change it alongside the object identifier. A positive result is the object appearing under the attacker's account.
  3. Sequential identifiers. If identifiers are small integers, as in the example above, enumerate neighbouring values against your own authenticated session. A positive result is a success response for an identifier you do not own.
  4. Read paths with the same identifier. Apply the same swap to GET requests for application details or keys. A positive result is another account's data being returned. GET is the method for reading something rather than changing it.
  5. Method substitution. If POST is rejected for cross-account updates, try PUT or PATCH on the same resource. A positive result is the update being applied under a method the server did not guard.

Glossary

  • Access control: the rules that decide who is allowed to do what; broken access control means those rules are missing or can be bypassed.
  • API: a way for one piece of software to ask another to do something, without a human clicking buttons.
  • API key: a secret code that identifies a developer or application to a service, like a membership card.
  • Application (in the portal): a record you create in the Bing Maps portal, with a name, an ID and an API key.
  • Authentication: proving who you are, usually by logging in.
  • Authorization: deciding what a proven identity is allowed to do; ownership checks are part of this.
  • Backend: the server-side software behind a website, which the user never sees directly.
  • Body (request body): the part of an HTTP request that carries data, as opposed to the address and headers.
  • Broken access control: a vulnerability where the server fails to check that the user is allowed to touch the object they are naming.
  • Enumeration: trying a series of values, such as neighbouring ID numbers, to find ones that work.
  • GET: an HTTP method for reading something.
  • HTTP: the language browsers and websites use to exchange requests and responses.
  • Identifier (ID): a unique label, usually a number, that names a specific record on a server.
  • Intercept: to pause a request between browser and server so it can be read and edited before being sent on.
  • JSON: a text format for structured data, written as field names and values inside curly braces.
  • Method: the verb on an HTTP request, such as GET, POST, PUT or PATCH, saying what kind of action is wanted.
  • Outlook account: a Microsoft login account, used here to sign in to the portal.
  • PATCH: an HTTP method for partially changing an existing record.
  • POST: an HTTP method usually meaning "create something new".
  • Proxy: a tool placed between browser and internet that can pause, inspect and modify traffic.
  • PUT: an HTTP method meaning "replace the thing at this address with what I am sending"; it overwrites what was there.
  • Root cause: the underlying reason a vulnerability exists, as opposed to its visible symptom.
  • Session token (ticket): a value issued at login and sent back on each request so the server knows who is asking; it must be kept secret.
  • Vulnerability: a weakness in software that someone can abuse to do something the owner did not intend.

More by Sai Krishna Kothapalli

View all

4 more disclosed reports, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.