-
Notifications
You must be signed in to change notification settings - Fork 296
/
GHSA-624g-8qjg-8qxf.json
177 lines (177 loc) · 5.04 KB
/
GHSA-624g-8qjg-8qxf.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
{
"schema_version": "1.4.0",
"id": "GHSA-624g-8qjg-8qxf",
"modified": "2024-06-10T20:12:58Z",
"published": "2024-04-23T21:15:55Z",
"aliases": [
"CVE-2024-32866"
],
"summary": "Conform contains a Prototype Pollution Vulnerability in `parseWith...` function",
"details": "### Summary\nConform allows the parsing of nested objects in the form of `object.property`. Due to an improper implementation of this feature, an attacker can exploit it to trigger prototype pollution by passing a crafted input to `parseWith...` functions.\n\n### PoC\n```javascript\nconst { parseWithZod } = require('@conform-to/zod');\nconst { z } = require(\"zod\"); \n\nconst param = new URLSearchParams(\"__proto__.pollution=polluted\");\nconst schema = z.object({ \"a\": z.string() });\n\nparseWithZod(param, { schema });\nconsole.log(\"pollution:\", ({}).pollution); // should print \"polluted\"\n```\n\n### Details\n\nThe invocation of the `parseWithZod` function in the above PoC triggers the `setValue` function through `getSubmissionContext` and `parse`, executing the following process, resulting in prototype pollution:\n\n```javascript\nlet pointer = value;\n\npointer.__proto__ = pointer.__proto__;\npointer = pointer.__proto__;\n\npointer.polluted = \"polluted\";\n```\n\nThis is caused by the lack of object existence checking on [line 117 in formdata.ts](https://github.com/edmundhung/conform/blob/59156d7115a7207fa3b6f8a70a4342a9b24c2501/packages/conform-dom/formdata.ts#L117), where the code only checks for the presence of `pointer[key]` without proper validation.\n\n### Impact\nApplications that use conform for server-side validation of form data or URL parameters are affected by this vulnerability.\n",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"
}
],
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@conform-to/dom"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.1.1"
}
]
}
],
"database_specific": {
"last_known_affected_version_range": "<= 1.1.0"
}
},
{
"package": {
"ecosystem": "npm",
"name": "@conform-to/zod"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.1.1"
}
]
}
],
"database_specific": {
"last_known_affected_version_range": "<= 1.1.0"
}
},
{
"package": {
"ecosystem": "npm",
"name": "@conform-to/yup"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.1.1"
}
]
}
],
"database_specific": {
"last_known_affected_version_range": "<= 1.1.0"
}
},
{
"package": {
"ecosystem": "npm",
"name": "@conform-to/zod"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.9.2"
}
]
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "@conform-to/yup"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.9.2"
}
]
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "@conform-to/dom"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.9.2"
}
]
}
]
}
],
"references": [
{
"type": "WEB",
"url": "https://github.com/edmundhung/conform/security/advisories/GHSA-624g-8qjg-8qxf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32866"
},
{
"type": "WEB",
"url": "https://github.com/edmundhung/conform/commit/4819d51b5a53fd5486fc85c17cdc148eb160e3de"
},
{
"type": "WEB",
"url": "https://github.com/edmundhung/conform/commit/cb604dd58b99e2d12716d901a23bfca724e741ef"
},
{
"type": "PACKAGE",
"url": "https://github.com/edmundhung/conform"
},
{
"type": "WEB",
"url": "https://github.com/edmundhung/conform/blob/59156d7115a7207fa3b6f8a70a4342a9b24c2501/packages/conform-dom/formdata.ts#L117"
}
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"severity": "HIGH",
"github_reviewed": true,
"github_reviewed_at": "2024-04-23T21:15:55Z",
"nvd_published_at": "2024-04-23T21:15:48Z"
}
}