Skip to content
Info disclosure Write-up Intermediate

We hacked Google’s A.I Gemini and leaked its source code (at least some part)

The Gemini Python sandbox allowed arbitrary code execution, and the researchers used it to read a large binary file from the sandbox filesystem. By extracting and analysing that binary, they found internal Google source code and proto definitions that were not intended for public exposure.

RONI CARTA | LUPIN Follow

Published on depi.security

In 2024 we released the blog post We Hacked Google A.I. for $50,000, where we traveled in 2023 to Las Vegas with Joseph “rez0” Thacker, Justin “Rhynorater” Gardner, and myself, Roni “Lupin” Carta, on a hacking journey that spanned from Las Vegas, Tokyo to France, all in pursuit of Gemini vulnerabilities during…

RONI CARTA | LUPIN, on depi.security

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the sandbox image included a large internal binary that embedded Google source code and proto definitions, and the sandbox permitted arbitrary Python code to read that file.

Impact

The leaked binary contained internal Google source code and proto definitions, which could reveal internal architecture, but the text does not claim direct access to user data or a sandbox escape.

What the attacker needed

Access to Gemini's Python sandbox; ability to run arbitrary Python code

How it was found

  1. Ask Gemini to run a simple Python program and use the 'Run in Sandbox' button.
  2. Replace the generated code with custom Python that uses the os module to list files and permissions.
  3. Locate a large binary file at /usr/bin/entry/entry_point.
  4. Read the binary in chunks and base64-encode each chunk to print it in the console.
  5. Capture the printed chunks through a proxy and reconstruct the file locally.
  6. Run binwalk on the reconstructed binary to extract embedded directories and source code.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A sandbox is a restricted environment meant to safely run code. Here, the code could still read files inside the sandbox, and one of those files contained internal Google code and data definitions. The researchers did not break out of the sandbox; they only read what was already inside it.

What is Info disclosure?

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

More by RONI CARTA | LUPIN

View all

6 more disclosed reports, best first.

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.