一、 漏洞 CVE-2017-12635 基础信息
漏洞信息
                                        # N/A

## 漏洞概述
Apache CouchDB在1.7.0之前的版本和2.x系列在2.1.1之前的版本中,由于Erlang和JavaScript的JSON解析器差异,攻击者可以提交包含重复'roles'键的_users文档,从而绕过访问控制,并赋予非管理员用户管理员权限。

## 影响版本
- Apache CouchDB 1.7.0之前的版本
- Apache CouchDB 2.x系列2.1.1之前的版本

## 漏洞细节
在Apache CouchDB中,JSON解析器在处理包含重复'roles'键的JSON时表现出不同行为:在文档写入时使用第二个'roles'键进行授权,但在后续对新用户进行授权时使用第一个'roles'键。由于系统设计不允许用户自行分配角色,这一漏洞使非管理员用户能够通过创建带有重复'roles'键的_users文档,为自己分配包括'_admin'在内的管理员权限。

## 潜在影响
结合CVE-2017-12636(远程代码执行),非管理员用户可以通过操作数据库系统用户获得在服务器上的任意shell命令访问权限,这可能造成严重的安全威胁。
                                        
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
N/A
来源:美国国家漏洞数据库 NVD
漏洞描述信息
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.
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
N/A
来源:美国国家漏洞数据库 NVD
漏洞标题
Apache CouchDB 安全漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
Apache CouchDB是美国阿帕奇(Apache)软件基金会的一个免费、开源、面向文档的数据库,是一个使用JSON作为存储格式,JavaScript作为查询语言,MapReduce和HTTP作为API的NoSQL数据库。 Apache CouchDB 1.7.0之前的版本和2.1.1之前的2.x版本中存在安全漏洞,该漏洞源于基于rlang的JSON解析器和基于JavaScript的JSON解析器之间存在差异。攻击者可利用该漏洞访问任意的shell命令或获取管理员权限。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
权限许可和访问控制问题
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2017-12635 的公开POC
# POC 描述 源链接 神龙链接
1 Case study and POC of CVE-2017-12635: Apache CouchDB 1.7.0 / 2.x < 2.1.1 - Remote Privilege Escalation https://github.com/assalielmehdi/CVE-2017-12635 POC详情
2 None https://github.com/cyberharsh/Apache-couchdb-CVE-2017-12635 POC详情
3 None https://github.com/tranmanhdat/couchdb_cve-2017-12635 POC详情
4 CouchDB CVE-2017-12635 Exploit Script https://github.com/Weisant/CVE-2017-12635-EXP POC详情
5 POC for CouchDB CVE-2017-12635 https://github.com/Weisant/CVE-2017-12635-POC POC详情
6 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 keysfor '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 behavior that if two 'roles' keys are available in the JSON, the second one will be used for authorizing 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. https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-12635.yaml POC详情
7 None https://github.com/Threekiii/Awesome-POC/blob/master/%E6%95%B0%E6%8D%AE%E5%BA%93%E6%BC%8F%E6%B4%9E/Apache%20CouchDB%20%E5%9E%82%E7%9B%B4%E6%9D%83%E9%99%90%E7%BB%95%E8%BF%87%E6%BC%8F%E6%B4%9E%20CVE-2017-12635.md POC详情
8 None https://github.com/chaitin/xray-plugins/blob/main/poc/manual/couchdb-cve-2017-12635.yml POC详情
9 https://github.com/vulhub/vulhub/blob/master/couchdb/CVE-2017-12635/README.md POC详情
三、漏洞 CVE-2017-12635 的情报信息