Skip to content
RCE Advisory Advanced CVE-2019-17557

GHSL-2020-055: Server-Side Template Injection in Apache Syncope (RCE) - CVE-2019-17557

Apache Syncope's mail templates used JEXL expressions with an Uberspector that blocked direct access to getClass and class, but an attacker could still obtain a Class instance via boxed types' TYPE field and use Java reflection to instantiate arbitrary objects, leading to remote code execution.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

A Server-Side Template Injection in the Mail templates was identified in Apache Syncope enabling attackers to inject arbitrary JEXL expressions, leading to a 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

The JEXL sandbox only blocked direct access to getClass and class, but boxed primitive types expose a TYPE field that returns a Class instance, which can then be used with Java reflection.

Impact

This issue may lead to Remote Code Execution, though the report notes that a cross-site scripting issue is needed to deliver the malicious requests to an administrator.

What the attacker needed

Administrator clicks a malicious link; XSS on the same origin

The fix

The issue was addressed in a commit; the report recommends using the Sandboxed Uberspector or a custom whitelist-based one.

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 Syncope lets administrators customise email templates using a small expression language called JEXL. The developers tried to stop templates from reaching dangerous Java features, but a gap let an attacker reach them anyway and run their own code 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.

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.