Google Exploit – Steal Account Login Email Addresses
A Google Dashboard URL accepted a public Google+ profile ID and, when the requester was logged in, redirected to an account login page whose URL fragment contained the login email address of the account matching that ID. An attacker could therefore map public Google+ profiles to their private login email addresses, enabling targeted phishing.
Published on tomanthony.co.uk
I often spend time poking around Google for security holes as it is a great way to learn and they have a nice bounty program, so it is win win. I’ve previously claimed a bounty for an authorisation bypass that required modifying the payload of a POST request to one of their backend systems, but today’s bug is far…
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.
tl;dr A parameter on Google's account Dashboard URL took a Google+ profile ID and, when the request came from a logged-in session, redirected to the "add session" login page with the target account's login email address pre-filled in the URL fragment. That let anyone map a public Google+ ID to the private login email behind it. Google fixed it and paid a $1337 bounty.
Context
The target was Google's Dashboard, the page where a signed-in user monitors account activity. Google+ profiles are public, and many of them still use the numeric form of the profile URL:
https://plus.google.com/103112588675637065591/posts
while others use a chosen name:
https://plus.google.com/+TomAnthony/posts
The long number in the numeric form is the same account ID that appears throughout the profile page source. In the researcher's own profile source, the ID 114756468015607312300 appeared over 400 times, so these IDs are very much public.
Setup
The researcher was poking around Google as part of its bounty programme, having previously claimed a bounty for an authorisation bypass that required modifying the payload of a POST request to one of Google's backend systems. No special tooling is described for this bug. The precondition is simply a logged-in Google session plus a target's public Google+ profile ID.
Finding it
While getting his bearings on the Dashboard, the researcher did a first pass to see how the site responded to different unauthorised requests. In certain conditions, one such unauthorised request prompted him to log in with Google's "One account. All of Google" login screen, and that screen was pre-populated with the login email address of the account he was not authorised for. That was the signal: an unauthorised request was leaking an identifier it had no business showing.
He traced the behaviour to a URL from a Google email that linked to his Dashboard with an extra parameter:
https://www.google.com/settings/dashboard?uq=114756468015607312300
He recognised the long number as the one in his own Google profile URL, before he changed it to a pretty one. The uq parameter is the account ID.
Exploitation
Step One: swap the ID
Change the ID to someone else's and request the same URL:
https://www.google.com/settings/dashboard?uq=106858636547986185729
You get redirected to a login page, as expected. With no session, the request is simply unauthorised.
Step Two: repeat while logged in
Log in to your own account, then try the same URL again:
https://www.google.com/settings/dashboard?uq=106858636547986185729
The response is a 302 redirect to accounts.google.com, to the "add session" login rather than the primary login page. The redirect target is:
https://accounts.google.com/AddSession?continue=https://www.google.com/settings/dashboard#Email=REDACTED_EMAIL_ADDRESS
The URL contains the login email address for the account identified by the selected ID number, placed in a hash fragment that is used to pre-populate the login field. The researcher noted he was still learning this area and was unsure how that would ever be a good idea. He reported the bug before digging into whether any additional account information leaked.
Step Three: harvest
With the mapping established, an attacker can visit a chosen celebrity's page and get their email (most likely their team's email, though for some more tech-savvy people possibly their actual address). More realistically, an attacker can target specific victims, or write a basic crawler that walks Google+ and ties emails to account ID numbers and to the other social accounts a user lists in their profile, such as Twitter, LinkedIn and Facebook, or their website. That is a good basis for spear phishing, or a first step towards compromising an account.
Root cause
The Dashboard accepted an account ID from the uq parameter and, for a request made by a different logged-in user, redirected to the add-session login flow with that account's login email placed in the URL fragment so the login field could be pre-populated. The ID is public by design, so the only thing standing between an attacker and the email was the redirect itself. The report does not describe the server-side code or the exact mistake.
Impact
Anyone with a Google+ account could have their login email address disclosed, even if they chose not to share it. An attacker could target a specific person by taking their public profile ID, or crawl Google+ to build a database of emails tied to account IDs and linked social accounts. The researcher frames the realistic uses as spear phishing or a first step to account compromise. He did not investigate whether further account information leaked, so the impact beyond the email address is unknown.
Fix
Google fixed the bug and verified the fix. The report does not describe the change made.
Variants to test
- Other parameters that take an account ID. Look for links in emails and settings pages that carry a numeric account identifier, then swap it for another account's public ID while logged in. A positive result is a redirect or page that reveals the other account's login email.
- Login pre-population on other Google properties. Try the add-session flow with a
continueURL pointing at other services. A positive result is the target account's email appearing in the fragment or the login field. - Crawling public profiles for IDs. Collect numeric Google+ IDs from profile pages and feed them to the Dashboard URL. A positive result is a stable mapping from public ID to login email.
- Cross-checking linked accounts. For each harvested email, compare it with the social accounts listed on the profile. A positive result is a consistent link between the email and the person's other identities, which is what makes the data useful for phishing.
Timeline
- March 4th: initial report.
- March 4th: Google replied within 4 hours seeking clarity.
- March 5th: Google notified that the bug was triaged.
- March 6th: Google emailed again following up.
- March 6th: the researcher asked about disclosure; Google asked him to wait until the fix was verified.
- March 7th: Google let him know the bug was fixed and verified.
- March 14th: Google contacted him to confirm a bounty of $1337.
The researcher thanks the Google security team, who were responsive to reply, fast to fix and very communicative.
What happened, in plain words
A security researcher found that a page on Google's website could be made to reveal the email address a person uses to sign in to Google, even when that person had chosen not to share it publicly. He could take a public Google+ profile, swap one number in a web address, and the site would hand back the private login email behind that profile. Google fixed the problem and paid him a bounty of $1337.
This article walks through the whole thing slowly, assuming you have never looked at a security report before. Every term is explained the first time it appears, and there is a glossary at the end.
Some background you need first
What Google+ and the Dashboard are
Google+ was Google's social network. Every person on it had a public profile page, a bit like a personal homepage, showing whatever they chose to share. The Dashboard is a different page: it is the place where a signed-in user can see the activity on their own Google account, such as recent sign-ins and connected services. You only see your own Dashboard, because it belongs to your account.
What a URL and a parameter are
A URL is the address you type into the browser, for example https://www.google.com/settings/dashboard. The part after a question mark is called the query string, and it carries small pieces of information called parameters. Each parameter has a name, an equals sign, and a value, like ?uq=123. Think of a URL as a form you hand to a receptionist: the part before the question mark says which desk you want, and the parameters are the notes you scribble on the form. The website reads those notes and changes what it does.
What an account ID is
An account ID is a long number that uniquely identifies one account, the way a customer number identifies one customer in a shop's records. It is not secret. On Google+, many profile addresses were built from it, and the same number appeared all over the profile page's underlying code. The researcher counted his own ID, 114756468015607312300, more than 400 times in the source of his profile. So anyone can read these numbers; they are public by design.
What a login email address is
The login email address is the address you type into the sign-in box to get into your account. It is different from an address you might display on your profile. You can keep your profile contact details private, but the login address is the key to the account, so leaking it matters.
What a redirect, a 302 and a hash fragment are
When a website wants to send your browser somewhere else, it replies with a redirect. The technical name for the most common redirect reply is a 302. Your browser receives it and automatically loads the new address. It is like a receptionist saying "not this desk, go to the one down the hall".
A hash fragment is the part of a URL that starts with a # symbol. It is used to point at a spot inside a page, and it is handled by the browser rather than sent to the server. That detail becomes important later: the fragment is not transmitted to Google's servers, but it is still visible in the address bar and to anyone who can read the URL.
What a session is
When you sign in, the site gives your browser a small piece of data, often called a session, so it can recognise you on the next page you load without asking for your password again. Being "logged in" simply means your browser is carrying a valid session. A request made without one is called unauthorised: the site does not know who you are and refuses to show private things.
What a bug bounty programme is
A bug bounty programme is a scheme where a company pays people for reporting security flaws responsibly, instead of exploiting them. Google runs one. The researcher had used it before: he had previously earned a bounty for an authorisation bypass, which is a flaw where someone can do something they are not permitted to do, in that case by modifying the payload (the data body) of a POST request (a request that sends data to the server) to one of Google's backend systems. That earlier bug is only mentioned as background; this article is about the simpler one.
How he found it
He was exploring Google's Dashboard to get his bearings, and he did a first pass to see how the site responded to different unauthorised requests. In plain terms, he deliberately asked for things he should not be allowed to see, and watched what came back. Most of the time the answer should be a refusal or a login prompt with nothing private in it.
In certain conditions, one of those unauthorised requests did something odd. It prompted him to log in using Google's "One account. All of Google" login screen, and that screen arrived already filled in with the login email address of the account he was not authorised for. That was the clue: a request that should have revealed nothing was handing over an identifier it had no business showing.
He traced the behaviour back to a link he had received in a Google email. The link pointed at his Dashboard but carried an extra parameter:
https://www.google.com/settings/dashboard?uq=114756468015607312300
Line by line:
https://www.google.com/settings/dashboardis the address of the Dashboard page.?marks the start of the parameters.uq=114756468015607312300is one parameter nameduq, whose value is a long number.
He recognised that long number: it was the account ID from his own Google+ profile address, from before he changed it to a chosen name. So the uq parameter is simply the account ID, written into the URL where anyone can edit it.
The two shapes of a Google+ profile address
Many Google+ profiles still used the numeric form of the address:
https://plus.google.com/103112588675637065591/posts
Here plus.google.com is the Google+ site, 103112588675637065591 is the account ID, and /posts is the part of the profile showing the person's posts. The number in the middle is the same kind of number as the one in the Dashboard link.
Other people had chosen a readable name instead:
https://plus.google.com/+TomAnthony/posts
This is the same site and the same kind of page, but the number has been replaced by a chosen name after a + sign. The researcher's own profile used this form. Crucially, even when the address shows a name, the numeric ID is still present in the page's underlying code, which is why he found his own ID more than 400 times in his profile source. The number is public either way.
The bug, step by step
Step One: swap the ID
He changed the ID in the Dashboard link to someone else's and requested the same address:
https://www.google.com/settings/dashboard?uq=106858636547986185729
Line by line:
- The page address is unchanged:
https://www.google.com/settings/dashboard. - The parameter is still named
uq. - The value is now a different account ID,
106858636547986185729, belonging to someone else.
The result was a redirect to a login page, as expected. With no session, the request is simply unauthorised: the site does not know who is asking, so it asks them to sign in. Nothing private comes back. This step matters because it shows the normal, safe behaviour, which is the baseline you compare against.
Step Two: repeat while logged in
He then signed in to his own account and tried the very same address again:
https://www.google.com/settings/dashboard?uq=106858636547986185729
Line by line, this is identical to the previous request. The only difference is the state of the browser: this time it carries a valid session, so Google knows who is asking. The request is still for someone else's account ID.
The response was a 302 redirect to accounts.google.com, and specifically to the "add session" login page rather than the primary login page. The "add session" page is the screen Google shows when you are already signed in to one account and it wants to add another account to the browser. The address it redirected to was:
https://accounts.google.com/AddSession?continue=https://www.google.com/settings/dashboard#Email=REDACTED_EMAIL_ADDRESS
Line by line:
https://accounts.google.com/AddSessionis the add-session login page.?continue=https://www.google.com/settings/dashboardis a parameter telling Google where to send the browser once the sign-in is done. Here it points back at the Dashboard.#Email=REDACTED_EMAIL_ADDRESSis the hash fragment. It carries the login email address of the account identified by the ID in the original request, and the login page uses it to pre-fill the email box.
So the private login email of the other account was sitting in the address bar, in a part of the URL the browser keeps and displays. The researcher noted that he was still learning this area and was unsure how that could ever be a good idea. He reported the bug before digging into whether any additional account information leaked, so we do not know whether more than the email was exposed.
Step Three: harvest
Once the mapping is established, the abuse is straightforward. An attacker can visit a chosen celebrity's profile and get their email. For most famous people that is likely to be a team or management address, though for some more tech-savvy people it might be their actual address. More realistically, an attacker can target specific victims, or write a basic crawler, a small program that visits pages automatically one after another, to walk Google+ and tie emails to account ID numbers. The same crawl can also collect the other social accounts a user lists on their profile, such as Twitter, LinkedIn and Facebook, or their website. That combination is a good basis for spear phishing, which is a targeted scam email written to look convincing to one particular person, or a first step towards compromising an account.
Why it worked
The Dashboard accepted an account ID from the uq parameter. When the request came from a different logged-in user, it redirected to the add-session login flow and placed that account's login email in the URL fragment so the login field could be pre-filled. The ID is public by design, so the only thing standing between an attacker and the email was the redirect itself. The fragment is not sent to the server, but it is visible to the browser and to anyone reading the URL, which is enough to disclose it. The report does not describe the server-side code or the exact mistake.
What the impact was
Anyone with a Google+ account could have their login email address disclosed, even if they chose not to share it. An attacker could target a specific person by taking their public profile ID, or crawl Google+ to build a database of emails tied to account IDs and linked social accounts. The realistic uses are spear phishing or a first step to account compromise. The researcher did not investigate whether further account information leaked, so the impact beyond the email address is unknown.
The fix
Google fixed the bug and verified the fix. The report does not describe the change made.
Variants to test
These are the kinds of follow-up checks someone could run to see whether the same mistake exists elsewhere. They are described here as ideas, not as things the researcher confirmed.
- Other parameters that take an account ID. Look for links in emails and settings pages that carry a numeric account identifier, then swap it for another account's public ID while logged in. A positive result is a redirect or page that reveals the other account's login email.
- Login pre-population on other Google properties. Try the add-session flow with a
continueURL pointing at other services. A positive result is the target account's email appearing in the fragment or the login field. - Crawling public profiles for IDs. Collect numeric Google+ IDs from profile pages and feed them to the Dashboard URL. A positive result is a stable mapping from public ID to login email.
- Cross-checking linked accounts. For each harvested email, compare it with the social accounts listed on the profile. A positive result is a consistent link between the email and the person's other identities, which is what makes the data useful for phishing.
Timeline
- March 4th: initial report.
- March 4th: Google replied within 4 hours seeking clarity.
- March 5th: Google notified that the bug was triaged.
- March 6th: Google emailed again following up.
- March 6th: the researcher asked about disclosure; Google asked him to wait until the fix was verified.
- March 7th: Google let him know the bug was fixed and verified.
- March 14th: Google contacted him to confirm a bounty of $1337.
The researcher thanks the Google security team, who were responsive to reply, fast to fix and very communicative.
Glossary
- 302: the technical name for the most common kind of redirect reply, telling the browser to load a different address.
- Account ID: a long number that uniquely identifies one account, like a customer number in a shop.
- Add session: the Google login page shown when you are already signed in and want to add another account to the browser.
- Authorisation bypass: a flaw where someone can do something they are not permitted to do.
- Bug bounty programme: a scheme where a company pays people for reporting security flaws responsibly.
- Crawler: a small program that visits web pages automatically, one after another.
- Dashboard: the page where a signed-in user monitors activity on their own Google account.
- Hash fragment: the part of a URL starting with
#, handled by the browser and not sent to the server, but still visible in the address bar. - Login email address: the address you type into the sign-in box to get into your account, as opposed to an address you might display publicly.
- Parameter: a named value in a URL after the question mark, like
uq=123, which the website reads and acts on. - Payload: the data body of a request, as opposed to the address it is sent to.
- POST request: a request that sends data to the server, often used when submitting a form.
- Pre-populate: to fill in a form field automatically before the user types anything.
- Query string: the part of a URL after the question mark that carries parameters.
- Redirect: a reply that sends the browser to a different address.
- Session: a small piece of data your browser carries after you sign in, so the site can recognise you on later pages.
- Spear phishing: a targeted scam email written to look convincing to one particular person.
- Triaged: reviewed and accepted as a genuine report by the security team.
- Unauthorised request: a request made without a valid session, or for something the requester is not permitted to see.
- URL: the address you type into the browser to reach a page.