Skip to content
RCE Advisory Intermediate CVE-2020-11994

GHSL-2020-086, 087, 088, 089 - Server-Side Template Injection in Apache Camel - CVE-2020-11994

Apache Camel's FreeMarker, Velocity, MVEL and Mustache components allowed an attacker who could control certain message headers to inject templates, leading to remote code execution or arbitrary file disclosure. The attacker could override the template content or resource URI via headers such as CamelFreemarkerTemplate and CamelFreemarkerResourceUri.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

Apache Camel FreeMarker, Velocity, MVEL and Moustache components are vulnerable to Server-Side Template Injection (SSTI) leading to Remote Code Execution (RCE) or Arbitrary File Disclosure.

pwntester, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The templating components accepted template content and resource URIs from message headers without proper validation, allowing an attacker to override the intended template and execute arbitrary code or read files.

Impact

This issue leads to Remote Code Execution and Arbitrary File Disclosure.

What the attacker needed

Attacker can control message headers; Camel route uses a vulnerable templating component

How it was found

  1. Set up a Camel route that uses the freemarker component to render a template.
  2. Send a message to the route with a header that overrides the template content.
  3. The template engine executes the attacker-supplied template, running arbitrary commands.
  4. Alternatively, send a header specifying a resource URI to read arbitrary files.

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 report has not been written yet. The Original tab links to the source.

Apache Camel is a tool that helps different systems talk to each other by passing messages. The templating components let you format those messages using templates. The bug is that an attacker could send a message with a special header that replaces the template with their own, and because templates can run code, the attacker could run commands on the server or read files.

What is RCE?

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

More by Alvaro Muñoz

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

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.