CVE-2017-12635 — couchdb
CRITICALCVE-2017-12635 is a critical-severity (CVSS 9.8) Improper Privilege Management vulnerability. 7 public exploit references exist, so weaponization risk is real. A fix is available — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2017-12635 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 394,415 CVEs with a current EPSS score, this one falls in the ≥ 90% band (highlighted). Counts from FIRST.org, log-scaled.
Description
Due to differences in the Erlang-based JSON parser and JavaScript-based JSON parser, it is possible in Apache CouchDB before 1.7.0 and 2.x before 2.1.1 to submit _users documents with duplicate keys for 'roles' used for access control within the database, including the special case '_admin' role, that denotes administrative users. In combination with CVE-2017-12636 (Remote Code Execution), this can be used to give non-admin users access to arbitrary shell commands on the server as the database system user. The JSON parser differences result in behaviour that if two 'roles' keys are available in the JSON, the second one will be used for authorising the document write, but the first 'roles' key is used for subsequent authorization for the newly created user. By design, users can not assign themselves roles. The vulnerability allows non-admin users to give themselves admin privileges.
Affected Products
couchdbapacheResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Apache CouchDB - Arbitrary Command Execution (Metasploit)
by Metasploit · Jul 13, 2018
Apache CouchDB 1.7.0 / 2.x < 2.1.1 - Remote Privilege Escalation
by r4wd3r · Apr 23, 2018
Detection & mitigation playbook
VulnerabilityDetect
Identify every host running the affected component and compare the installed build against the fixed version below — for source-built or distro-packaged software the version string, not a lockfile, is the source of truth (`dpkg -l`, `rpm -q`, or the binary's own `--version`).
Fix
Upgrade the affected component to the fixed release for CVE-2017-12635, or apply your distribution's backported patch — distro builds are often patched at an older version number, so check your vendor's advisory rather than the upstream version alone.
Workarounds
Close the privilege gap rather than the entry point: audit which accounts, roles and service identities can reach the affected operation, drop the component to the least privilege it actually needs, and review file and directory permissions created by earlier installs — a default left in place is what makes this reachable.
How to detect CVE-2017-12635
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2017-12635 -u https://target- Template
- Apache CouchDB 1.7.0 / 2.x < 2.1.1 - Remote Privilege Escalation
- Severity
- critical
- Impact
- Remote attackers can exploit this vulnerability to escalate privileges.
- Remediation
- Upgrade Apache CouchDB to version 2.1.1 or later.
Template by ProjectDiscovery nuclei-templates (pikpikcu), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is CVE-2017-12635 in your dependencies?
Find it across , including transitive dependencies.