View-The-Facebook-Stories-For-Any-Media-Effect
The GraphQL endpoint allowed any user to query stories that used a media effect by supplying an effect ID, bypassing the intended restriction that only the effect's creator should see this data. An attacker could view stories from users or pages that used any effect.
Published on philippeharewood.com
Within https://www.facebook.com/fbcameraeffects/manage/ there is the ability for the creator of an effect to see the stories that used the effect. It is possible using GraphQL to view the stories for any effect.
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.
What the report shows
The target is the Facebook Camera Effects management area at https://www.facebook.com/fbcameraeffects/manage/. Within that interface, the creator of an effect can see the stories that used the effect. The researcher found that the same data could be reached directly through GraphQL for any effect.
The proof of concept is a single GraphQL request:
graph.facebook.com/graphql?q=node(EFFECT_ID){effect_usage{id, effect_usage_stories}}
By substituting an arbitrary effect identifier, the query returns the stories by users or pages that used that effect. The researcher states that this works for any effect, not only the ones the caller created.
The impact as described is that a user could see the usage of a page's media effect, which should be reserved for the admins of that page only.
The timeline given is:
| Date | Event |
|---|---|
| Mar 29, 2018 | Report sent |
| Apr 18, 2018 | Further investigation by Facebook |
| May 23, 2018 | Fixed by Facebook |
| May 23, 2018 | Bounty awarded by Facebook |
The report does not give a severity rating, a CVSS score or a bounty amount.
Root cause
A plausible explanation is a missing authorisation check on the GraphQL node lookup. The management UI presumably restricts the effect usage view to the effect's creator, but the underlying resolver behind node(EFFECT_ID) appears to return effect_usage and effect_usage_stories for any effect identifier supplied, without verifying that the authenticated caller owns that effect.
Impact
The report's own framing is narrow: a user could see the usage of a page's media effect, data that should be visible only to that page's admins. That means disclosure of which users or pages used a given effect, and the associated stories, to someone outside the owning page's admin team. The report does not describe any write capability, any ability to modify effects, or any further escalation.
How this kind of bug works
This is a broken object-level authorisation problem, often called IDOR when the object is referenced directly by identifier. Modern GraphQL APIs expose a generic node(id:) style entry point that resolves any object by its global identifier. Each object type then has field resolvers that fetch related data. Authorisation is easy to enforce at the top-level query (is this user allowed to call this field at all?) and easy to forget at the object level (is this user allowed to see this object and its relations?).
When the check is missing, the API becomes an oracle: any identifier the caller can guess or obtain returns data belonging to another tenant, page or user. Identifiers are frequently sequential, derived from timestamps, or leaked elsewhere in the product (in page source, in shared links, in other API responses), so guessing is often unnecessary.
The defence is to enforce authorisation in the resolver that returns the object, not only in the UI or the parent query. Every field that exposes sensitive relations should re-check the caller's relationship to the object it is resolving.
How to test for it
- Identify features where one principal owns an object and can view data derived from it: analytics, usage lists, member lists, audit logs, story or post references.
- Capture the request the legitimate owner makes when viewing that data. Note the object identifier and the query shape.
- Create or obtain a second account that has no relationship to the object.
- Replay the same request from the second account, substituting the first account's identifier. For GraphQL, also try the generic node lookup with the same identifier, and try requesting the sensitive subfields directly if the UI only asks for a subset.
- A positive result is a response containing the other principal's data, with the same structure the owner sees, rather than an error, an empty result or a permission message.
Common false positives: the endpoint returning public data that anyone may see; the second account actually having an admin or collaborator role on the object; cached responses; and fields that are empty for everyone because the object genuinely has no usage. Confirm by comparing against the owner's own view and by testing an identifier that certainly belongs to someone else.
How it is fixed
A standard fix would be a server-side authorisation check in the resolver for the object and for each sensitive field. The resolver should confirm that the authenticated caller is the owner or an authorised admin of the object before returning effect_usage or any related list. Where possible, scope queries to the caller's own objects rather than accepting arbitrary identifiers. Logging and alerting on repeated cross-object lookups from a single account helps detect probing after the fix.
Hunting notes
These bugs cluster around management and analytics surfaces: creator dashboards, page admin tools, advertising interfaces, and anything that aggregates activity by object. GraphQL is a common home because the generic node interface makes object traversal trivial once an identifier is known.
Recon signals worth watching: a UI page whose data is loaded by a GraphQL query containing an object identifier; identifiers that appear in URLs, share links or other responses; and fields whose names suggest ownership (usage, members, insights, stories).
To make the report land, show the request, show that a second unrelated account receives another principal's data, and state plainly what the data is and who should have seen it. Keep the demonstration to the minimum needed to prove the gap, and avoid pulling more records than necessary.
What happened, in plain words
Facebook lets people create camera effects: the filters and frames you can add to a photo or video. Creators manage their effects in a page at https://www.facebook.com/fbcameraeffects/manage/. One thing that page shows is the stories that used a given effect, so a creator can see how their effect was used.
A story here is a piece of content someone posted with the effect applied. The researcher found that this usage information could be fetched directly from Facebook's GraphQL interface, without going through the management page at all. GraphQL is a way for a website to ask a server for exactly the data it wants, in a single request, rather than downloading a whole page. The important part: the request worked for any effect identifier.
So a user could see the usage of a page's media effect, which should be reserved for that page's admins only. The report does not describe any ability to change effects or do anything beyond viewing this data.
The proof of concept
The whole demonstration is one request:
graph.facebook.com/graphql?q=node(EFFECT_ID){effect_usage{id, effect_usage_stories}}
Reading it piece by piece:
graph.facebook.com/graphqlis the address of Facebook's GraphQL endpoint. An endpoint is simply the URL a program sends its request to.?q=starts the part of the URL that carries the question being asked. Everything after it is the query.node(EFFECT_ID)asks the server for one object, identified byEFFECT_ID. Think of an identifier as a label on a box: the server looks up the box with that label and hands back what is inside.EFFECT_IDis a placeholder; in a real request it is replaced with an actual effect's identifier.{effect_usage{id, effect_usage_stories}}says which fields of that object to return.effect_usageis the usage information,idis the identifier, andeffect_usage_storiesis the list of stories that used the effect.
By putting a different effect's identifier into the placeholder, the query returns the stories by users or pages that used that effect. The researcher states this works for any effect. That is the bug: the server returned usage data for any effect identifier supplied.
Timeline
| Date | Event |
|---|---|
| Mar 29, 2018 | Report sent |
| Apr 18, 2018 | Further investigation by Facebook |
| May 23, 2018 | Fixed by Facebook |
| May 23, 2018 | Bounty awarded by Facebook |
The report gives no severity rating, no CVSS score and no bounty amount.
Why it matters
The management page is meant to show effect usage only to the effect's creator. The report's own framing is narrow: a user could see the usage of a page's media effect, data that should be visible only to that page's admins. That means learning which users or pages used a given effect, and the associated stories, from outside the owning page's admin team.
In general, how this kind of bug works
This is a broken object-level authorisation problem. Authorisation means deciding whether the person asking is allowed to do what they are asking. Object-level means the decision has to be made for each individual item, not just for the feature as a whole. When the item is named directly by an identifier in the request, the problem is often called IDOR, short for Insecure Direct Object Reference: the server takes an identifier from the user and hands over whatever it points to, without checking that the user owns it.
GraphQL APIs make this easy to get wrong. They usually offer a generic lookup, like the node(...) call above, that can fetch any object by its identifier. Each object then has fields that pull in related data. Checking permission at the top of a query (may this user use this feature at all?) is natural. Checking it again for every object and every related field (may this user see this particular object and its relations?) is easy to forget. When that second check is missing, the API becomes a lookup service for anyone: any identifier the caller can guess or find returns data belonging to another person or page. Identifiers are often sequential, based on timestamps, or visible elsewhere in the product, such as in page source, shared links or other responses, so guessing is often unnecessary.
The defence is to enforce the check where the data is actually fetched, on the server, not only in the page or the parent query. Every field that exposes sensitive relations should re-check the caller's relationship to the object it is returning.
In general, how to test for it
- Look for features where one person owns something and can view data derived from it: analytics, usage lists, member lists, audit logs, references to stories or posts.
- Capture the request the legitimate owner makes when viewing that data. Note the identifier and the shape of the query.
- Get a second account that has no relationship to the object.
- Replay the same request from the second account, swapping in the first account's identifier. For GraphQL, also try the generic node lookup with that identifier, and ask for the sensitive fields directly if the page only requests a subset.
- A positive result is a response containing the other person's data, in the same shape the owner sees, rather than an error, an empty result or a permission message.
Common false positives: the endpoint returning data that is public anyway; the second account actually having an admin or collaborator role on the object; cached responses; and fields that are empty for everyone because the object genuinely has no usage. Confirm by comparing with the owner's own view and by testing an identifier that certainly belongs to someone else.
In general, how it is fixed
The standard fix is a server-side authorisation check in the code that returns the object and each sensitive field. That code should confirm the caller is the owner or an authorised admin of the object before returning effect_usage or any related list. Where possible, queries should be limited to the caller's own objects instead of accepting arbitrary identifiers. Logging and alerting on repeated cross-object lookups from one account helps detect probing after the fix.
In general, where to look
These bugs cluster around management and analytics surfaces: creator dashboards, page admin tools, advertising interfaces, and anything that aggregates activity by object. GraphQL is a common home because the generic node interface makes it trivial to walk from one object to another once an identifier is known. Signals worth watching: a page whose data is loaded by a GraphQL query containing an object identifier; identifiers that appear in URLs, share links or other responses; and field names that suggest ownership, such as usage, members, insights or stories.
To make a report land, show the request, show that a second unrelated account receives another person's data, and state plainly what the data is and who should have seen it. Keep the demonstration to the minimum needed to prove the gap, and avoid pulling more records than necessary.
Glossary
- GraphQL: a way for a client to ask a server for specific fields of data in one request, instead of receiving a whole page.
- Endpoint: the URL that a request is sent to.
- Query: the question sent to a GraphQL server, describing which objects and fields are wanted.
- Identifier (ID): a value that names a specific object, such as a particular effect, so the server can find it.
- Field: a named piece of data inside an object, such as
effect_usage_stories. - Resolver: the server-side code that fetches the data for a field or object.
- Authorisation: deciding whether the person making a request is allowed to do it.
- Object-level authorisation: checking permission for each individual item, not just for the feature as a whole.
- IDOR (Insecure Direct Object Reference): a bug where the server accepts an identifier from the user and returns the object without checking that the user owns it.
- Broken access control: a broad name for bugs where permission checks are missing or wrong.
- Proof of concept: the minimal request or steps that demonstrate a bug really exists.
- Impact: what an attacker could actually do or see because of the bug.
- Severity / CVSS: ratings of how serious a bug is; the report gives neither.
- Bounty: a reward paid by a company for a valid security report.
- False positive: a result that looks like a bug but is not one.
- Cache: a stored copy of a response that can be served again, sometimes making a test look successful when it is not.