Hackviser — Apache CouchDB 1.7.0/2.x < 2.1.1 Remote Code Ex
Apache CouchDB versions 1.7.0 and 2.x before 2.1.1 allow an attacker to specify operating-system-level executable paths through the HTTP configuration interface. This lets an attacker run arbitrary shell commands as the CouchDB user, including downloading and executing scripts from the internet.
Published on medium.com
Hackviser platformuna giriş yaparak Laboratuvarlar bölümündeki Yaygın Güvenlik Açıkları bölümüne giriş yapıyoruz ve CVE-2017 olan bölüme tıklayarak makineyi başlatıyoruz.
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 CouchDB configuration endpoint allowed setting query_server or similar executable paths without restricting them, so a remote user could make the server launch arbitrary programs.
Impact
An attacker could run arbitrary shell commands as the CouchDB user and could download and execute scripts from the internet, giving full control of the database process.
What the attacker needed
Network access to CouchDB HTTP port; CouchDB 1.7.0 or 2.x before 2.1.1
The fix
Upgrade CouchDB to 2.1.1 or later, which addresses this configuration-based command execution issue.
How it was found
- Open the Hackviser platform, go to the Labs section and the Common Security Vulnerabilities category, then start the CVE-2017 machine.
- Open a terminal and run msfconsole.
- Load the module for CVE-2017-12636.
- Configure the module settings and run the exploit.
- Obtain a shell and search the filesystem for secret.txt.
- Read the file to get the answer.
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.
CouchDB is a database that people reach over the web. In the affected versions, its web configuration feature let someone point it at a program on the server, and CouchDB would then run that program. Because of this, an attacker could run their own commands on the machine as the database user.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.