Skip to content
RCE Write-up Advanced

The issue

The AbstractService class in Apache Olingo deserialised Base64-encoded, GZIP-compressed metadata using Java's default ObjectInputStream without any class filtering. An attacker who could supply malicious metadata to a class extending AbstractService could potentially execute arbitrary code.

medium.com

Published on medium.com

Some time ago I wrote about one security issue which I found in the library. This post describes another little vulnerability in Apache Olingo.

Artem Smotrakov, 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.

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 constructor of AbstractService used Java's default ObjectInputStream to deserialise metadata without restricting which classes could be instantiated.

Impact

The severity depends on how the application uses AbstractService and where the metadata comes from; if an attacker can feed malicious metadata, it could result in code execution.

What the attacker needed

Application uses AbstractService; attacker can supply metadata to it

The fix

The fix added a factory method that creates a ValidatingObjectInputStream with a whitelist of allowed classes (by default only org.apache.olingo classes), and the constructor now uses it; the patch was released in Apache Olingo 4.7.0.

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.

Java can turn a stream of bytes back into objects, a process called deserialisation. If an application deserialises data from an untrusted source without checking which classes are allowed, an attacker can craft data that creates dangerous objects and may run their own code. Here, a library class accepted such data without any checks.

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.