17.8. CVE-2017-12635: Apache CouchDB Remote Privilege Escalation

Date:
14.11.2017
Affected:
——-
All Versions of Apache CouchDB
Severity:
——-
Critical
Vendor:
——-
The Apache Software Foundation

17.8.1. Description

Due to differences in CouchDB’s Erlang-based JSON parser and JavaScript-basedJSON parser, it is possible 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 withCVE-2017-12636 (Remote Code Execution), this can be usedto give non-admin users access to arbitrary shell commands on the server as thedatabase system user.

17.8.2. Mitigation

All users should upgrade to CouchDB 1.7.1 or2.1.1.

Upgrades from previous 1.x and 2.x versions in the same series should beseamless.

Users on earlier versions, or users upgrading from 1.x to 2.x should consultwith upgrade notes.

17.8.3. Example

The JSON parser differences result in behaviour that if two roles keysare available in the JSON, the second one will be used for authorising thedocument write, but the first roles key is used for subsequent authorisationfor the newly created user. By design, users can not assign themselves roles.The vulnerability allows non-admin users to give themselves admin privileges.

We addressed this issue by updating the way CouchDB parses JSON in Erlang,mimicking the JavaScript behaviour of picking the last key, if duplicates exist.

17.8.4. Credit

This issue was discovered by @maxj">Max Justicz.

原文: http://docs.couchdb.org/en/stable/cve/2017-12635.html