GHSL-2020-012: Remote Code Execution - JavaEL Injection (high privileged accounts) in Nexus Repository Manager
High-privilege users could inject Java Expression Language (EL) expressions through various inputs, leading to remote code execution on the server. The vulnerability arises because error messages from JEXL selector validation are passed to a constraint violation factory that evaluates Java EL.
Originally disclosed on GitHub Security Lab
GHSL-2020-012 - Remote Code Execution - JavaEL Injection (high privileged accounts)
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 failed to sanitise user-controlled input before evaluating it as Java EL, specifically when constructing constraint violation messages from exception details.
Impact
This issue may lead to remote code execution by high-privilege users.
What the attacker needed
High-privilege account (e.g., admin)
The fix
Apply `stripJavaEL()` in `HelperValidator` to sanitise messages before creating constraint violations.
How it was found
- Create a JEXL selector by intercepting the request and changing the type from CSEL to JEXL or using the REST API.
- Trigger the content selector upgrade process by waiting for a lifecycle phase change or manually bouncing the lifecycle phase via REST API.
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.
Java Expression Language (EL) is a way to embed dynamic expressions in Java applications. If user input containing EL is evaluated without proper sanitisation, an attacker can run arbitrary code. Here, high-privilege users could inject such expressions via error messages, leading to remote code execution.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.