Skip to content
Business logic Write-up Beginner

How I Discovered One of My Most Creative Bugs in Google’s Gemini AI Competition

The voting system stored the voting state in the browser's localStorage, so a user could modify that client-side data to cast additional votes. The author reproduced repeated voting by editing the stored value manually and via a script.

momenrezkk90 Follow

Published on medium.com

Cybersecurity

MOAMEN REZK, 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 ran a Gemini AI competition in which teams built projects on the Gemini API and competed through community voting. The flow was deliberately simple: build a project, submit it, collect votes, win. I joined one of the teams, not as a developer but as the person responsible for security testing, with the intention of running a proper penetration test once the project was finished.

That plan did not survive contact with the deadline. By the time the team submitted the final build there was one day left before the competition closed, so there was no time for a full assessment. I stepped back and focused on learning instead, reading around host header attacks, browser behaviour, User-Agent manipulation and creative exploitation techniques. None of it seemed connected to the competition until voting opened.

Setup

The tooling described was Burp Suite, used as an intercepting proxy, plus the browser's developer tools for inspecting client-side state. The precondition for the whole investigation was simply that voting was open and that the team was watching the vote count.

Finding it

Once voting opened, the team WhatsApp group became competitive. Friends, classmates and family were voting, and everyone was watching the numbers. Then a teammate sent a screenshot with a remark along the lines of: a friend had voted twice, once from Chrome and once from Firefox.

That observation raised the obvious question: how was the voting system identifying a voter? My working hypothesis was that the application keyed votes on browser characteristics, and that the User-Agent header might be the discriminator. If so, cycling User-Agent values would let one person generate many votes:

Text
Chrome → 1 voteFirefox → 1 voteSafari → 1 voteOpera → 1 vote

Exploitation

Step 1: intercept the vote request

The plan was to intercept the voting request in Burp Suite, identify the relevant headers, test whether modifying the User-Agent changed the voting behaviour, and automate the process if necessary. I clicked Vote.

Nothing appeared in Burp. I tried again, still nothing. I refreshed the page, restarted the browser and tested again, with the same result.

Step 2: read the absence of traffic as a clue

What caught my attention was not the missing request but the speed. Clicking Vote changed the interface almost instantly: no network delay, no loading state, no wait for a server response. That made me rethink the hypothesis: maybe the vote was not being processed through the network at all.

Step 3: locate the client-side state

Inspecting the client-side behaviour through the browser's developer tools, I found that the voting state was stored in the browser's localStorage. The target of the test therefore changed from an HTTP request to a client-side mechanism controlling whether the interface considered the user to have voted.

Step 4: reproduce additional votes manually

I inspected the application's localStorage in the developer tools and identified the value associated with the voting state. Modifying that client-side data and interacting with the application again reproduced additional votes. In other words, the client-side state could be manipulated to bypass the intended voting restriction.

Step 5: automate the same concept

The manual result was then reproduced with a small JavaScript-based approach following the same four steps:

  1. Identify the relevant voting key.
  2. Modify the stored value.
  3. Save the modified state.
  4. Trigger the application to process the updated state.

The result was that the restriction could be bypassed repeatedly from the client side. What was supposed to represent a single user's vote could be manipulated locally.

Root cause

The defect was not the existence of localStorage. It was the security assumption behind it: the application relied on information controlled by the client to enforce a rule that should have been enforced by the server. A value stored entirely in client-side storage was being treated as trustworthy proof that an action was legitimate, and a user can always modify their own browser storage, their JavaScript and their requests. Any control that depends entirely on the client can therefore be bypassed by that same client. The report does not describe any server-side check that would have caught the manipulation.

Impact

The practical effect was that a single user could reproduce repeated voting behaviour by editing local state. The report does not quantify how many votes could be cast or how the results were weighted, and it does not describe any effect beyond the voting restriction itself.

Reporting and outcome

I reported the issue to Google through the appropriate security channel. Google later informed me that the report was a duplicate of an existing issue, meaning there would be no reward and no unique credit. That did not bother me much: it was the first Google security issue I had found through my own investigation, and the process mattered more than the outcome.

The chain was worth recording precisely because the first hypothesis was wrong. A teammate noticed a double vote, I asked why, formed a hypothesis about the User-Agent, watched it fail when no request appeared, and followed the anomaly (an interface that responded too quickly) into the client-side state where the real issue lived: observation, hypothesis, failed assumption, investigation, discovery.

Fix

Variants to test

  • Other client-side stores. Look for the same pattern in sessionStorage, IndexedDB and cookies that are read by JavaScript rather than validated server-side. A positive result is that editing the stored value and reloading produces a state the server should have refused, such as a second vote, a completed survey or an unlocked feature.
  • Feature gates held in the client. Check whether limits such as free-tier quotas, trial expiries or one-per-account actions are decided from local state. A positive result is that resetting the value restores the allowance without any server-side change.
  • Vote and rating endpoints that do exist. Where a request is sent, replay it with a changed User-Agent, a cleared cookie or a fresh session and see whether the server counts it again. A positive result is a second accepted vote from the same identity.
  • Cross-browser behaviour. Repeat the original observation: vote from two browsers as the same person. A positive result confirms the identity check is weaker than a server-side account binding.
  • Automation resistance. Script the state reset and the triggering interaction in a loop and watch whether any server-side rate limit or anomaly check intervenes. A positive result is many accepted votes with no throttling.

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

What happened, in plain words

Google ran a competition built around its Gemini AI service. Teams made projects with the Gemini API and competed by collecting votes from the community. The idea was simple: build a project, submit it, get votes, win. I joined one of the teams, not to write code but to test the project's security. The plan was to run a proper penetration test, meaning a deliberate attempt to break into the project the way an attacker would, once the project was finished.

That plan did not survive the deadline. By the time the team submitted the final version there was one day left before the competition closed, so there was no time for a full security assessment. I stepped back and spent the time learning instead, reading about host header attacks, how browsers behave, User-Agent manipulation and creative ways of abusing applications. None of it seemed connected to the competition until voting opened.

From the original on medium.com

This article walks through what happened next, in the order it happened, in plain language. If you can use a browser and a computer, you can follow it. Every technical term is explained where it first appears, and there is a glossary at the end.

The setup

The tools described were Burp Suite, a program that sits between your browser and a website so you can watch and change the traffic going back and forth, and the browser's own developer tools, the built-in panel where you can inspect what a page is doing. The only precondition for the whole investigation was that voting was open and that the team was watching the vote count.

Finding it

Once voting opened, the team WhatsApp group became competitive. Friends, classmates and family were voting, and everyone was watching the numbers. Then a teammate sent a screenshot with a remark along the lines of: a friend had voted twice, once from Chrome and once from Firefox.

That observation raised the obvious question: how was the voting system identifying a voter? Think about how a website normally knows who you are. Usually it gives your browser a small piece of data, called a cookie, which the browser sends back on every request, or it asks you to log in and keeps a session on its own servers. My working hypothesis, meaning my best guess to be tested, was that the application keyed votes on browser characteristics, and that the User-Agent header might be the discriminator.

A header is a line of extra information that your browser attaches to every request it sends to a website. The User-Agent header is the one where the browser announces what it is, for example Chrome on Windows or Firefox on a Mac. Websites often read it to decide how to display a page. If the voting system used it to decide who had already voted, then cycling User-Agent values would let one person generate many votes:

Text
Chrome → 1 voteFirefox → 1 voteSafari → 1 voteOpera → 1 vote

Line by line, this is not code but a sketch of the idea. The first line means: send a vote while pretending to be Chrome, and the system counts one vote. The second line means: send a vote while pretending to be Firefox, and the system counts another. The third and fourth do the same for Safari and Opera. The arrow stands for "results in". The whole sketch says that if the server only looks at the browser name, then changing the name is enough to vote again and again.

Exploitation

Step 1: intercept the vote request

The plan was to intercept the voting request in Burp Suite, identify the relevant headers, test whether modifying the User-Agent changed the voting behaviour, and automate the process if necessary. Intercepting means catching the request in Burp before it reaches the server, so you can read it and change it. I clicked Vote.

Nothing appeared in Burp. I tried again, still nothing. I refreshed the page, restarted the browser and tested again, with the same result.

This is worth pausing on, because it is the moment most people give up. The tool was set up correctly, the button was clicked, and yet no traffic showed up. Either the tool was broken, or the vote was not travelling over the network at all.

Step 2: read the absence of traffic as a clue

What caught my attention was not the missing request but the speed. Clicking Vote changed the interface almost instantly: no network delay, no loading state, no wait for a server response. That made me rethink the hypothesis: maybe the vote was not being processed through the network at all. The page was simply changing its own appearance on your computer.

Step 3: locate the client-side state

Inspecting the client-side behaviour through the browser's developer tools, I found that the voting state was stored in the browser's localStorage. Client-side means everything happening inside your own browser, on your machine, as opposed to server-side, which happens on the website's computers. localStorage is a small storage area built into every browser where a website can save data on your computer and read it back later, even after you close the tab. It is like a notebook the website leaves in your house: convenient, but you can read it and write in it too.

The target of the test therefore changed from an HTTP request to a client-side mechanism controlling whether the interface considered the user to have voted. In other words, the question was no longer "what does the server check?" but "what does the page check in my own browser before it shows me the vote button again?"

Step 4: reproduce additional votes manually

I inspected the application's localStorage in the developer tools and identified the value associated with the voting state. Modifying that client-side data and interacting with the application again reproduced additional votes. In other words, the client-side state could be manipulated to bypass the intended voting restriction. Bypass here simply means getting around a rule without satisfying it.

To picture it: imagine a club that stamps your hand at the door and then lets anyone with a stamp back in. If the stamp is on your own hand and you have a pen, the rule is only as strong as your willingness to draw a stamp. Here the "stamp" was a value in localStorage, and the pen was the developer tools.

Step 5: automate the same concept

The manual result was then reproduced with a small JavaScript-based approach following the same four steps:

  1. Identify the relevant voting key.
  2. Modify the stored value.
  3. Save the modified state.
  4. Trigger the application to process the updated state.

JavaScript is the programming language that runs inside web pages; it is what makes buttons respond and pages change without reloading. A key is simply the name under which a value is saved in storage, like a label on a box. So the four steps mean: find the label the site uses for the vote, change what is inside the box, keep the change, and then do whatever makes the page read the box again. The result was that the restriction could be bypassed repeatedly from the client side. What was supposed to represent a single user's vote could be manipulated locally.

Root cause

The defect was not the existence of localStorage. It was the security assumption behind it: the application relied on information controlled by the client to enforce a rule that should have been enforced by the server. A value stored entirely in client-side storage was being treated as trustworthy proof that an action was legitimate, and a user can always modify their own browser storage, their JavaScript and their requests. Any control that depends entirely on the client can therefore be bypassed by that same client. The report does not describe any server-side check that would have caught the manipulation.

A useful comparison is a shop that lets customers write their own receipt. The receipt may look official, but the customer wrote it, so it proves nothing. A security control kept only in the browser is that receipt.

Impact

The practical effect was that a single user could reproduce repeated voting behaviour by editing local state. Integrity here means the results reflect real votes rather than edited ones. The report does not quantify how many votes could be cast or how the results were weighted, and it does not describe any effect beyond the voting restriction itself.

Reporting and outcome

I reported the issue to Google through the appropriate security channel. Google later informed me that the report was a duplicate of an existing issue, meaning there would be no reward and no unique credit. A duplicate means someone else had already reported the same problem, so the finding was already known. That did not bother me much: it was the first Google security issue I had found through my own investigation, and the process mattered more than the outcome.

The chain was worth recording precisely because the first hypothesis was wrong. A teammate noticed a double vote, I asked why, formed a hypothesis about the User-Agent, watched it fail when no request appeared, and followed the anomaly, an interface that responded too quickly, into the client-side state where the real issue lived: observation, hypothesis, failed assumption, investigation, discovery.

Fix

In plain terms, the club should keep the list of who has entered at the door, not on the visitor's hand.

Variants to test

If you want to look for the same pattern yourself, these are the places to look. Each one describes what to try and what a positive result looks like.

  • Other client-side stores. Look for the same pattern in sessionStorage, IndexedDB and cookies that are read by JavaScript rather than validated server-side. sessionStorage is like localStorage but is wiped when you close the tab; IndexedDB is a larger database inside the browser. A positive result is that editing the stored value and reloading produces a state the server should have refused, such as a second vote, a completed survey or an unlocked feature.
  • Feature gates held in the client. Check whether limits such as free-tier quotas, trial expiries or one-per-account actions are decided from local state. A positive result is that resetting the value restores the allowance without any server-side change.
  • Vote and rating endpoints that do exist. Where a request is sent, replay it with a changed User-Agent, a cleared cookie or a fresh session and see whether the server counts it again. An endpoint is simply the address a request is sent to. A positive result is a second accepted vote from the same identity.
  • Cross-browser behaviour. Repeat the original observation: vote from two browsers as the same person. A positive result confirms the identity check is weaker than a server-side account binding.
  • Automation resistance. Script the state reset and the triggering interaction in a loop and watch whether any server-side rate limit or anomaly check intervenes. A rate limit is a cap on how often something can be done in a period of time. A positive result is many accepted votes with no throttling.

Glossary

  • API: a defined way for one piece of software to ask another for something, like a waiter taking your order to the kitchen.
  • Burp Suite: a tool that sits between your browser and a website so you can watch and modify the traffic.
  • Bypass: getting around a rule without satisfying it.
  • Client-side: happening inside your own browser, on your machine.
  • Cookie: a small piece of data a website stores in your browser and your browser sends back with each request, often used to recognise you.
  • Developer tools: the built-in panel in a browser for inspecting and changing what a page is doing.
  • Duplicate: a report of a problem that someone else has already reported.
  • Endpoint: the address a request is sent to.
  • Header: a line of extra information attached to a request or response, such as the browser's name.
  • Host header attack: an attack that abuses the header telling a server which site name was requested.
  • HTTP: the language browsers and websites use to talk to each other.
  • Hypothesis: a best guess that you then test.
  • IndexedDB: a larger database built into the browser for storing data on your machine.
  • Integrity: the property that data or results are genuine and have not been tampered with.
  • Intercept: to catch a request before it reaches the server so you can read or change it.
  • JavaScript: the programming language that runs inside web pages.
  • Key: the name under which a value is saved in storage.
  • localStorage: a small storage area in the browser where a website can save data on your machine and read it back later.
  • Penetration test: a deliberate, authorised attempt to break into a system the way an attacker would.
  • Rate limit: a cap on how often an action can be performed in a period of time.
  • Server-side: happening on the website's own computers, out of the user's reach.
  • sessionStorage: like localStorage, but cleared when the tab is closed.
  • User-Agent: the header in which a browser announces what it is, such as Chrome or Firefox.
  • Vote inflation: making the vote count larger than the number of genuine votes.

More by momenrezkk90

View all

4 more disclosed reports, best first.

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.