Skip to content
RCE Advisory Advanced

GHSL-2020-204: Server-Side Template Injection in Corona Warn App Server

The Corona Warn App Server used Java Bean Validation custom constraint validators that interpolated attacker-controlled strings into error message templates, allowing Java EL expression injection. An unauthenticated attacker could send a crafted submission payload to execute arbitrary code on the server with the Submission service account privileges.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

A Server-Side Template Injection was identified in Corona Warn App Server enabling attackers to inject arbitrary Java EL expressions, leading to un-auth Remote Code Execution (RCE) vulnerability.

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

Likely the application passed untrusted input into a constraint violation message template that supports Java EL interpolation, without escaping or disabling expression evaluation.

Impact

This issue leads to Remote Code execution with the privileges of the Submission service account; the endpoint required no authentication, so any attacker could attempt it.

What the attacker needed

No authentication required; Network access to the submission endpoint

How it was found

  1. Send a POST request to the submission endpoint /version/v1/diagnosis-keys with a crafted payload.
  2. Include a visited country or origin country value containing a Java EL expression.
  3. The server validates the payload and builds an error message that includes the injected expression.
  4. The expression is evaluated, executing arbitrary Java code.

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.

The server checked incoming data and built error messages by inserting parts of that data directly into a template. That template language can run code, so a malicious value could make the server execute commands. Because the endpoint accepted requests without login, anyone could try this.

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.