RCE in ci.owncloud.com / ci.owncloud.org
The Jenkins instance on ci.owncloud.com/org was vulnerable to a Java deserialisation flaw, allowing remote code execution. An attacker could execute commands and read files on the server.
- Triaged in 2 hours
- Fixed in 3 hours
- Disclosed after 33 hours
Hi,
I know you are more interested in vulnerabilities found in ownCloud Server, but I do would like to inform you on a RCE that can be executed on ci.owncloud.[com/org].
Vulnerability There is a 0day vulnerability in Jenkins that can be exploited in certain circumstances. The Jenkins instance on ci.owncloud.[com/org] is vulnerabile for this attack since it is configured to run on a public IP address and is not firewalled.
The vulnerability exists in the common library used by Java to (de)serialize data. Jenkins will deserialize and execute configuration data sent to a specific port it is listening on. More information on the vulnerability can be found in this article.
It was easy to find the Jenkins instance because its name is easy guessable (only later on I found out its also being linked to from your GitHub page).
POC
I used a payload to confirm the RCE which tells me ci.jenkins.org is running Debian 7. You can use this information as confirmation on the RCE.
I was also able to read the /etc/passwd file, but I'd rather not send the data it contains in this report.
Mitigation
- Shut down ci.owncloud.com for the time being
- Run ci.owncloud.com on a VPN instead of on a world-accessible public IP address
- Firewall the Jenkins instance
Regards, @tomdev
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 Jenkins instance used a vulnerable version of a Java library that deserialises untrusted data, leading to remote code execution.
What the attacker needed
Jenkins instance publicly accessible; No firewall blocking the Jenkins port
The fix
The Jenkins instance should be taken offline, moved behind a VPN, and firewalled to restrict access.
How it was found
- Find the Jenkins instance at ci.owncloud.com/org.
- Send a crafted payload to the Jenkins port to exploit the deserialisation vulnerability.
- Confirm remote code execution by observing the operating system version.
- Read the /etc/passwd file to further demonstrate access.
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.
Jenkins is a tool that automates software building and testing. A flaw in how it processed certain data allowed an attacker to run their own commands on the server, like reading files or taking control.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.