Skip to content
RCE Write-up Intermediate

A Journey Into Hacking Google Search Appliance

The Google Search Appliance admin console allowed an authenticated user to inject a newline into an SNMP configuration field, which led to command execution when SNMP was queried. A separate file-download servlet checked only for '..' in the path, so an absolute path could be supplied to read arbitrary local files.

DEVCORE Follow

Published on devco.re

Tech Editorials #Google

DEVCORE, on devco.re

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 SNMP configuration value was passed to the underlying snmpd configuration without neutralising newlines, and the download servlet's path check only rejected '..' instead of resolving and confining the path.

Impact

An authenticated admin-console user could run commands as root on the appliance, and the file-read flaw allowed reading local files such as password hashes, which could then be cracked to log in.

What the attacker needed

Access to the admin console; SNMP service enabled; network access to the appliance

How it was found

  1. Log in to the admin console and open the SNMP system-information feature.
  2. Insert a line feed followed by an 'extend' directive into the sysContact value.
  3. Trigger the SNMP extend functionality with snmpwalk to run the command.

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.

The appliance had a settings page where you could type text that was later used by a monitoring service called SNMP. By putting a line break and an extra instruction in that text, the attacker made the appliance run their own command. Separately, a file-download page tried to stop people leaving its folder by blocking the characters '..', but it forgot that a full path starting from the root of the disk also works.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.