Skip to content
RCE Write-up Advanced

Discovering Rhino’s Blind Spot

A JavaScript sandbox in Apigee allowed a proxy developer to bypass class restrictions by uploading a Java class under an allowed package prefix via JavaCallout, then invoking its method from JavaScript to execute system commands. An attacker with the ability to deploy a proxy could achieve remote code execution on the server.

bugs.exposed

Published on bugs.exposed

Comment

The author, on bugs.exposed

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

The ClassShutter allowlist checked only package name prefixes, so a developer-supplied class could be placed under an allowed prefix and then its object shared with JavaScript, bypassing the Java Security Manager restrictions that applied to direct JavaCallout execution.

Impact

An attacker with the ability to deploy a proxy could execute arbitrary system commands on the server, leading to system compromise, data exfiltration, and further attacks.

What the attacker needed

Ability to deploy an API proxy with custom code

The fix

The issue was fixed by Google, though the text does not detail the exact fix.

How it was found

  1. Create a Java class in a package that matches an allowed prefix, with a method that executes system commands.
  2. Deploy a JavaCallout policy that instantiates the class and stores the object in a flow variable.
  3. Create a JavaScript policy that retrieves the object from the flow variable and calls its command-execution method.
  4. Deploy the proxy and send a request to trigger the policies, observing the command execution via an out-of-band callback.

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.

Apigee is a tool for managing APIs. It lets developers run custom code, but tries to stop that code from doing dangerous things like running system commands. The researcher found that by naming their own Java class to look like it belonged to Apigee, they could sneak it past the restrictions and then use JavaScript to run commands on the server.

What is RCE?

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

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.