Struggling RCE on Jenkins Instance
A Jenkins instance exposed the /asynchPeople/ endpoint without authentication, revealing usernames and email addresses. The attacker then guessed a weak password (using the username as password) to log in and access the /script endpoint, achieving remote code execution.
Published on medium.com
Assalam Alaikum everyone! Welcome to another bug hunting write-up about Jenkins Remote Code Execution, which I reported four years ago on 30th August 2020.
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
Likely the Jenkins instance had the /asynchPeople/ endpoint accessible without authentication and a user account with a weak password (username as password) that had script execution privileges.
Impact
An attacker could gain remote code execution on the Jenkins server, potentially compromising the entire system.
What the attacker needed
Jenkins instance with /asynchPeople/ exposed; weak password (username as password)
How it was found
- Access the /asynchPeople/ endpoint without authentication to list usernames and email addresses.
- Use the usernames as passwords to brute force and find a valid credential.
- Log in with the found credential and access the /script endpoint.
- Execute a Groovy command to run system commands and prove remote 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 write-up has not been written yet. The Original tab links to the source.
Jenkins is a tool that automates software building and testing. A misconfiguration let anyone see a list of users without logging in, and one user had a very weak password that was the same as their username. Once logged in, the attacker could run commands on the server because Jenkins has a feature that lets users execute scripts.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.