forked from viveksabbani/CAP6614_Final_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPython-project-5-scan.json
400 lines (400 loc) · 14.9 KB
/
Python-project-5-scan.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
{
"errors": [],
"generated_at": "2024-11-26T18:54:06Z",
"metrics": {
".\\Python-project-5\\password-reset-exploit.py": {
"CONFIDENCE.HIGH": 1,
"CONFIDENCE.LOW": 1,
"CONFIDENCE.MEDIUM": 0,
"CONFIDENCE.UNDEFINED": 0,
"SEVERITY.HIGH": 1,
"SEVERITY.LOW": 0,
"SEVERITY.MEDIUM": 1,
"SEVERITY.UNDEFINED": 0,
"loc": 33,
"nosec": 0,
"skipped_tests": 0
},
".\\Python-project-5\\test-app-with-custom-vulnerabilities.py": {
"CONFIDENCE.HIGH": 12,
"CONFIDENCE.LOW": 1,
"CONFIDENCE.MEDIUM": 2,
"CONFIDENCE.UNDEFINED": 0,
"SEVERITY.HIGH": 5,
"SEVERITY.LOW": 5,
"SEVERITY.MEDIUM": 5,
"SEVERITY.UNDEFINED": 0,
"loc": 73,
"nosec": 0,
"skipped_tests": 0
},
".\\Python-project-5\\web_ssrf.py": {
"CONFIDENCE.HIGH": 0,
"CONFIDENCE.LOW": 0,
"CONFIDENCE.MEDIUM": 0,
"CONFIDENCE.UNDEFINED": 0,
"SEVERITY.HIGH": 0,
"SEVERITY.LOW": 0,
"SEVERITY.MEDIUM": 0,
"SEVERITY.UNDEFINED": 0,
"loc": 32,
"nosec": 0,
"skipped_tests": 0
},
"_totals": {
"CONFIDENCE.HIGH": 13,
"CONFIDENCE.LOW": 2,
"CONFIDENCE.MEDIUM": 2,
"CONFIDENCE.UNDEFINED": 0,
"SEVERITY.HIGH": 6,
"SEVERITY.LOW": 5,
"SEVERITY.MEDIUM": 6,
"SEVERITY.UNDEFINED": 0,
"loc": 138,
"nosec": 0,
"skipped_tests": 0
}
},
"results": [
{
"code": "22 def Em5(i):\n23 return str(hashlib.md5(str(i).encode(\"utf\")).hexdigest())\n24 \n",
"col_offset": 15,
"end_col_offset": 48,
"filename": ".\\Python-project-5\\password-reset-exploit.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 327,
"link": "https://cwe.mitre.org/data/definitions/327.html"
},
"issue_severity": "HIGH",
"issue_text": "Use of weak MD5 hash for security. Consider usedforsecurity=False",
"line_number": 23,
"line_range": [
23
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b324_hashlib.html",
"test_id": "B324",
"test_name": "hashlib"
},
{
"code": "51 u = url.replace('HASH', Em5(i))\n52 r = requests.post(u, data={\"passwd\": passwd})\n53 \n",
"col_offset": 8,
"end_col_offset": 49,
"filename": ".\\Python-project-5\\password-reset-exploit.py",
"issue_confidence": "LOW",
"issue_cwe": {
"id": 400,
"link": "https://cwe.mitre.org/data/definitions/400.html"
},
"issue_severity": "MEDIUM",
"issue_text": "Call to requests without timeout",
"line_number": 52,
"line_range": [
52
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b113_request_without_timeout.html",
"test_id": "B113",
"test_name": "request_without_timeout"
},
{
"code": "1 import os\n2 import subprocess\n3 import pickle\n",
"col_offset": 0,
"end_col_offset": 17,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 78,
"link": "https://cwe.mitre.org/data/definitions/78.html"
},
"issue_severity": "LOW",
"issue_text": "Consider possible security implications associated with the subprocess module.",
"line_number": 2,
"line_range": [
2
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/blacklists/blacklist_imports.html#b404-import-subprocess",
"test_id": "B404",
"test_name": "blacklist"
},
{
"code": "2 import subprocess\n3 import pickle\n4 import hashlib\n",
"col_offset": 0,
"end_col_offset": 13,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 502,
"link": "https://cwe.mitre.org/data/definitions/502.html"
},
"issue_severity": "LOW",
"issue_text": "Consider possible security implications associated with pickle module.",
"line_number": 3,
"line_range": [
3
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/blacklists/blacklist_imports.html#b403-import-pickle",
"test_id": "B403",
"test_name": "blacklist"
},
{
"code": "9 import requests\n10 import xml.dom.minidom as minidom\n11 \n",
"col_offset": 0,
"end_col_offset": 33,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 20,
"link": "https://cwe.mitre.org/data/definitions/20.html"
},
"issue_severity": "LOW",
"issue_text": "Using xml.dom.minidom to parse untrusted XML data is known to be vulnerable to XML attacks. Replace xml.dom.minidom with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.",
"line_number": 10,
"line_range": [
10
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/blacklists/blacklist_imports.html#b408-import-xml-minidom",
"test_id": "B408",
"test_name": "blacklist"
},
{
"code": "16 user_input = input(\"Enter some code to evaluate: \")\n17 result = eval(user_input) # Vulnerable to code injection\n18 print(f\"Result: {result}\")\n",
"col_offset": 13,
"end_col_offset": 29,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 78,
"link": "https://cwe.mitre.org/data/definitions/78.html"
},
"issue_severity": "MEDIUM",
"issue_text": "Use of possibly insecure function - consider using safer ast.literal_eval.",
"line_number": 17,
"line_range": [
17
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/blacklists/blacklist_calls.html#b307-eval",
"test_id": "B307",
"test_name": "blacklist"
},
{
"code": "20 # 2. Hardcoded Cryptographic Keys (Hardcoded Secret)\n21 SECRET_KEY = \"my$ecretK3y!\" # Hardcoded secret key\n22 \n",
"col_offset": 13,
"end_col_offset": 27,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "MEDIUM",
"issue_cwe": {
"id": 259,
"link": "https://cwe.mitre.org/data/definitions/259.html"
},
"issue_severity": "LOW",
"issue_text": "Possible hardcoded password: 'my$ecretK3y!'",
"line_number": 21,
"line_range": [
21
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b105_hardcoded_password_string.html",
"test_id": "B105",
"test_name": "hardcoded_password_string"
},
{
"code": "30 for _ in range(length):\n31 random_str += random.choice('abcdefghijklmnopqrstuvwxyz') # Predictable randomness\n32 return random_str\n",
"col_offset": 22,
"end_col_offset": 65,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 330,
"link": "https://cwe.mitre.org/data/definitions/330.html"
},
"issue_severity": "LOW",
"issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.",
"line_number": 31,
"line_range": [
31
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/blacklists/blacklist_calls.html#b311-random",
"test_id": "B311",
"test_name": "blacklist"
},
{
"code": "35 def insecure_hash(data):\n36 return hashlib.sha1(data.encode()).hexdigest() # SHA1 is considered weak\n37 \n",
"col_offset": 11,
"end_col_offset": 38,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 327,
"link": "https://cwe.mitre.org/data/definitions/327.html"
},
"issue_severity": "HIGH",
"issue_text": "Use of weak SHA1 hash for security. Consider usedforsecurity=False",
"line_number": 36,
"line_range": [
36
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b324_hashlib.html",
"test_id": "B324",
"test_name": "hashlib"
},
{
"code": "40 command = input(\"Enter a system command to run: \")\n41 os.system(command) # Unsafe execution of system command\n42 \n",
"col_offset": 4,
"end_col_offset": 22,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 78,
"link": "https://cwe.mitre.org/data/definitions/78.html"
},
"issue_severity": "HIGH",
"issue_text": "Starting a process with a shell, possible injection detected, security issue.",
"line_number": 41,
"line_range": [
41
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b605_start_process_with_a_shell.html",
"test_id": "B605",
"test_name": "start_process_with_a_shell"
},
{
"code": "45 with open(file_path, 'rb') as file:\n46 config = pickle.load(file) # Can execute arbitrary code during unpickling\n47 return config\n",
"col_offset": 17,
"end_col_offset": 34,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 502,
"link": "https://cwe.mitre.org/data/definitions/502.html"
},
"issue_severity": "MEDIUM",
"issue_text": "Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.",
"line_number": 46,
"line_range": [
46
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/blacklists/blacklist_calls.html#b301-pickle",
"test_id": "B301",
"test_name": "blacklist"
},
{
"code": "55 def make_insecure_request(url):\n56 response = requests.get(url, verify=False) # SSL verification is disabled\n57 return response.content\n",
"col_offset": 15,
"end_col_offset": 46,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 295,
"link": "https://cwe.mitre.org/data/definitions/295.html"
},
"issue_severity": "HIGH",
"issue_text": "Call to requests with verify=False disabling SSL certificate checks, security issue.",
"line_number": 56,
"line_range": [
56
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b501_request_with_no_cert_validation.html",
"test_id": "B501",
"test_name": "request_with_no_cert_validation"
},
{
"code": "55 def make_insecure_request(url):\n56 response = requests.get(url, verify=False) # SSL verification is disabled\n57 return response.content\n",
"col_offset": 15,
"end_col_offset": 46,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "LOW",
"issue_cwe": {
"id": 400,
"link": "https://cwe.mitre.org/data/definitions/400.html"
},
"issue_severity": "MEDIUM",
"issue_text": "Call to requests without timeout",
"line_number": 56,
"line_range": [
56
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b113_request_without_timeout.html",
"test_id": "B113",
"test_name": "request_without_timeout"
},
{
"code": "60 def load_yaml(yaml_str):\n61 data = yaml.load(yaml_str) # Unsafe loading, should specify Loader=yaml.SafeLoader\n62 return data\n",
"col_offset": 11,
"end_col_offset": 30,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 20,
"link": "https://cwe.mitre.org/data/definitions/20.html"
},
"issue_severity": "MEDIUM",
"issue_text": "Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load().",
"line_number": 61,
"line_range": [
61
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b506_yaml_load.html",
"test_id": "B506",
"test_name": "yaml_load"
},
{
"code": "65 def parse_xml(xml_str):\n66 dom = minidom.parseString(xml_str) # May allow external entity expansion\n67 return dom.getElementsByTagName('data')\n",
"col_offset": 10,
"end_col_offset": 38,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 20,
"link": "https://cwe.mitre.org/data/definitions/20.html"
},
"issue_severity": "MEDIUM",
"issue_text": "Using xml.dom.minidom.parseString to parse untrusted XML data is known to be vulnerable to XML attacks. Replace xml.dom.minidom.parseString with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called",
"line_number": 66,
"line_range": [
66
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/blacklists/blacklist_calls.html#b313-b320-xml-bad-minidom",
"test_id": "B318",
"test_name": "blacklist"
},
{
"code": "71 command = input(\"Enter command to execute: \")\n72 process = subprocess.Popen(command, shell=True) # shell=True can be dangerous\n73 process.communicate()\n",
"col_offset": 14,
"end_col_offset": 51,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "HIGH",
"issue_cwe": {
"id": 78,
"link": "https://cwe.mitre.org/data/definitions/78.html"
},
"issue_severity": "HIGH",
"issue_text": "subprocess call with shell=True identified, security issue.",
"line_number": 72,
"line_range": [
72
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b602_subprocess_popen_with_shell_equals_true.html",
"test_id": "B602",
"test_name": "subprocess_popen_with_shell_equals_true"
},
{
"code": "128 # 13. Open Redirect via Flask\n129 app.run(debug=True)\n",
"col_offset": 4,
"end_col_offset": 23,
"filename": ".\\Python-project-5\\test-app-with-custom-vulnerabilities.py",
"issue_confidence": "MEDIUM",
"issue_cwe": {
"id": 94,
"link": "https://cwe.mitre.org/data/definitions/94.html"
},
"issue_severity": "HIGH",
"issue_text": "A Flask app appears to be run with debug=True, which exposes the Werkzeug debugger and allows the execution of arbitrary code.",
"line_number": 129,
"line_range": [
129
],
"more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b201_flask_debug_true.html",
"test_id": "B201",
"test_name": "flask_debug_true"
}
]
}