Skip to content
Info disclosure Write-up Beginner

User’s location diclosure in the Nearby Friends

The Nearby Friends feature on Facebook's Android app leaked users' location updates through its search function even when users had turned off location sharing, paused it, or restricted it to specific friends. An attacker could see the location of friends who had explicitly chosen not to share it.

Yavor Rusev Follow

Published on otmastimi.medium.com

Bounty$15,500 View original

Hello guys my name is Yavor Rusev and i am doing this writeup as a newbie in the Bug Bounty programs.

Явор Русев, on otmastimi.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. 9 min read.

Context

Facebook's Nearby Friends was a product that let a user share their location with selected friends. The feature had its own main window, where a user sees the friends they are sharing with and who is sharing with them, and a search tab inside the product. It also had privacy controls: sharing with specific friends, excluding specific friends, and a pause option that stops sharing for a chosen period (the report mentions 1h, 8h and 24h).

The author, Yavor Rusev, describes himself as a 3D artist and digital marketing expert with moderate web security skills, and frames the whole thing as functional bugs rather than anything found through deep code inspection. The write-up covers three separate reports against the same product, all of the same shape: the main window respects the user's privacy decision, but the search tab inside Nearby Friends does not.

Setup

No special tooling is described. The third report lists the product area as Facebook, Android, and the author mentions installing a fresh copy of Facebook on another phone. and the author mentions installing a fresh copy of Facebook on another phone to rule out a local glitch. The roles used across the reports are:

  • User A: the victim, whose location is being shared or hidden.
  • User B: a friend who is allowed to see A's location, or in the second report the person A wants to hide from.
  • User C: the unintended friend, the "stalker" in the author's wording, who should not see A's location.

For the first report the precondition was simply that the victim had Nearby Friends turned off. For the second, the victim used the "Specific Friends" or "Friends Except" setting. For the third, the victim had Nearby Friends on but paused.

Finding it

At the end of February the author noticed he could see location updates of friends who had Nearby Friends turned off, by going to the search feature inside the Nearby Friends product. He initially assumed it was his phone or a one-day glitch, but the behaviour persisted, so he installed a fresh copy of Facebook on another phone and could still see a friend's location. He told his close friends about it and advised them to turn off location from their phone settings.

His description of the scale is his own: he says that as soon as users opened the Facebook app their location was updated in the search feature in Nearby Friends, and that literally 30% of Facebook users worldwide were walking GPS systems. That figure is his characterisation, not a measurement shown in the report.

His first report went in on 8 March. The Facebook team initially said they could not reproduce it and argued the location shown was just the last one recorded before Nearby Friends was turned off. The author then made a video with white hat users demonstrating the actual problem, after which the issue was reproduced and sent to the product team. This is the private video he sent:

https://youtu.be/AIJiysMg8VE

After the fix everything looked normal. While waiting two weeks for a bounty decision he kept investigating, because in his words the product was a complete mess and almost every setting had a location leak. He found that "Specific Friends" and "Friends Except" were still affected by the same search problem, and filed a second report. Later, still inspecting the product, he found that the pause feature had the same flaw, and filed a third.

Exploitation

Step 1: victim has Nearby Friends turned off

The author does not give numbered reproduction steps for the first report. The behaviour he describes is that a friend who never turned on Nearby Friends in their life still had location updates visible to him in the search feature of the Nearby Friends product, on a fresh install on a second phone. The report contains no request, response or payload for this case.

Step 2: victim shares with "Specific Friends"

User A and User B are a couple. User A decides to share his nearby friends location only with User B via the option "Share location with specific friends". In the main window User A can see only User B, and by the privacy rules only User B should see User A's location.

User C, the stalker, activates Nearby Friends, goes to the main menu of Nearby Friends and cannot see User A there. But when User C searches for User A in the search tab, he can see User A's private location updates in the search list, in the form the author quotes as:

Text
2km 2min ago

When User C clicks on User A, the app does not show him the map and only redirects him to the main window, but the location updates remain visible in the search list.

Step 3: victim uses "Friends Except"

User A wants to hide his location from his boss, User B, and adds him to the "Friends Except" list. User B cannot see User A's location in the main Nearby Friends window, but when he goes to the search tab he can clearly see User A's location updates in the search list, despite User A's decision to hide the location from him.

The author's own summary of the second report is that it was quickly reproduced and fixed and received a 5000$ bounty, while the first report's bounty decision was still pending; the timeline gives 5250$ including the bonus for the second report. The timeline at the end of the write-up gives 5250$ including the bonus for the second report, so the two figures in the text differ.

Step 4: victim is on pause

The third report is titled "Nearby Friends" PAUSE feature not working properly, User's location disclosed while on pause, with vuln type Privacy / Authorization and product area Facebook, Android. The author notes that when a user pauses their location for 1h, 8h or 24h, Facebook shows a message that "You are currently not sharing your location", but while on pause an unintended friend can still see User A's location updates in the search feature.

The reproduction steps, as written in the report:

Text
Setup
===

Try to reproduce it the following way :

1. Turn ON “Nearby Friends” on USER A

2. Pause “Nearby Friends” on USER A

3. Turn ON “Nearby Friends” on USER B

4. In main window of “NEARBY FRIENDS” USER B cant see USER A’s location but when USER B goes to the search feature he can clearly see USER A updates, despite USER A is on PAUSE.

So the main window correctly hides the paused user, and only the search list leaks the updates. The author's stated impact is that a malicious friend can see location updates of friends who have Nearby Friends on pause and do not want their location exposed for that period, which could lead to a serious leak of the victim's location.

This third report was quickly triaged and fixed in a few days. The author received 5000$ for the first vulnerability and 5250$ including the bonus for the third.

Timeline

The report closes with the following dates.

Report Event Date
First Reported location disclosure in almost every user with turned off Nearby Friends 8 March
First Bug reproduced 23 March
First Sent to the product team 24 March
First Bug fixed 7 April
First Bounty 5000$ awarded 3 June
Second Report sent for Friends Except and Specific Friends settings 23 April
Second New bug triaged by Fizz 1 May
Second Bug fixed 5 May
Second Bounty 5250$ awarded (including bonus) 12 May
Third Report sent for location disclosure in PAUSE feature 20 May
Third Reproduced by FB team 20 May
Third Sent to the product team 22 May
Third Fixed 1 June
Third Bounty 5250$ awarded (including bonus) 11 June

Root cause

The report does not describe the code or the backend design, so the cause can only be inferred from behaviour. In all three cases the main Nearby Friends window applied the user's privacy decision correctly, while the search list inside the same product returned location updates for friends who should have been filtered out. That pattern suggests the search path used a different query or a different authorisation check from the main window, one that did not account for the sharing setting, the exclusion list or the pause state. The author's own framing is that these are functional bugs, not the result of deep code inspection.

The first report also shows a defence that did not hold: the initial triage response treated the displayed location as the last recorded value from before the feature was turned off, and only the video with white hat users moved it to reproduction. Only the video with white hat users moved it to reproduction.

Impact

For the first report, the exposed group was friends who had Nearby Friends turned off entirely, and the author states that as soon as they opened the Facebook app their location was updated in the search feature. For the second, the exposed group was friends the victim had deliberately limited sharing to, or deliberately excluded, including the boss example. For the third, it was friends the victim had paused sharing with for a chosen window.

In the second report the attacker is a friend of the victim who has Nearby Friends active and uses the search tab. In the second report the leak is the location update entry in the search list, with distance and age as shown in the example, not the map: clicking the entry redirects to the main window instead of showing the map. The author's impact statement for the third report is that this could lead to a serious leak such as the victim's location.

Fix

All three issues were fixed by Facebook, according to the timeline: the first on 7 April, the second on 5 May and the third on 1 June. The report does not say what was changed. The behaviour that needed to change is the search list inside Nearby Friends, so that it applies the same sharing, exclusion and pause rules as the main window.

Variants to test

  1. Compare every surface of a privacy-sensitive feature against its main screen. For each friend who should be hidden, search for them by name and check whether a distance and timestamp entry appears. A positive result is an entry such as the distance and age pair shown above for a friend the settings exclude.
  2. Test each privacy control separately: sharing off, sharing with specific friends, exclusion lists, and time-limited pause. A positive result is any one control where the main window hides the friend but another list, search or suggestion surface still shows their updates.
  3. Test the transition states, not just the steady state. Turn sharing off or pause it, then have the other account open the app and search. A positive result is a fresh update appearing after the control was applied.
  4. Test on a second device and a fresh install, as the author did, to rule out cached local state. A positive result is the same leak on the clean install.
  5. When triage says the data is stale, capture a sequence of updates over time rather than a single reading. A positive result is the displayed distance and age changing while the victim's sharing is off or paused.
  6. Check whether clicking a leaked entry exposes more than the list does, for example a map or a precise position. In this report clicking only redirected to the main window, so a positive result elsewhere would be a worse outcome than the one described here.

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. 13 min read.

What happened, in plain words

Facebook used to have a feature called Nearby Friends. It let you share your location with chosen friends, so they could see roughly where you were and how far away. The feature had a main window, where you see the friends you share with and who shares with you, and it had a search tab inside the same product, where you could look up a friend by name.

It also had privacy controls. You could share with specific friends only, you could exclude specific friends, and you could pause sharing for a chosen period (the report mentions 1h, 8h and 24h).

The author, Yavor Rusev, describes himself as a 3D artist and digital marketing expert with moderate web security skills. He frames the whole thing as functional bugs, not something found through deep code inspection. The write-up covers three separate reports against the same product, and all three have the same shape: the main window respects the user's privacy decision, but the search tab inside Nearby Friends does not.

A quick word on the idea behind this class of bug. When a product has a privacy setting, the server is supposed to check that setting every time it hands out the protected data. If one screen checks the setting and another screen forgets to, the data leaks through the screen that forgot. Security people call this an information disclosure or a broken access control problem. The everyday comparison: a building where the front desk checks your badge, but the side door to the same floor is left unlocked. The lock exists, it is just not on every door.

Setup

No special tooling is described. The third report lists the product area as Facebook, Android, and the author mentions installing a fresh copy of Facebook on another phone. and the author mentions installing a fresh copy of Facebook on another phone to rule out a local glitch. A fresh install matters because a phone can hold on to old data in its local storage; if the same result appears on a clean install, the data is coming from Facebook's servers, not from the phone.

The roles used across the reports are:

  • User A: the victim, whose location is being shared or hidden.
  • User B: a friend who is allowed to see A's location, or in the second report the person A wants to hide from.
  • User C: the unintended friend, the "stalker" in the author's wording, who should not see A's location.

For the first report the precondition was simply that the victim had Nearby Friends turned off. For the second, the victim used the "Specific Friends" or "Friends Except" setting. For the third, the victim had Nearby Friends on but paused.

Finding it

At the end of February the author noticed he could see location updates of friends who had Nearby Friends turned off, by going to the search feature inside the Nearby Friends product. He first assumed it was his phone or a one-day glitch, but the behaviour kept happening, so he installed a fresh copy of Facebook on another phone and could still see a friend's location. He told his close friends about it and advised them to turn off location from their phone settings.

His description of the scale is his own: he says that as soon as users opened the Facebook app their location was updated in the search feature in Nearby Friends, and that literally 30% of Facebook users worldwide were walking GPS systems. That figure is his characterisation, not a measurement shown in the report.

His first report went in on 8 March. The Facebook team first said they could not reproduce it and argued the location shown was just the last one recorded before Nearby Friends was turned off. The author then made a video with white hat users demonstrating the actual problem, after which the issue was reproduced and sent to the product team. This is the private video he sent:

https://youtu.be/AIJiysMg8VE

After the fix everything looked normal. While waiting two weeks for a bounty decision he kept investigating, because in his words the product was a complete mess and almost every setting had a location leak. He found that "Specific Friends" and "Friends Except" were still affected by the same search problem, and filed a second report. Later, still inspecting the product, he found that the pause feature had the same flaw, and filed a third.

Exploitation

Step 1: victim has Nearby Friends turned off

The author does not give numbered reproduction steps for the first report. The behaviour he describes is that a friend who never turned on Nearby Friends in their life still had location updates visible to him in the search feature of the Nearby Friends product, on a fresh install on a second phone. The report contains no request, response or payload for this case.

Step 2: victim shares with "Specific Friends"

User A and User B are a couple. User A decides to share his nearby friends location only with User B via the option "Share location with specific friends". In the main window User A can see only User B, and by the privacy rules only User B should see User A's location.

User C, the stalker, activates Nearby Friends, goes to the main menu of Nearby Friends and cannot see User A there. But when User C searches for User A in the search tab, he can see User A's private location updates in the search list, in the form the author quotes as:

Text
2km 2min ago

That line is what the search result entry looks like: a distance (2km) and how long ago the update was recorded (2min ago). It is the leak in its smallest form. The main window hides User A from User C, but the search list shows that User A was 2km away two minutes ago.

When User C clicks on User A, the app does not show him the map and only redirects him to the main window, but the location updates remain visible in the search list. So the map is protected, the list is not.

Step 3: victim uses "Friends Except"

User A wants to hide his location from his boss, User B, and adds him to the "Friends Except" list. User B cannot see User A's location in the main Nearby Friends window, but when he goes to the search tab he can clearly see User A's location updates in the search list, despite User A's decision to hide the location from him.

The author's own summary of the second report is that it was quickly reproduced and fixed and received a 5000$ bounty, while the first report's bounty decision was still pending; the timeline gives 5250$ including the bonus for the second report. The timeline at the end of the write-up gives 5250$ including the bonus for the second report, so the two figures in the text differ.

Step 4: victim is on pause

The third report is titled "Nearby Friends" PAUSE feature not working properly, User's location disclosed while on pause, with vuln type Privacy / Authorization and product area Facebook, Android. The author notes that when a user pauses their location for 1h, 8h or 24h, Facebook shows a message that "You are currently not sharing your location", but while on pause an unintended friend can still see User A's location updates in the search feature.

The reproduction steps, as written in the report:

Text
Setup
===

Try to reproduce it the following way :

1. Turn ON “Nearby Friends” on USER A

2. Pause “Nearby Friends” on USER A

3. Turn ON “Nearby Friends” on USER B

4. In main window of “NEARBY FRIENDS” USER B cant see USER A’s location but when USER B goes to the search feature he can clearly see USER A updates, despite USER A is on PAUSE.

Line by line: the first line is just a heading, and the === under it is a plain-text way of underlining a heading. The next line introduces the steps. Step 1 turns the feature on for the victim, so there is something to share. Step 2 pauses it, which is the privacy decision being tested. Step 3 turns the feature on for the other person, so they have a search tab to use. Step 4 is the observation: the main window correctly hides the paused user, but the search feature still shows their updates. The point of the sequence is that the only thing that changed between the correct behaviour and the leak is which screen you look at.

So the main window correctly hides the paused user, and only the search list leaks the updates. The author's stated impact is that a malicious friend can see location updates of friends who have Nearby Friends on pause and do not want their location exposed for that period, which could lead to a serious leak of the victim's location.

This third report was quickly triaged and fixed in a few days. The author received 5000$ for the first vulnerability and 5250$ including the bonus for the third.

Timeline

The report closes with the following dates.

Report Event Date
First Reported location disclosure in almost every user with turned off Nearby Friends 8 March
First Bug reproduced 23 March
First Sent to the product team 24 March
First Bug fixed 7 April
First Bounty 5000$ awarded 3 June
Second Report sent for Friends Except and Specific Friends settings 23 April
Second New bug triaged by Fizz 1 May
Second Bug fixed 5 May
Second Bounty 5250$ awarded (including bonus) 12 May
Third Report sent for location disclosure in PAUSE feature 20 May
Third Reproduced by FB team 20 May
Third Sent to the product team 22 May
Third Fixed 1 June
Third Bounty 5250$ awarded (including bonus) 11 June

Root cause

The report does not describe the code or the backend design, so the cause can only be inferred from behaviour. In all three cases the main Nearby Friends window applied the user's privacy decision correctly, while the search list inside the same product returned location updates for friends who should have been filtered out. That pattern suggests the search path used a different query or a different authorisation check from the main window, one that did not account for the sharing setting, the exclusion list or the pause state. The author's own framing is that these are functional bugs, not the result of deep code inspection.

The first report also shows a defence that did not hold: the initial triage response treated the displayed location as the last recorded value from before the feature was turned off, and only the video with white hat users moved it to reproduction. Only the video with white hat users moved it to reproduction.

Impact

For the first report, the exposed group was friends who had Nearby Friends turned off entirely, and the author states that as soon as they opened the Facebook app their location was updated in the search feature. For the second, the exposed group was friends the victim had deliberately limited sharing to, or deliberately excluded, including the boss example. For the third, it was friends the victim had paused sharing with for a chosen window.

In the second report the attacker is a friend of the victim who has Nearby Friends active and uses the search tab. In the second report the leak is the location update entry in the search list, with distance and age as shown in the example, not the map: clicking the entry redirects to the main window instead of showing the map. The author's impact statement for the third report is that this could lead to a serious leak such as the victim's location.

Fix

All three issues were fixed by Facebook, according to the timeline: the first on 7 April, the second on 5 May and the third on 1 June. The report does not say what was changed. The behaviour that needed to change is the search list inside Nearby Friends, so that it applies the same sharing, exclusion and pause rules as the main window.

Variants to test

  1. Compare every surface of a privacy-sensitive feature against its main screen. For each friend who should be hidden, search for them by name and check whether a distance and timestamp entry appears. A positive result is an entry such as the distance and age pair shown above for a friend the settings exclude.
  2. Test each privacy control separately: sharing off, sharing with specific friends, exclusion lists, and time-limited pause. A positive result is any one control where the main window hides the friend but another list, search or suggestion surface still shows their updates.
  3. Test the transition states, not just the steady state. Turn sharing off or pause it, then have the other account open the app and search. A positive result is a fresh update appearing after the control was applied.
  4. Test on a second device and a fresh install, as the author did, to rule out cached local state. A positive result is the same leak on the clean install.
  5. When triage says the data is stale, capture a sequence of updates over time rather than a single reading. A positive result is the displayed distance and age changing while the victim's sharing is off or paused.
  6. Check whether clicking a leaked entry exposes more than the list does, for example a map or a precise position. In this report clicking only redirected to the main window, so a positive result elsewhere would be a worse outcome than the one described here.

Glossary

  • Nearby Friends: a Facebook product that let users share their location with selected friends, with a main window and a search tab.
  • Main window: the main screen of Nearby Friends, where you see the friends you share with and who shares with you.
  • Search tab: the search screen inside Nearby Friends, where you look up a friend by name.
  • Privacy control: a setting that decides who is allowed to see your data, such as sharing with specific friends, excluding friends, or pausing.
  • Information disclosure: a bug where data that should be kept private is shown to someone who should not see it.
  • Broken access control: a bug where a system fails to check whether a user is allowed to see or do something.
  • Authorization: the check that decides whether a user is allowed to access a resource.
  • Functional bug: a bug in how a feature behaves, rather than a flaw found by reading the code.
  • Reproduce: to make a bug happen again on purpose, so it can be confirmed and fixed.
  • Triage: the first review of a bug report, where the team confirms the issue and decides how serious it is.
  • Bounty: a payment a company gives a researcher for reporting a valid security bug.
  • Bonus: an extra payment on top of the base bounty, for example for a well-written report or a serious issue.
  • White hat: a security researcher who tests systems with permission and reports problems to the owner.
  • Stale data: old data that is shown after it should no longer be current.
  • Fresh install: installing an app again from scratch, with no old data left on the device.
  • Local storage: data an app keeps on the phone itself, as opposed to data fetched from the server.
  • Server: the computer that holds the data and sends it to the app.
  • Payload: the specific input or request used to trigger a bug.
  • Request: a message an app sends to a server asking for data or an action.
  • Response: the message a server sends back.
  • Endpoint: a specific address on a server that an app talks to.
  • API: a way for one program to talk to another, like a menu of requests a server accepts.
  • Cookie: a small piece of data a website stores in your browser to remember who you are.
  • Token: a piece of data used to prove who you are, similar to a cookie.
  • Session: a period during which a server remembers that you are logged in.
  • Vulnerability class: a category of bug, such as information disclosure or broken access control.
  • Impact: the harm a bug can cause if someone abuses it.
  • Root cause: the underlying reason a bug happens.
  • GPS: the satellite system a phone uses to work out its location.
  • Android: the operating system used by many phones.
  • iOS: the operating system used by Apple phones.
  • CTF: a capture-the-flag exercise, a practice challenge for security learners.
  • SSL/TLS: the technology that encrypts traffic between your browser and a website.
  • Cloud: computers rented over the internet instead of owned on site.
  • NFT: a digital item recorded on a blockchain, often used for art.
  • Crypto: short for cryptocurrency, digital money.
  • Podcast: an audio show you listen to online.
  • Audiobook: a book read aloud, usually as an audio file.
  • Medium: a website where people publish articles.
  • App Store: Apple's store for downloading iPhone apps.
  • Google Play: Google's store for downloading Android apps.

More from Meta

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.