View-Former-Members-Of-A-Facebook-Group
A Graph API endpoint exposed the former members of a Facebook group even after the group's member list was cleared for non-employees. An attacker could query this endpoint to see the identities of people who had left the group.
Published on philippeharewood.com
There is a GraphAPI call to request the former members of a group. A specific Facebook employee group clears the member list for non-employees.
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 Graph API, and the feature in question is the former_members edge of a group. Facebook maintains an employee-only group whose member list is cleared for anyone who is not an employee. The researcher noticed that although the current member list was hidden, the edge listing people who had left the group had not been cleared, so the former members of that employee group could still be read.
The proof of concept is a single Graph API request:
HTTP GET
graph.facebook.com/GROUP_ID/former_members
By looking at the profiles and usernames returned, the researcher judged that the accounts belonged to former Facebook employees, or at least to people who had been in that group. The report notes that the usernames were four characters long, which supported that reading.
The report is explicit about the limits of the finding. It would have allowed someone to see the former members of a Facebook group, but it would not have given access to the member list of Workplace communities or secret groups, because of Facebook's privacy rules.
The timeline in the report is:
| Date | Event |
|---|---|
| Oct 11, 2017 | Report sent |
| Oct 17, 2017 | Information requested by Facebook |
| Oct 30, 2017 | Further investigation by Facebook |
| Dec 6, 2017 | Bounty awarded by Facebook |
The report does not state a severity rating, a CVSS score, a bounty amount or the fix that was applied.
Root cause
The report says the former members edge was not cleared, so the hidden list could still be read through it. When a group's membership is restricted, the restriction has to cover every representation of that membership, including historical ones. Here the former_members edge remained readable, so the hidden list could be reconstructed in part from the people who had left it.
Impact
The impact is disclosure of group membership history. In this case it revealed accounts that appeared to be former employees of the company that owned the group.
The report is careful to bound the impact: it did not expose the member list of Workplace communities or secret groups.
How this kind of bug works
Social platforms model relationships as edges between objects: a group has members, and it also has people who used to be members. Privacy settings are usually enforced at the point where a list is rendered or returned, and each edge is often served by its own handler. If the handler for the historical edge does not consult the same visibility rules as the handler for the current edge, the data leaks even though the UI shows nothing.
The same pattern appears whenever a resource has multiple views: current versus archived, active versus deleted, public profile versus internal record, list endpoint versus detail endpoint, and the object itself versus its connections. The bug is not usually a broken rule; it is a rule that was applied in one place and forgotten in another.
Defences are structural. Authorisation should be decided by a single policy layer that every handler for a given object calls, rather than reimplemented per endpoint. Where a list is restricted, the restriction should be expressed on the underlying data so that all derived edges inherit it. Tests should assert that restricted data is absent from every endpoint that can reach it, not just the documented one.
How to test for it
- Identify a feature where visibility is conditional: a group whose member list is hidden, a private project, a restricted organisation page.
- Enumerate the related edges and views the API exposes for that object. Look for names suggesting history or state: former, previous, archived, deleted, removed, pending, invited, requested, inactive.
- Request each of those edges as an account that should not see the restricted list, and compare with what a privileged account sees.
- Also try the same data through alternate routes: the object detail endpoint, search, activity feeds, exports and any GraphQL or REST variant that returns the same relationship.
- A positive result is a response that returns identifiers, names or profile references for people who are supposed to be hidden, especially when the current list returns nothing or an error.
Common false positives:
- The returned accounts are public and their membership is already visible elsewhere.
- The edge returns only aggregate counts, not identities.
- The data belongs to a group the test account is legitimately entitled to see.
- The response is cached or reflects a stale permission state rather than a missing check.
Confirm by repeating with a fresh account that has no relationship to the object, and by checking that the same identifiers are absent from every legitimately accessible view.
How this kind of bug can be fixed
- Apply the same authorisation policy to historical and derived edges as to the primary list.
- Where a list is cleared for a given audience, clear or filter the underlying relationship data so that all endpoints inherit the restriction.
- Audit every handler that reads the membership relation and route it through the central policy check.
- Add regression tests that request each related edge as an unauthorised user and assert an empty or denied response.
Hunting notes
This class of bug tends to hide in features that accumulate state over time: groups, teams, organisations, repositories, mailing lists and event attendance. Historical edges are added later than the main feature, are used less, and are therefore less likely to have been covered by the original privacy review.
Recon signals worth following: API documentation or client code that references edges with names like former, previous or archived; UI that shows a count of past members but no list; and privacy settings that describe what is hidden without describing what happens to the history.
What happened, in plain words
Facebook groups have a member list: the people who currently belong. Facebook also keeps track of people who have left, and its API (the programming interface that apps and tools use to talk to Facebook) exposes that history through something called an edge. An edge is simply a named connection between two things: a group is connected to its members, and it is also connected to its former members.
Facebook runs an internal group for its own employees. For anyone who is not an employee, the current member list of that group is cleared, meaning it is hidden. The researcher found that the former members edge had not been cleared. The list of people who had left the group was still readable. So even though you could not see who was in the group now, you could see who had been in it before.
The proof of concept is one request to the Facebook Graph API, the part of Facebook that returns data in a structured form rather than as a web page:
HTTP GET
graph.facebook.com/GROUP_ID/former_members
Line by line:
HTTP GETsays the request only asks to read something. It does not change anything on Facebook's side.graph.facebook.comis the address of the Graph API.GROUP_IDis a placeholder for the numeric identifier of the group. The report does not give the real value.former_membersis the edge being requested: the list of people who used to be in the group.
That is the whole test. No special tool, no trick, just a request for a list that should have been hidden along with the current one.
Looking at the profiles and usernames that came back, the researcher judged that the accounts belonged to former Facebook employees, or at least to people who had been in that group. The report notes that the usernames were four characters long, which supported that reading.
The report is careful about what this did not expose. It would have let someone see the former members of a Facebook group, but it would not have given access to the member list of Workplace communities or secret groups, because of Facebook's privacy rules.
The timeline was:
| Date | Event |
|---|---|
| Oct 11, 2017 | Report sent |
| Oct 17, 2017 | Information requested by Facebook |
| Oct 30, 2017 | Further investigation by Facebook |
| Dec 6, 2017 | Bounty awarded by Facebook |
The report does not state a severity rating, a CVSS score, a bounty amount or the fix that was applied.
In general, how this kind of bug works
Social platforms store relationships as connections between objects. A group is connected to its members, and it is also connected to people who used to be members. Each of those connections is usually served by its own piece of code. Privacy settings are enforced at the point where a list is returned. If the code that returns the history does not check the same visibility rules as the code that returns the current list, the data leaks even though the screen shows nothing.
A useful comparison is a building with a locked front door and an unlocked side door into the same room. The rule (employees only) is fine. It was simply applied to one entrance and forgotten at the other.
The same pattern appears whenever one thing has several views: current versus archived, active versus deleted, public profile versus internal record, a list versus a single item, and the object itself versus its connections. The bug is rarely a broken rule. It is a rule applied in one place and missed in another.
Defences are structural. Permission should be decided by one central policy that every piece of code for a given object calls, rather than reimplemented for each endpoint. Where a list is restricted, the restriction should sit on the underlying data so that every derived list inherits it. Tests should check that restricted data is absent from every endpoint that can reach it, not just the documented one.
How to test for it
- Find a feature where visibility depends on who you are: a group with a hidden member list, a private project, a restricted organisation page.
- List the related connections and views the API offers for that object. Look for names suggesting history or state: former, previous, archived, deleted, removed, pending, invited, requested, inactive.
- Request each of those as an account that should not see the restricted list, and compare with what a privileged account sees.
- Try the same data through other routes: the object's detail endpoint, search, activity feeds, exports and any other API style that returns the same relationship.
- A positive result is a response that returns identifiers, names or profile references for people who are supposed to be hidden, especially when the current list returns nothing or an error.
Common false positives:
- The returned accounts are public and their membership is already visible elsewhere.
- The connection returns only counts, not identities.
- The data belongs to a group the test account is legitimately allowed to see.
- The response is cached or reflects an old permission state rather than a missing check.
Confirm by repeating with a fresh account that has no relationship to the object, and by checking that the same identifiers are absent from every view you are allowed to see.
How this kind of bug can be fixed
- Apply the same permission policy to historical and derived connections as to the main list.
- Where a list is cleared for a given audience, clear or filter the underlying relationship data so that all endpoints inherit the restriction.
- Audit every piece of code that reads the membership relation and route it through the central check.
- Add regression tests that request each related connection as an unauthorised user and expect an empty or denied response.
Hunting notes
This class of bug tends to hide in features that build up state over time: groups, teams, organisations, repositories, mailing lists and event attendance. Historical connections are added later than the main feature, are used less, and are therefore less likely to have been covered by the original privacy review.
Signals worth following: API documentation or client code that mentions connections named former, previous or archived; screens that show a count of past members but no list; and privacy settings that describe what is hidden without describing what happens to the history.
Glossary
- API: a way for software to ask another service for data or actions, without using the normal web page.
- Graph API: Facebook's API, which returns data as objects and connections rather than as web pages.
- Edge: a named connection between two objects in the Graph API, such as a group and its members.
- Endpoint: a specific address in an API that returns a particular piece of data.
- Request: a message a browser or tool sends to a server asking for something.
- HTTP GET: a request that only reads data and changes nothing.
- Group ID: the identifier that tells the API which group you mean.
- former_members: the edge that lists people who have left a group.
- Member list: the set of people currently in a group.
- Privacy rule: a setting that decides who is allowed to see certain data.
- Access control: the mechanism that checks whether a user is allowed to do or see something.
- Authorisation: the decision about what an authenticated user is permitted to access.
- Root cause: the underlying reason a bug exists, as opposed to its visible symptom.
- Impact: the harm that could result if the bug is exploited.
- Proof of concept: a minimal demonstration that the bug is real.
- Severity: a rating of how serious a bug is.
- CVSS: a standard scoring system for the severity of a vulnerability.
- Bounty: a payment a company makes to someone who reports a valid security bug.
- False positive: a result that looks like a bug but is not one.
- Regression test: an automated test that checks a fixed bug stays fixed.
- Cached: stored temporarily, so an old response may be served instead of a fresh one.
- Workplace: Facebook's product for internal company communication.
- Secret group: a group that does not appear in searches and is only visible to its members.