GHSL-2020-011: Remote Code Execution - JavaEL Injection (low privileged accounts) in Nexus Repository Manager
Any authenticated user, regardless of permissions, could inject Java Expression Language (EL) expressions that were evaluated by the server, leading to remote code execution. The vulnerability was in the ConstraintViolationFactory where user-controlled data was passed to buildConstraintViolationWithTemplate without sanitisation.
Originally disclosed on GitHub Security Lab
It is possible for any authenticated user, no matter the permissions granted, to run arbitrary code on the server (with Nexus process privileges) by injecting arbitrary Java Expression Language (EL) expressions.
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 mitigation stripJavaEL() was not applied to ConstraintViolationFactory, so user-controlled data passed to createViolation was evaluated as Java EL.
Impact
This issue may lead to Remote Code execution by any low-privilege user.
What the attacker needed
A low-privileged authenticated account
The fix
Apply stripJavaEL() in HelperValidator to sanitise the message before building the constraint violation.
How it was found
- Authenticate to Nexus Repository Manager with any low-privileged account.
- Create or update a GoLang group repository, providing a malicious member name that contains a Java EL expression.
- The server validates the group members and passes the malicious member name to createViolation, which evaluates the EL expression, leading to code execution.
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 is evaluated as EL without proper sanitisation, an attacker can execute arbitrary code on the server. Here, any logged-in user could exploit this to run commands with the server's privileges.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.