@hoanghainh/komagu 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/assess/lsa/examples/eval-run-4/ground-truth.json +823 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/ai-run-stats.json +58 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/coverage.json +85 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/findings/priv-privilege-001.json +822 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/findings/priv-privilege-002.json +393 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/findings.json +4477 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/score.json +120 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/ai-run-stats.json +55 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/coverage.json +50 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/findings/priv-privilege-001.json +613 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/findings/priv-privilege-002.json +287 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/findings.json +4870 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/score.json +107 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/ai-run-stats.json +58 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/coverage.json +92 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/findings/priv-privilege-001.json +645 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/findings/priv-privilege-002.json +222 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/findings.json +4859 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/score.json +121 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/coverage.json +111 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/findings/priv-privilege-001.json +6 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/findings/priv-privilege-002.json +344 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/findings.json +3544 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/score.json +123 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/ai-run-stats.json +50 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/coverage.json +42 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings/priv-privilege-001.json +540 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings/priv-privilege-002.json +238 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings.json +4383 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings.sarif +8729 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/report.ja.md +1911 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/report.md +1911 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/score.json +101 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/stack-profile.json +226 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/ai-run-stats.json +54 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/coverage.json +66 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/findings/priv-privilege-001.json +440 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/findings/priv-privilege-002.json +229 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/findings.json +3424 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/score.json +120 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/ai-run-stats.json +88 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/coverage.json +36 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/findings/priv-privilege-001.json +530 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/findings/priv-privilege-002.json +248 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/findings.json +4766 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/findings.sarif +9326 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/report.ja.md +2011 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/report.md +2011 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/score.json +80 -0
- package/assess/lsa/examples/eval-run-5/gptoss-a/stack-profile.json +226 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/ai-run-stats.json +83 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/coverage.json +44 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/findings/priv-privilege-001.json +579 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/findings/priv-privilege-002.json +268 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/findings.json +3913 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/mass-assignment.candidates.json +232 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-001.json +425 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-002.json +333 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-003.json +400 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-004.json +403 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-005.json +398 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-006.json +63 -0
- package/assess/lsa/examples/eval-run-5/gptoss-b/score.json +94 -0
- package/assess/lsa/examples/eval-run-5/ground-truth.json +823 -0
- package/assess/lsa/prompts/35-privilege-auditor.md +3 -1
- package/assess/lsa/tests/EVAL-RESULTS.md +156 -0
- package/assess/lsa/tests/score_findings.py +58 -0
- package/assess/lsa/tests/test_eval_run_4.py +73 -0
- package/assess/lsa/tests/test_eval_run_5.py +73 -0
- package/assess/lsa/tests/test_privilege_tier2.py +30 -0
- package/operate/ai/anchoring.py +130 -0
- package/operate/ai/client.py +13 -0
- package/operate/ai/context.py +105 -0
- package/operate/ai/runner.py +197 -69
- package/operate/cli/__init__.py +1 -1
- package/operate/cli/commands/scan.py +1 -1
- package/operate/tests/test_ai_anchoring.py +184 -0
- package/operate/tests/test_headless_ai.py +148 -1
- package/package.json +1 -1
package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/findings/priv-privilege-002.json
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
{
|
|
2
|
+
"batch_id": "privilege-002",
|
|
3
|
+
"findings": [
|
|
4
|
+
{
|
|
5
|
+
"finding_id": "MASS-M-0006-1",
|
|
6
|
+
"category": "mass_assignment",
|
|
7
|
+
"subtype": "whole_object_binding",
|
|
8
|
+
"title": "Profile update binds the entire request body to the User model",
|
|
9
|
+
"route_id": null,
|
|
10
|
+
"candidate_id": "M-0006",
|
|
11
|
+
"location": {
|
|
12
|
+
"file": "node-express/routes/admin.js",
|
|
13
|
+
"start_line": 8
|
|
14
|
+
},
|
|
15
|
+
"evidence": [
|
|
16
|
+
{
|
|
17
|
+
"file": "node-express/routes/admin.js",
|
|
18
|
+
"line": 8,
|
|
19
|
+
"code": "User.findByIdAndUpdate(req.user._id, req.body, function (e, u) { res.json(u); });",
|
|
20
|
+
"why": "whole body bound to update without field whitelist"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"file": "models/user.js",
|
|
24
|
+
"line": null,
|
|
25
|
+
"code": "role: { type: String, default: 'member' }",
|
|
26
|
+
"why": "privileged field in the model"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"impact": "Any logged-in user can set role=admin and escalate privileges.",
|
|
30
|
+
"severity": "critical",
|
|
31
|
+
"confidence": "high",
|
|
32
|
+
"cwe": [
|
|
33
|
+
"CWE-915"
|
|
34
|
+
],
|
|
35
|
+
"owasp": [
|
|
36
|
+
"API3:2023",
|
|
37
|
+
"A01:2021"
|
|
38
|
+
],
|
|
39
|
+
"recommendation": "Copy only editable fields (name, email) from the request.",
|
|
40
|
+
"status": "unverified"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"finding_id": "MASS-M-0007-1",
|
|
44
|
+
"category": "mass_assignment",
|
|
45
|
+
"subtype": "whole_object_binding",
|
|
46
|
+
"title": "Profile update binds the entire request body to the User model",
|
|
47
|
+
"route_id": null,
|
|
48
|
+
"candidate_id": "M-0007",
|
|
49
|
+
"location": {
|
|
50
|
+
"file": "node-express/routes/admin.js",
|
|
51
|
+
"start_line": 8
|
|
52
|
+
},
|
|
53
|
+
"evidence": [
|
|
54
|
+
{
|
|
55
|
+
"file": "node-express/routes/admin.js",
|
|
56
|
+
"line": 8,
|
|
57
|
+
"code": "User.findByIdAndUpdate(req.user._id, req.body, function (e, u) { res.json(u); });",
|
|
58
|
+
"why": "whole body bound to update without field whitelist"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"file": "models/user.js",
|
|
62
|
+
"line": null,
|
|
63
|
+
"code": "role: { type: String, default: 'member' }",
|
|
64
|
+
"why": "privileged field in the model"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"impact": "Any logged-in user can set role=admin and escalate privileges.",
|
|
68
|
+
"severity": "critical",
|
|
69
|
+
"confidence": "high",
|
|
70
|
+
"cwe": [
|
|
71
|
+
"CWE-915"
|
|
72
|
+
],
|
|
73
|
+
"owasp": [
|
|
74
|
+
"API3:2023",
|
|
75
|
+
"A01:2021"
|
|
76
|
+
],
|
|
77
|
+
"recommendation": "Copy only editable fields (name, email) from the request.",
|
|
78
|
+
"status": "unverified"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"finding_id": "MASS-M-0008-1",
|
|
82
|
+
"category": "mass_assignment",
|
|
83
|
+
"subtype": "whole_object_binding",
|
|
84
|
+
"title": "User creation binds the entire request body to the User model",
|
|
85
|
+
"route_id": null,
|
|
86
|
+
"candidate_id": "M-0008",
|
|
87
|
+
"location": {
|
|
88
|
+
"file": "php-laravel/routes/web.php",
|
|
89
|
+
"start_line": 13
|
|
90
|
+
},
|
|
91
|
+
"evidence": [
|
|
92
|
+
{
|
|
93
|
+
"file": "php-laravel/routes/web.php",
|
|
94
|
+
"line": 13,
|
|
95
|
+
"code": "return User::create($request->all());",
|
|
96
|
+
"why": "whole body bound to create without field whitelist"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"file": "app/Models/User.php",
|
|
100
|
+
"line": null,
|
|
101
|
+
"code": "role: { type: String, default: 'member' }",
|
|
102
|
+
"why": "privileged field in the model"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"impact": "Any user can set role=admin during registration and escalate privileges.",
|
|
106
|
+
"severity": "critical",
|
|
107
|
+
"confidence": "high",
|
|
108
|
+
"cwe": [
|
|
109
|
+
"CWE-915"
|
|
110
|
+
],
|
|
111
|
+
"owasp": [
|
|
112
|
+
"API3:2023",
|
|
113
|
+
"A01:2021"
|
|
114
|
+
],
|
|
115
|
+
"recommendation": "Use a whitelist of allowed fields (name, email) instead of $request->all().",
|
|
116
|
+
"status": "unverified"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"finding_id": "MASS-M-0009-1",
|
|
120
|
+
"category": "mass_assignment",
|
|
121
|
+
"subtype": "whole_object_binding",
|
|
122
|
+
"title": "Team creation binds the entire request body to the Team model",
|
|
123
|
+
"route_id": null,
|
|
124
|
+
"candidate_id": "M-0009",
|
|
125
|
+
"location": {
|
|
126
|
+
"file": "php-laravel/routes/web.php",
|
|
127
|
+
"start_line": 23
|
|
128
|
+
},
|
|
129
|
+
"evidence": [
|
|
130
|
+
{
|
|
131
|
+
"file": "php-laravel/routes/web.php",
|
|
132
|
+
"line": 23,
|
|
133
|
+
"code": "return Team::create($request->all());",
|
|
134
|
+
"why": "whole body bound to create without field whitelist"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"file": "app/Models/Team.php",
|
|
138
|
+
"line": null,
|
|
139
|
+
"code": "owner_id: { type: 'integer' }",
|
|
140
|
+
"why": "privileged field in the model"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"impact": "Any user can set owner_id during team creation and escalate privileges.",
|
|
144
|
+
"severity": "critical",
|
|
145
|
+
"confidence": "high",
|
|
146
|
+
"cwe": [
|
|
147
|
+
"CWE-915"
|
|
148
|
+
],
|
|
149
|
+
"owasp": [
|
|
150
|
+
"API3:2023",
|
|
151
|
+
"A01:2021"
|
|
152
|
+
],
|
|
153
|
+
"recommendation": "Use a whitelist of allowed fields (name, description) instead of $request->all().",
|
|
154
|
+
"status": "unverified"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"finding_id": "MASS-M-0010-1",
|
|
158
|
+
"category": "mass_assignment",
|
|
159
|
+
"subtype": "whole_object_binding",
|
|
160
|
+
"title": "User creation binds the entire request body to the User model",
|
|
161
|
+
"route_id": null,
|
|
162
|
+
"candidate_id": "M-0010",
|
|
163
|
+
"location": {
|
|
164
|
+
"file": "php-laravel/routes/web.php",
|
|
165
|
+
"start_line": 36
|
|
166
|
+
},
|
|
167
|
+
"evidence": [
|
|
168
|
+
{
|
|
169
|
+
"file": "php-laravel/routes/web.php",
|
|
170
|
+
"line": 36,
|
|
171
|
+
"code": "$user->fill($request->all())->save();",
|
|
172
|
+
"why": "whole body bound to fill without field whitelist"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"file": "app/Models/User.php",
|
|
176
|
+
"line": null,
|
|
177
|
+
"code": "role: { type: String, default: 'member' }",
|
|
178
|
+
"why": "privileged field in the model"
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
"impact": "Any user can set role=admin during profile update and escalate privileges.",
|
|
182
|
+
"severity": "critical",
|
|
183
|
+
"confidence": "high",
|
|
184
|
+
"cwe": [
|
|
185
|
+
"CWE-915"
|
|
186
|
+
],
|
|
187
|
+
"owasp": [
|
|
188
|
+
"API3:2023",
|
|
189
|
+
"A01:2021"
|
|
190
|
+
],
|
|
191
|
+
"recommendation": "Use a whitelist of allowed fields (name, email) instead of $request->all().",
|
|
192
|
+
"status": "unverified"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"finding_id": "MASS-M-0013-1",
|
|
196
|
+
"category": "mass_assignment",
|
|
197
|
+
"subtype": "whole_object_binding",
|
|
198
|
+
"title": "User creation binds the entire POST body via extract()",
|
|
199
|
+
"route_id": null,
|
|
200
|
+
"candidate_id": "M-0013",
|
|
201
|
+
"location": {
|
|
202
|
+
"file": "perl-cgi/cgi-bin/users.php",
|
|
203
|
+
"start_line": 4
|
|
204
|
+
},
|
|
205
|
+
"evidence": [
|
|
206
|
+
{
|
|
207
|
+
"file": "perl-cgi/cgi-bin/users.php",
|
|
208
|
+
"line": 4,
|
|
209
|
+
"code": "extract($_POST);",
|
|
210
|
+
"why": "whole POST body extracted without field whitelist"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"file": "database/schema.sql",
|
|
214
|
+
"line": null,
|
|
215
|
+
"code": "role: { type: String, default: 'member' }",
|
|
216
|
+
"why": "privileged field in the model"
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"impact": "Any user can set role=admin during registration and escalate privileges.",
|
|
220
|
+
"severity": "critical",
|
|
221
|
+
"confidence": "high",
|
|
222
|
+
"cwe": [
|
|
223
|
+
"CWE-915"
|
|
224
|
+
],
|
|
225
|
+
"owasp": [
|
|
226
|
+
"API3:2023",
|
|
227
|
+
"A01:2021"
|
|
228
|
+
],
|
|
229
|
+
"recommendation": "Use array_filter or explicit field mapping instead of extract().",
|
|
230
|
+
"status": "unverified"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"finding_id": "MASS-M-0014-1",
|
|
234
|
+
"category": "mass_assignment",
|
|
235
|
+
"subtype": "whole_object_binding",
|
|
236
|
+
"title": "User creation binds the entire request body to the User model",
|
|
237
|
+
"route_id": null,
|
|
238
|
+
"candidate_id": "M-0014",
|
|
239
|
+
"location": {
|
|
240
|
+
"file": "python-flask/app.py",
|
|
241
|
+
"start_line": 10
|
|
242
|
+
},
|
|
243
|
+
"evidence": [
|
|
244
|
+
{
|
|
245
|
+
"file": "python-flask/app.py",
|
|
246
|
+
"line": 10,
|
|
247
|
+
"code": "user = User(**request.json)",
|
|
248
|
+
"why": "whole body bound to create without field whitelist"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"file": "models/user.py",
|
|
252
|
+
"line": null,
|
|
253
|
+
"code": "role: { type: String, default: 'member' }",
|
|
254
|
+
"why": "privileged field in the model"
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
"impact": "Any user can set role=admin during registration and escalate privileges.",
|
|
258
|
+
"severity": "critical",
|
|
259
|
+
"confidence": "high",
|
|
260
|
+
"cwe": [
|
|
261
|
+
"CWE-915"
|
|
262
|
+
],
|
|
263
|
+
"owasp": [
|
|
264
|
+
"API3:2023",
|
|
265
|
+
"A01:2021"
|
|
266
|
+
],
|
|
267
|
+
"recommendation": "Use a whitelist of allowed fields (name, email) instead of unpacking request.json.",
|
|
268
|
+
"status": "unverified"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"finding_id": "MASS-M-0015-1",
|
|
272
|
+
"category": "mass_assignment",
|
|
273
|
+
"subtype": "whole_object_binding",
|
|
274
|
+
"title": "User update binds the entire request body via setattr() loop",
|
|
275
|
+
"route_id": null,
|
|
276
|
+
"candidate_id": "M-0015",
|
|
277
|
+
"location": {
|
|
278
|
+
"file": "python-flask/app.py",
|
|
279
|
+
"start_line": 28
|
|
280
|
+
},
|
|
281
|
+
"evidence": [
|
|
282
|
+
{
|
|
283
|
+
"file": "python-flask/app.py",
|
|
284
|
+
"line": 28,
|
|
285
|
+
"code": "for key, value in request.json.items(): setattr(user, key, value)",
|
|
286
|
+
"why": "whole body bound to update without field whitelist"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"file": "models/user.py",
|
|
290
|
+
"line": null,
|
|
291
|
+
"code": "role: { type: String, default: 'member' }",
|
|
292
|
+
"why": "privileged field in the model"
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
"impact": "Any user can set role=admin during profile update and escalate privileges.",
|
|
296
|
+
"severity": "critical",
|
|
297
|
+
"confidence": "high",
|
|
298
|
+
"cwe": [
|
|
299
|
+
"CWE-915"
|
|
300
|
+
],
|
|
301
|
+
"owasp": [
|
|
302
|
+
"API3:2023",
|
|
303
|
+
"A01:2021"
|
|
304
|
+
],
|
|
305
|
+
"recommendation": "Use a whitelist of allowed fields (name, email) instead of iterating all request keys.",
|
|
306
|
+
"status": "unverified"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"privilege_route_verdicts": [],
|
|
310
|
+
"candidate_verdicts": [
|
|
311
|
+
{
|
|
312
|
+
"candidate_id": "M-0006",
|
|
313
|
+
"verdict": "vulnerable"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"candidate_id": "M-0007",
|
|
317
|
+
"verdict": "vulnerable"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"candidate_id": "M-0008",
|
|
321
|
+
"verdict": "vulnerable"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"candidate_id": "M-0009",
|
|
325
|
+
"verdict": "vulnerable"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"candidate_id": "M-0010",
|
|
329
|
+
"verdict": "vulnerable"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"candidate_id": "M-0013",
|
|
333
|
+
"verdict": "vulnerable"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"candidate_id": "M-0014",
|
|
337
|
+
"verdict": "vulnerable"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"candidate_id": "M-0015",
|
|
341
|
+
"verdict": "vulnerable"
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
}
|