Skip to content
Business logic Write-up Beginner

How I am able to hijack you.

The autosuggestion list in Google Search could be manipulated by an attacker simply by making requests to a URL containing a chosen phrase, causing that phrase to appear in the victim's suggestions. An attacker could use this to advertise products, phish credentials, annoy, or embarrass the victim.

terjanq Follow

Published on medium.com

{{media:0}}

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

Context

Google Search's autosuggestion feature shows a list of suggested phrases as a user types into the search box. The list is drawn from phrases the user has previously searched for, so it is effectively a per-user history that is rendered back to them in the UI.

The finding described here is not a code execution bug. It is a logic flaw in how phrases enter that list: the researcher found that the only step required to add an exact phrase into a user's autosuggestion list is to make the user visit a URL of the form https://www.google.com/search?q=phrase. An attacker can therefore make a few requests in the background and put anything into a victim's autosuggestions without the victim noticing.

Image for post
Image for post From the original on medium.com

The title and the intro image make the subject clear: manipulation of the autosuggestion list that pops out when someone searches for phrases on the Google Search website.

Setup

No special accounts, roles or tooling are described. The report does not describe any account or login precondition for the attack. The attacker needs a way to make the victim's browser issue requests to https://www.google.com/search?q=... in the background, which the researcher describes as "a few requests in the background".

Finding it

The researcher was "sniffing around Google Search lately", in the period when Google Search was receiving attention because of the XSS finding by Masato Kinugawa. The researcher found that a plain search URL, with no interaction beyond the visit itself, is enough to add an attacker-chosen phrase to the victim's autosuggestion list. Because the list is presented to the user as their own search history, an attacker who can cause those requests to be made gains a write primitive into a UI element the user trusts.

Exploitation

Step 1: Cause a visit to a search URL

The URL has the following form, where phrase is the text to appear in the autosuggestion list:

HTTP
https://www.google.com/search?q=phrase

The q parameter carries the phrase. Visiting the URL is the whole of the write operation: the phrase is added to the victim's autosuggestion list exactly as supplied. The researcher notes that the attacker can do this "without you even noticing".

Step 2: Wait for the victim to search

When the victim later types into the search box, the injected phrases appear in the autosuggestion dropdown, ahead of the point where the user hits ENTER.

Why an attacker would do this

The researcher lists four motivations, framed as cases that "could impact the users in one way or another".

  1. Advertising the product. A company could flood the visitor's autosuggestion list so that, when the visitor searches for a specific item, the company brand shows up before the user even hits ENTER.
  2. Phishing. The attacker could put phishing sites at the top of the list, for example facebook⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀site:facehook.tk, which would steal credentials when the user attempts to log in.

facebook⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀site:facehook.tk

  1. Annoyance. The goal need not have any security impact. The attacker's only goal could be to flood the autosuggestion list with thousands of phrases, just to annoy. Clicking "remove" a thousand times is frustrating for a user who does not know how to clear all search history at once.
  2. Embarrassment. The attacker could aim to embarrass the victim, for example someone presenting in front of an audience who, in the middle of a speech, searches for something and gets very inappropriate results in the suggestions.

Root cause

The report does not describe the server-side implementation. What it establishes is the behaviour: a search URL with a q parameter is sufficient to persist the phrase into the user's autosuggestion list, .

Impact

The researcher's own assessment is that the finding is a security issue "in a way that could impact a lot of users". The concrete effects are the four cases above: brand advertising, phishing through a convincing-looking suggestion such as the site:facehook.tk example, annoyance by flooding the list, and embarrassment in front of an audience. All of these depend on the attacker being able to make the victim's browser issue the search requests.

Google did not share the view that this was a security bug. The issue was closed as Won't Fix (Intended behavior), with the following exchange quoted in the report:

The flooding one’s autosuggestion doesn’t seem to have a great motivation factor for the attacker, what would they gain out of this?

We think the issue might not be severe enough for us to track it as a security bug.

Fix

No fix was applied: the report was closed as intended behaviour. The researcher states that he fully respects Google's position. The report does not propose a specific remediation.

Relationship to a larger report

The researcher notes that this vulnerability was part of a bigger report related to clickjacking the Google reCAPTCHA, which he describes as a bridge to many other attacks. That material is outside the scope of this article.

Variants to test

  • Other search entry points. Try any URL that records a query into per-user history (search result pages, redirect endpoints, mobile or regional front ends) and check whether a plain visit with an attacker-chosen query is enough to make the phrase appear in the autosuggestion list.
  • Phishing-shaped suggestions. Submit a phrase that mimics a trusted destination, as in the site:facehook.tk example, and check whether it is rendered in the suggestion list without truncation or warning.
  • Bulk flooding. Issue many search URLs in the background and check whether all of them persist in the list.
  • Cross-site triggering. Check whether a third-party page can cause the search requests without user interaction, for example through embedded resources or navigations.

If you are logged into your Google account, the researcher left an easter egg: open google.com in a new tab and start typing terjanq in the search bar.

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

What happened, in plain words

When you type into the Google Search box, a list of suggested phrases drops down under it before you finish typing. That list is called autosuggestions. It is built partly from things you have searched for before, so it works like a personal history that Google shows back to you while you type.

The researcher found that this list can be written to by someone else. The only thing needed to add an exact phrase to your autosuggestion list is for your browser to visit a URL of the form https://www.google.com/search?q=phrase. An attacker can make a few requests in the background and put anything into your autosuggestions without you noticing.

Image for post
Image for post From the original on medium.com

The title and the intro image make the subject clear: manipulation of the autosuggestion list that pops out when someone searches for phrases on the Google Search website.

This is not a bug that lets an attacker run code on your computer. It is a logic flaw: the software does exactly what it was designed to do, but that design can be abused. The abuse here is that a plain visit to a search URL is treated as if you had genuinely searched for that phrase, so the phrase is saved into your history and shown back to you later.

Setup

No special accounts, roles or tools are described. The report does not describe any account or login precondition for the attack. The attacker also needs a way to make the victim's browser send requests to https://www.google.com/search?q=... in the background, which the researcher describes as "a few requests in the background".

Finding it

The researcher was "sniffing around Google Search lately", at a time when Google Search was getting a lot of attention because of an XSS finding by Masato Kinugawa. XSS (cross-site scripting) is a bug where an attacker gets their own code to run inside someone else's website; that finding is a separate story and is only mentioned here as background.

The researcher found that a plain search URL, with no interaction beyond the visit itself, is enough to add an attacker-chosen phrase to the victim's autosuggestion list. Because the list is presented to the user as their own search history, an attacker who can cause those requests to be made gains a way to write into a part of the interface the user trusts.

Exploitation

Step 1: Cause a visit to a search URL

The URL has the following form, where phrase is the text to appear in the autosuggestion list:

HTTP
https://www.google.com/search?q=phrase

Line by line, in plain words:

  • https:// is the scheme, meaning the request travels over an encrypted connection.
  • www.google.com is the address of Google's web server.
  • /search is the path, the part of the site that handles searches.
  • ? starts the query string, the part of a URL that carries extra information.
  • q=phrase is a parameter: the name q (short for query) is set to the value phrase. The server reads this value and treats it as the search term.

Visiting the URL is the whole of the write operation: the phrase is added to the victim's autosuggestion list exactly as supplied. The researcher notes that the attacker can do this "without you even noticing".

Step 2: Wait for the victim to search

When the victim later types into the search box, the injected phrases appear in the autosuggestion dropdown, before the user hits ENTER.

Why an attacker would do this

The researcher lists four motivations, framed as cases that "could impact the users in one way or another".

  1. Advertising the product. A company could flood the visitor's autosuggestion list so that, when the visitor searches for a specific item, the company brand shows up before the user even hits ENTER.
  2. Phishing. The attacker could put phishing sites at the top of the list, for example facebook⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀site:facehook.tk, which would steal credentials when the user attempts to log in. Phishing means tricking someone into entering their username and password on a fake page that looks like the real one.

facebook⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀site:facehook.tk

  1. Annoyance. The goal need not have any security impact. The attacker's only goal could be to flood the autosuggestion list with thousands of phrases, just to annoy. Clicking "remove" a thousand times is frustrating for a user who does not know how to clear all search history at once.
  2. Embarrassment. The attacker could aim to embarrass the victim, for example someone presenting in front of an audience who, in the middle of a speech, searches for something and gets very inappropriate results in the suggestions.

Root cause

The report does not describe how Google implements this on its servers. What it establishes is the behaviour: a search URL with a q parameter is enough to save the phrase into the user's autosuggestion list, .

Impact

The researcher's own assessment is that the finding is a security issue "in a way that could impact a lot of users". The concrete effects are the four cases above: brand advertising, phishing through a convincing-looking suggestion such as the site:facehook.tk example, annoyance by flooding the list, and embarrassment in front of an audience. All of these depend on the attacker being able to make the victim's browser send the search requests.

Google did not share the view that this was a security bug. The issue was closed as Won't Fix (Intended behavior), with the following exchange quoted in the report:

The flooding one’s autosuggestion doesn’t seem to have a great motivation factor for the attacker, what would they gain out of this?

We think the issue might not be severe enough for us to track it as a security bug.

Fix

No fix was applied: the report was closed as intended behaviour. The researcher states that he fully respects Google's position. The report does not propose a specific fix.

Relationship to a larger report

The researcher notes that this vulnerability was part of a bigger report related to clickjacking the Google reCAPTCHA, which he describes as a bridge to many other attacks. Clickjacking means hiding or disguising something clickable so that a visitor clicks it without realising what they are clicking. That material is outside the scope of this article.

Variants to test

  • Other search entry points. Try any URL that records a query into per-user history (search result pages, redirect endpoints, mobile or regional front ends) and check whether a plain visit with an attacker-chosen query is enough to make the phrase appear in the autosuggestion list.
  • Phishing-shaped suggestions. Submit a phrase that mimics a trusted destination, as in the site:facehook.tk example, and check whether it is shown in the suggestion list without truncation or warning.
  • Bulk flooding. Send many search URLs in the background and check whether all of them persist in the list.
  • Cross-site triggering. Check whether a third-party page can cause the search requests without user interaction, for example through embedded resources or navigations.

If you are logged into your Google account, the researcher left an easter egg: open google.com in a new tab and start typing terjanq in the search bar.

Glossary

  • Autosuggestion: the dropdown list of suggested phrases that appears under a search box while you type.
  • Logic flaw: a bug where the software works as designed, but the design can be abused because a rule or check is missing.
  • XSS (cross-site scripting): a bug where an attacker gets their own code to run inside someone else's website.
  • URL: the address of a page or resource on the web, such as https://www.google.com/search?q=phrase.
  • Scheme: the first part of a URL, such as https, which says how the browser should talk to the server.
  • Query string: the part of a URL after the ? that carries extra information to the server.
  • Parameter: a named value in a query string, such as q=phrase, where q is the name and phrase is the value.
  • Phishing: tricking someone into entering their credentials on a fake page that looks like the real one.
  • Credentials: the username and password (or similar) used to log in to an account.
  • Domain: the part of a URL that names the site, such as google.com or facehook.tk.
  • Clickjacking: hiding or disguising something clickable so that a visitor clicks it without realising what they are clicking.
  • reCAPTCHA: Google's challenge used to tell humans apart from automated programs.
  • Won't Fix (Intended behaviour): a bug tracker status meaning the vendor looked at the report and decided the behaviour is by design, so nothing will be changed.

More by terjanq

View all

4 more disclosed reports, best first.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.