Investigating the bug advisory
The Jira Data Center Ehcache RMI service lacked authentication, allowing an attacker to invoke methods that deserialise untrusted data. This could lead to remote code execution via a Java deserialisation gadget.
dozer.nz
Published on dozer.nz
Last Friday I saw an Atlassian security advisory for a critical RCE in Jira Data Center (CVE-2020-36239), so I decided to try to develop a proof of concept exploit for it. This ended up taking me about 5 hours.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The Ehcache RMI service exposed methods that accept serialised objects without authentication, and the Java deserialisation of those objects allowed arbitrary code execution.
What the attacker needed
Network access to port 40001; Jira Data Center (not Server); JDK version affected by JEP 290
The fix
The vulnerability was fixed in the Jira Data Center version mentioned in the advisory; the text does not detail the fix.
How it was found
- Set up a vulnerable Jira Data Center instance (v8.16.2) with JDK 1.8.0_275.
- Use RMItaste to enumerate the RMI registry on port 40001 and discover remote objects and their methods.
- Identify methods that accept non-primitive types, such as getQuiet(java.io.Serializable).
- Test with a URLDNS payload to confirm deserialisation occurs.
- Bruteforce ysoserial gadgets against the method to find one that executes code.
- Confirm code execution by spawning notepad.exe using the CommonsBeanutils1 gadget.
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 write-up has not been written yet. The Original tab links to the source.
Jira Data Center runs a caching service that listens on a network port. Because it did not check who was connecting, an attacker could send it a specially crafted message that, when unpacked, ran their 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.