Skip to content
RCE Write-up Advanced

Remote Code Execution via Server Side Template Injection at OFBiz 13.07.03 (CVE-2016-4462)

Apache OFBiz 13.07.03 was vulnerable to server-side template injection in its Freemarker template engine, which could allow an attacker to execute arbitrary code on the server. The exploit required a valid session with the server, which the author notes is often only an inconvenience for an attacker.

insinuator.net

Published on insinuator.net

this blog post is about Server Side Template Injections for the Apache Freemarker Template Engine, how to detect them, how to craft an exploit and what countermeasures can be implemented. Server Side Template Injections are critical because they often allow even Remote Code Execution, like the exploit of Apache OFBiz…

The author, on insinuator.net

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 user-controlled input was passed into the Freemarker template engine without sanitisation, allowing template expressions to be evaluated on the server.

Impact

An attacker with a valid session could achieve remote code execution on the OFBiz server.

What the attacker needed

A valid session with the server

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 template engine is software that fills in placeholders in a page to produce the final output. Server-side template injection happens when user input is treated as part of the template itself, so an attacker can insert template instructions that the server then runs. In this case that could let an attacker run their own commands on the server, though they first needed to be logged in.

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.