Skip to content
RCE Write-up Intermediate

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.

Dogukan İSPİRLİ Follow

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.

Dogukan İSPİRLİ, on medium.com

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

  1. Open the Hackviser platform, go to the Labs section and the Common Security Vulnerabilities category, then start the CVE-2017 machine.
  2. Open a terminal and run msfconsole.
  3. Load the module for CVE-2017-12636.
  4. Configure the module settings and run the exploit.
  5. Obtain a shell and search the filesystem for secret.txt.
  6. 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.

More by Dogukan İSPİRLİ

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.