owasp-depscan 5.5.0__py3-none-any.whl → 6.0.0a2__py3-none-any.whl
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.
Potentially problematic release.
This version of owasp-depscan might be problematic. Click here for more details.
- depscan/__init__.py +8 -0
- depscan/cli.py +719 -827
- depscan/cli_options.py +302 -0
- depscan/lib/audit.py +3 -1
- depscan/lib/bom.py +390 -288
- depscan/lib/config.py +86 -337
- depscan/lib/explainer.py +363 -98
- depscan/lib/license.py +11 -10
- depscan/lib/logger.py +65 -17
- depscan/lib/package_query/__init__.py +0 -0
- depscan/lib/package_query/cargo_pkg.py +124 -0
- depscan/lib/package_query/metadata.py +170 -0
- depscan/lib/package_query/npm_pkg.py +345 -0
- depscan/lib/package_query/pkg_query.py +195 -0
- depscan/lib/package_query/pypi_pkg.py +113 -0
- depscan/lib/tomlparse.py +116 -0
- depscan/lib/utils.py +34 -188
- owasp_depscan-6.0.0a2.dist-info/METADATA +390 -0
- {owasp_depscan-5.5.0.dist-info → owasp_depscan-6.0.0a2.dist-info}/RECORD +28 -25
- {owasp_depscan-5.5.0.dist-info → owasp_depscan-6.0.0a2.dist-info}/WHEEL +1 -1
- vendor/choosealicense.com/_licenses/cern-ohl-p-2.0.txt +1 -1
- vendor/choosealicense.com/_licenses/cern-ohl-s-2.0.txt +1 -1
- vendor/choosealicense.com/_licenses/cern-ohl-w-2.0.txt +2 -2
- vendor/choosealicense.com/_licenses/mit-0.txt +1 -1
- vendor/spdx/json/licenses.json +904 -677
- depscan/lib/analysis.py +0 -1554
- depscan/lib/csaf.py +0 -1860
- depscan/lib/normalize.py +0 -312
- depscan/lib/orasclient.py +0 -142
- depscan/lib/pkg_query.py +0 -532
- owasp_depscan-5.5.0.dist-info/METADATA +0 -580
- {owasp_depscan-5.5.0.dist-info → owasp_depscan-6.0.0a2.dist-info}/entry_points.txt +0 -0
- {owasp_depscan-5.5.0.dist-info → owasp_depscan-6.0.0a2.dist-info/licenses}/LICENSE +0 -0
- {owasp_depscan-5.5.0.dist-info → owasp_depscan-6.0.0a2.dist-info}/top_level.txt +0 -0
depscan/lib/csaf.py
DELETED
|
@@ -1,1860 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import os
|
|
3
|
-
import re
|
|
4
|
-
import sys
|
|
5
|
-
from copy import deepcopy
|
|
6
|
-
from datetime import datetime
|
|
7
|
-
from json import JSONDecodeError
|
|
8
|
-
|
|
9
|
-
import cvss
|
|
10
|
-
from cvss import CVSSError
|
|
11
|
-
from packageurl import PackageURL
|
|
12
|
-
|
|
13
|
-
import toml
|
|
14
|
-
from vdb.lib import convert_time
|
|
15
|
-
|
|
16
|
-
from depscan.lib.logger import LOG
|
|
17
|
-
from depscan.lib.utils import get_version
|
|
18
|
-
|
|
19
|
-
TIME_FMT = "%Y-%m-%dT%H:%M:%S"
|
|
20
|
-
|
|
21
|
-
CWE_MAP = {
|
|
22
|
-
5: 'J2EE Misconfiguration: Data Transmission Without Encryption',
|
|
23
|
-
6: 'J2EE Misconfiguration: Insufficient Session-ID Length',
|
|
24
|
-
7: 'J2EE Misconfiguration: Missing Custom Error Page',
|
|
25
|
-
8: 'J2EE Misconfiguration: Entity Bean Declared Remote',
|
|
26
|
-
9: 'J2EE Misconfiguration: Weak Access Permissions for EJB Methods',
|
|
27
|
-
11: 'ASP.NET Misconfiguration: Creating Debug Binary',
|
|
28
|
-
12: 'ASP.NET Misconfiguration: Missing Custom Error Page',
|
|
29
|
-
13: 'ASP.NET Misconfiguration: Password in Configuration File',
|
|
30
|
-
14: 'Compiler Removal of Code to Clear Buffers',
|
|
31
|
-
15: 'External Control of System or Configuration Setting',
|
|
32
|
-
20: 'Improper Input Validation',
|
|
33
|
-
22: 'Improper Limitation of a Pathname to a Restricted Directory',
|
|
34
|
-
23: 'Relative Path Traversal',
|
|
35
|
-
24: 'Path Traversal',
|
|
36
|
-
25: 'Path Traversal',
|
|
37
|
-
26: 'Path Traversal',
|
|
38
|
-
27: 'Path Traversal',
|
|
39
|
-
28: 'Path Traversal',
|
|
40
|
-
29: 'Path Traversal',
|
|
41
|
-
30: 'Path Traversal',
|
|
42
|
-
31: 'Path Traversal',
|
|
43
|
-
32: 'Path Traversal',
|
|
44
|
-
33: 'Path Traversal',
|
|
45
|
-
34: 'Path Traversal',
|
|
46
|
-
35: 'Path Traversal',
|
|
47
|
-
36: 'Absolute Path Traversal',
|
|
48
|
-
37: 'Path Traversal',
|
|
49
|
-
38: 'Path Traversal',
|
|
50
|
-
39: 'Path Traversal',
|
|
51
|
-
40: 'Path Traversal',
|
|
52
|
-
41: 'Improper Resolution of Path Equivalence',
|
|
53
|
-
42: 'Path Equivalence',
|
|
54
|
-
43: 'Path Equivalence',
|
|
55
|
-
44: 'Path Equivalence',
|
|
56
|
-
45: 'Path Equivalence',
|
|
57
|
-
46: 'Path Equivalence',
|
|
58
|
-
47: 'Path Equivalence',
|
|
59
|
-
48: 'Path Equivalence',
|
|
60
|
-
49: 'Path Equivalence',
|
|
61
|
-
50: 'Path Equivalence',
|
|
62
|
-
51: 'Path Equivalence',
|
|
63
|
-
52: 'Path Equivalence',
|
|
64
|
-
53: 'Path Equivalence',
|
|
65
|
-
54: 'Path Equivalence',
|
|
66
|
-
55: 'Path Equivalence',
|
|
67
|
-
56: 'Path Equivalence',
|
|
68
|
-
57: 'Path Equivalence',
|
|
69
|
-
58: 'Path Equivalence',
|
|
70
|
-
59: 'Improper Link Resolution Before File Access',
|
|
71
|
-
61: 'UNIX Symbolic Link',
|
|
72
|
-
62: 'UNIX Hard Link',
|
|
73
|
-
64: 'Windows Shortcut Following',
|
|
74
|
-
65: 'Windows Hard Link',
|
|
75
|
-
66: 'Improper Handling of File Names that Identify Virtual Resources',
|
|
76
|
-
67: 'Improper Handling of Windows Device Names',
|
|
77
|
-
69: 'Improper Handling of Windows ::DATA Alternate Data Stream',
|
|
78
|
-
71: 'DEPRECATED: Apple .DS_Store',
|
|
79
|
-
72: 'Improper Handling of Apple HFS+ Alternate Data Stream Path',
|
|
80
|
-
73: 'External Control of File Name or Path',
|
|
81
|
-
74: 'Improper Neutralization of Special Elements in Output Used by a '
|
|
82
|
-
'Downstream Component',
|
|
83
|
-
75: 'Failure to Sanitize Special Elements into a Different Plane',
|
|
84
|
-
76: 'Improper Neutralization of Equivalent Special Elements',
|
|
85
|
-
77: 'Improper Neutralization of Special Elements used in a Command',
|
|
86
|
-
78: 'Improper Neutralization of Special Elements used in an OS Command',
|
|
87
|
-
79: 'Improper Neutralization of Input During Web Page Generation',
|
|
88
|
-
80: 'Improper Neutralization of Script-Related HTML Tags in a Web Page',
|
|
89
|
-
81: 'Improper Neutralization of Script in an Error Message Web Page',
|
|
90
|
-
82: 'Improper Neutralization of Script in Attributes of IMG Tags in a Web '
|
|
91
|
-
'Page',
|
|
92
|
-
83: 'Improper Neutralization of Script in Attributes in a Web Page',
|
|
93
|
-
84: 'Improper Neutralization of Encoded URI Schemes in a Web Page',
|
|
94
|
-
85: 'Doubled Character XSS Manipulations',
|
|
95
|
-
86: 'Improper Neutralization of Invalid Characters in Identifiers in Web '
|
|
96
|
-
'Pages',
|
|
97
|
-
87: 'Improper Neutralization of Alternate XSS Syntax',
|
|
98
|
-
88: 'Improper Neutralization of Argument Delimiters in a Command',
|
|
99
|
-
89: 'Improper Neutralization of Special Elements used in an SQL Command',
|
|
100
|
-
90: 'Improper Neutralization of Special Elements used in an LDAP Query',
|
|
101
|
-
91: 'XML Injection',
|
|
102
|
-
92: 'DEPRECATED: Improper Sanitization of Custom Special Characters',
|
|
103
|
-
93: 'Improper Neutralization of CRLF Sequences',
|
|
104
|
-
94: 'Improper Control of Generation of Code',
|
|
105
|
-
95: 'Improper Neutralization of Directives in Dynamically Evaluated Code',
|
|
106
|
-
96: 'Improper Neutralization of Directives in Statically Saved Code',
|
|
107
|
-
97: 'Improper Neutralization of Server-Side Includes',
|
|
108
|
-
98: 'Improper Control of Filename for Include/Require Statement in PHP '
|
|
109
|
-
'Program',
|
|
110
|
-
99: 'Improper Control of Resource Identifiers',
|
|
111
|
-
102: 'Struts: Duplicate Validation Forms',
|
|
112
|
-
103: 'Struts: Incomplete validate',
|
|
113
|
-
104: 'Struts: Form Bean Does Not Extend Validation Class',
|
|
114
|
-
105: 'Struts: Form Field Without Validator',
|
|
115
|
-
106: 'Struts: Plug-in Framework not in Use',
|
|
116
|
-
107: 'Struts: Unused Validation Form',
|
|
117
|
-
108: 'Struts: Unvalidated Action Form',
|
|
118
|
-
109: 'Struts: Validator Turned Off',
|
|
119
|
-
110: 'Struts: Validator Without Form Field',
|
|
120
|
-
111: 'Direct Use of Unsafe JNI',
|
|
121
|
-
112: 'Missing XML Validation',
|
|
122
|
-
113: 'Improper Neutralization of CRLF Sequences in HTTP Headers',
|
|
123
|
-
114: 'Process Control',
|
|
124
|
-
115: 'Misinterpretation of Input',
|
|
125
|
-
116: 'Improper Encoding or Escaping of Output',
|
|
126
|
-
117: 'Improper Output Neutralization for Logs',
|
|
127
|
-
118: 'Incorrect Access of Indexable Resource',
|
|
128
|
-
119: 'Improper Restriction of Operations within the Bounds of a Memory '
|
|
129
|
-
'Buffer',
|
|
130
|
-
120: 'Buffer Copy without Checking Size of Input',
|
|
131
|
-
121: 'Stack-based Buffer Overflow',
|
|
132
|
-
122: 'Heap-based Buffer Overflow',
|
|
133
|
-
123: 'Write-what-where Condition',
|
|
134
|
-
124: 'Buffer Underwrite',
|
|
135
|
-
125: 'Out-of-bounds Read',
|
|
136
|
-
126: 'Buffer Over-read',
|
|
137
|
-
127: 'Buffer Under-read',
|
|
138
|
-
128: 'Wrap-around Error',
|
|
139
|
-
129: 'Improper Validation of Array Index',
|
|
140
|
-
130: 'Improper Handling of Length Parameter Inconsistency',
|
|
141
|
-
131: 'Incorrect Calculation of Buffer Size',
|
|
142
|
-
132: 'DEPRECATED: Miscalculated Null Termination',
|
|
143
|
-
134: 'Use of Externally-Controlled Format String',
|
|
144
|
-
135: 'Incorrect Calculation of Multi-Byte String Length',
|
|
145
|
-
138: 'Improper Neutralization of Special Elements',
|
|
146
|
-
140: 'Improper Neutralization of Delimiters',
|
|
147
|
-
141: 'Improper Neutralization of Parameter/Argument Delimiters',
|
|
148
|
-
142: 'Improper Neutralization of Value Delimiters',
|
|
149
|
-
143: 'Improper Neutralization of Record Delimiters',
|
|
150
|
-
144: 'Improper Neutralization of Line Delimiters',
|
|
151
|
-
145: 'Improper Neutralization of Section Delimiters',
|
|
152
|
-
146: 'Improper Neutralization of Expression/Command Delimiters',
|
|
153
|
-
147: 'Improper Neutralization of Input Terminators',
|
|
154
|
-
148: 'Improper Neutralization of Input Leaders',
|
|
155
|
-
149: 'Improper Neutralization of Quoting Syntax',
|
|
156
|
-
150: 'Improper Neutralization of Escape, Meta, or Control Sequences',
|
|
157
|
-
151: 'Improper Neutralization of Comment Delimiters',
|
|
158
|
-
152: 'Improper Neutralization of Macro Symbols',
|
|
159
|
-
153: 'Improper Neutralization of Substitution Characters',
|
|
160
|
-
154: 'Improper Neutralization of Variable Name Delimiters',
|
|
161
|
-
155: 'Improper Neutralization of Wildcards or Matching Symbols',
|
|
162
|
-
156: 'Improper Neutralization of Whitespace',
|
|
163
|
-
157: 'Failure to Sanitize Paired Delimiters',
|
|
164
|
-
158: 'Improper Neutralization of Null Byte or NUL Character',
|
|
165
|
-
159: 'Improper Handling of Invalid Use of Special Elements',
|
|
166
|
-
160: 'Improper Neutralization of Leading Special Elements',
|
|
167
|
-
161: 'Improper Neutralization of Multiple Leading Special Elements',
|
|
168
|
-
162: 'Improper Neutralization of Trailing Special Elements',
|
|
169
|
-
163: 'Improper Neutralization of Multiple Trailing Special Elements',
|
|
170
|
-
164: 'Improper Neutralization of Internal Special Elements',
|
|
171
|
-
165: 'Improper Neutralization of Multiple Internal Special Elements',
|
|
172
|
-
166: 'Improper Handling of Missing Special Element',
|
|
173
|
-
167: 'Improper Handling of Additional Special Element',
|
|
174
|
-
168: 'Improper Handling of Inconsistent Special Elements',
|
|
175
|
-
170: 'Improper Null Termination',
|
|
176
|
-
172: 'Encoding Error',
|
|
177
|
-
173: 'Improper Handling of Alternate Encoding',
|
|
178
|
-
174: 'Double Decoding of the Same Data',
|
|
179
|
-
175: 'Improper Handling of Mixed Encoding',
|
|
180
|
-
176: 'Improper Handling of Unicode Encoding',
|
|
181
|
-
177: 'Improper Handling of URL Encoding',
|
|
182
|
-
178: 'Improper Handling of Case Sensitivity',
|
|
183
|
-
179: 'Incorrect Behavior Order: Early Validation',
|
|
184
|
-
180: 'Incorrect Behavior Order: Validate Before Canonicalize',
|
|
185
|
-
181: 'Incorrect Behavior Order: Validate Before Filter',
|
|
186
|
-
182: 'Collapse of Data into Unsafe Value',
|
|
187
|
-
183: 'Permissive List of Allowed Inputs',
|
|
188
|
-
184: 'Incomplete List of Disallowed Inputs',
|
|
189
|
-
185: 'Incorrect Regular Expression',
|
|
190
|
-
186: 'Overly Restrictive Regular Expression',
|
|
191
|
-
187: 'Partial String Comparison',
|
|
192
|
-
188: 'Reliance on Data/Memory Layout',
|
|
193
|
-
190: 'Integer Overflow or Wraparound',
|
|
194
|
-
191: 'Integer Underflow',
|
|
195
|
-
192: 'Integer Coercion Error',
|
|
196
|
-
193: 'Off-by-one Error',
|
|
197
|
-
194: 'Unexpected Sign Extension',
|
|
198
|
-
195: 'Signed to Unsigned Conversion Error',
|
|
199
|
-
196: 'Unsigned to Signed Conversion Error',
|
|
200
|
-
197: 'Numeric Truncation Error',
|
|
201
|
-
198: 'Use of Incorrect Byte Ordering',
|
|
202
|
-
200: 'Exposure of Sensitive Information to an Unauthorized Actor',
|
|
203
|
-
201: 'Insertion of Sensitive Information Into Sent Data',
|
|
204
|
-
202: 'Exposure of Sensitive Information Through Data Queries',
|
|
205
|
-
203: 'Observable Discrepancy',
|
|
206
|
-
204: 'Observable Response Discrepancy',
|
|
207
|
-
205: 'Observable Behavioral Discrepancy',
|
|
208
|
-
206: 'Observable Internal Behavioral Discrepancy',
|
|
209
|
-
207: 'Observable Behavioral Discrepancy With Equivalent Products',
|
|
210
|
-
208: 'Observable Timing Discrepancy',
|
|
211
|
-
209: 'Generation of Error Message Containing Sensitive Information',
|
|
212
|
-
210: 'Self-generated Error Message Containing Sensitive Information',
|
|
213
|
-
211: 'Externally-Generated Error Message Containing Sensitive Information',
|
|
214
|
-
212: 'Improper Removal of Sensitive Information Before Storage or Transfer',
|
|
215
|
-
213: 'Exposure of Sensitive Information Due to Incompatible Policies',
|
|
216
|
-
214: 'Invocation of Process Using Visible Sensitive Information',
|
|
217
|
-
215: 'Insertion of Sensitive Information Into Debugging Code',
|
|
218
|
-
216: 'DEPRECATED: Containment Errors',
|
|
219
|
-
217: 'DEPRECATED: Failure to Protect Stored Data from Modification',
|
|
220
|
-
218: 'DEPRECATED: Failure to provide confidentiality for stored data',
|
|
221
|
-
219: 'Storage of File with Sensitive Data Under Web Root',
|
|
222
|
-
220: 'Storage of File With Sensitive Data Under FTP Root',
|
|
223
|
-
221: 'Information Loss or Omission',
|
|
224
|
-
222: 'Truncation of Security-relevant Information',
|
|
225
|
-
223: 'Omission of Security-relevant Information',
|
|
226
|
-
224: 'Obscured Security-relevant Information by Alternate Name',
|
|
227
|
-
225: 'DEPRECATED: General Information Management Problems',
|
|
228
|
-
226: 'Sensitive Information in Resource Not Removed Before Reuse',
|
|
229
|
-
228: 'Improper Handling of Syntactically Invalid Structure',
|
|
230
|
-
229: 'Improper Handling of Values',
|
|
231
|
-
230: 'Improper Handling of Missing Values',
|
|
232
|
-
231: 'Improper Handling of Extra Values',
|
|
233
|
-
232: 'Improper Handling of Undefined Values',
|
|
234
|
-
233: 'Improper Handling of Parameters',
|
|
235
|
-
234: 'Failure to Handle Missing Parameter',
|
|
236
|
-
235: 'Improper Handling of Extra Parameters',
|
|
237
|
-
236: 'Improper Handling of Undefined Parameters',
|
|
238
|
-
237: 'Improper Handling of Structural Elements',
|
|
239
|
-
238: 'Improper Handling of Incomplete Structural Elements',
|
|
240
|
-
239: 'Failure to Handle Incomplete Element',
|
|
241
|
-
240: 'Improper Handling of Inconsistent Structural Elements',
|
|
242
|
-
241: 'Improper Handling of Unexpected Data Type',
|
|
243
|
-
242: 'Use of Inherently Dangerous Function',
|
|
244
|
-
243: 'Creation of chroot Jail Without Changing Working Directory',
|
|
245
|
-
244: 'Improper Clearing of Heap Memory Before Release',
|
|
246
|
-
245: 'J2EE Bad Practices: Direct Management of Connections',
|
|
247
|
-
246: 'J2EE Bad Practices: Direct Use of Sockets',
|
|
248
|
-
247: 'DEPRECATED: Reliance on DNS Lookups in a Security Decision',
|
|
249
|
-
248: 'Uncaught Exception',
|
|
250
|
-
249: 'DEPRECATED: Often Misused: Path Manipulation',
|
|
251
|
-
250: 'Execution with Unnecessary Privileges',
|
|
252
|
-
252: 'Unchecked Return Value',
|
|
253
|
-
253: 'Incorrect Check of Function Return Value',
|
|
254
|
-
256: 'Plaintext Storage of a Password',
|
|
255
|
-
257: 'Storing Passwords in a Recoverable Format',
|
|
256
|
-
258: 'Empty Password in Configuration File',
|
|
257
|
-
259: 'Use of Hard-coded Password',
|
|
258
|
-
260: 'Password in Configuration File',
|
|
259
|
-
261: 'Weak Encoding for Password',
|
|
260
|
-
262: 'Not Using Password Aging',
|
|
261
|
-
263: 'Password Aging with Long Expiration',
|
|
262
|
-
266: 'Incorrect Privilege Assignment',
|
|
263
|
-
267: 'Privilege Defined With Unsafe Actions',
|
|
264
|
-
268: 'Privilege Chaining',
|
|
265
|
-
269: 'Improper Privilege Management',
|
|
266
|
-
270: 'Privilege Context Switching Error',
|
|
267
|
-
271: 'Privilege Dropping / Lowering Errors',
|
|
268
|
-
272: 'Least Privilege Violation',
|
|
269
|
-
273: 'Improper Check for Dropped Privileges',
|
|
270
|
-
274: 'Improper Handling of Insufficient Privileges',
|
|
271
|
-
276: 'Incorrect Default Permissions',
|
|
272
|
-
277: 'Insecure Inherited Permissions',
|
|
273
|
-
278: 'Insecure Preserved Inherited Permissions',
|
|
274
|
-
279: 'Incorrect Execution-Assigned Permissions',
|
|
275
|
-
280: 'Improper Handling of Insufficient Permissions or Privileges ',
|
|
276
|
-
281: 'Improper Preservation of Permissions',
|
|
277
|
-
282: 'Improper Ownership Management',
|
|
278
|
-
283: 'Unverified Ownership',
|
|
279
|
-
284: 'Improper Access Control',
|
|
280
|
-
285: 'Improper Authorization',
|
|
281
|
-
286: 'Incorrect User Management',
|
|
282
|
-
287: 'Improper Authentication',
|
|
283
|
-
288: 'Authentication Bypass Using an Alternate Path or Channel',
|
|
284
|
-
289: 'Authentication Bypass by Alternate Name',
|
|
285
|
-
290: 'Authentication Bypass by Spoofing',
|
|
286
|
-
291: 'Reliance on IP Address for Authentication',
|
|
287
|
-
292: 'DEPRECATED: Trusting Self-reported DNS Name',
|
|
288
|
-
293: 'Using Referer Field for Authentication',
|
|
289
|
-
294: 'Authentication Bypass by Capture-replay',
|
|
290
|
-
295: 'Improper Certificate Validation',
|
|
291
|
-
296: 'Improper Following of a Certificates Chain of Trust',
|
|
292
|
-
297: 'Improper Validation of Certificate with Host Mismatch',
|
|
293
|
-
298: 'Improper Validation of Certificate Expiration',
|
|
294
|
-
299: 'Improper Check for Certificate Revocation',
|
|
295
|
-
300: 'Channel Accessible by Non-Endpoint',
|
|
296
|
-
301: 'Reflection Attack in an Authentication Protocol',
|
|
297
|
-
302: 'Authentication Bypass by Assumed-Immutable Data',
|
|
298
|
-
303: 'Incorrect Implementation of Authentication Algorithm',
|
|
299
|
-
304: 'Missing Critical Step in Authentication',
|
|
300
|
-
305: 'Authentication Bypass by Primary Weakness',
|
|
301
|
-
306: 'Missing Authentication for Critical Function',
|
|
302
|
-
307: 'Improper Restriction of Excessive Authentication Attempts',
|
|
303
|
-
308: 'Use of Single-factor Authentication',
|
|
304
|
-
309: 'Use of Password System for Primary Authentication',
|
|
305
|
-
311: 'Missing Encryption of Sensitive Data',
|
|
306
|
-
312: 'Cleartext Storage of Sensitive Information',
|
|
307
|
-
313: 'Cleartext Storage in a File or on Disk',
|
|
308
|
-
314: 'Cleartext Storage in the Registry',
|
|
309
|
-
315: 'Cleartext Storage of Sensitive Information in a Cookie',
|
|
310
|
-
316: 'Cleartext Storage of Sensitive Information in Memory',
|
|
311
|
-
317: 'Cleartext Storage of Sensitive Information in GUI',
|
|
312
|
-
318: 'Cleartext Storage of Sensitive Information in Executable',
|
|
313
|
-
319: 'Cleartext Transmission of Sensitive Information',
|
|
314
|
-
321: 'Use of Hard-coded Cryptographic Key',
|
|
315
|
-
322: 'Key Exchange without Entity Authentication',
|
|
316
|
-
323: 'Reusing a Nonce, Key Pair in Encryption',
|
|
317
|
-
324: 'Use of a Key Past its Expiration Date',
|
|
318
|
-
325: 'Missing Cryptographic Step',
|
|
319
|
-
326: 'Inadequate Encryption Strength',
|
|
320
|
-
327: 'Use of a Broken or Risky Cryptographic Algorithm',
|
|
321
|
-
328: 'Use of Weak Hash',
|
|
322
|
-
329: 'Generation of Predictable IV with CBC Mode',
|
|
323
|
-
330: 'Use of Insufficiently Random Values',
|
|
324
|
-
331: 'Insufficient Entropy',
|
|
325
|
-
332: 'Insufficient Entropy in PRNG',
|
|
326
|
-
333: 'Improper Handling of Insufficient Entropy in TRNG',
|
|
327
|
-
334: 'Small Space of Random Values',
|
|
328
|
-
335: 'Incorrect Usage of Seeds in Pseudo-Random Number Generator',
|
|
329
|
-
336: 'Same Seed in Pseudo-Random Number Generator',
|
|
330
|
-
337: 'Predictable Seed in Pseudo-Random Number Generator',
|
|
331
|
-
338: 'Use of Cryptographically Weak Pseudo-Random Number Generator',
|
|
332
|
-
339: 'Small Seed Space in PRNG',
|
|
333
|
-
340: 'Generation of Predictable Numbers or Identifiers',
|
|
334
|
-
341: 'Predictable from Observable State',
|
|
335
|
-
342: 'Predictable Exact Value from Previous Values',
|
|
336
|
-
343: 'Predictable Value Range from Previous Values',
|
|
337
|
-
344: 'Use of Invariant Value in Dynamically Changing Context',
|
|
338
|
-
345: 'Insufficient Verification of Data Authenticity',
|
|
339
|
-
346: 'Origin Validation Error',
|
|
340
|
-
347: 'Improper Verification of Cryptographic Signature',
|
|
341
|
-
348: 'Use of Less Trusted Source',
|
|
342
|
-
349: 'Acceptance of Extraneous Untrusted Data With Trusted Data',
|
|
343
|
-
350: 'Reliance on Reverse DNS Resolution for a Security-Critical Action',
|
|
344
|
-
351: 'Insufficient Type Distinction',
|
|
345
|
-
352: 'Cross-Site Request Forgery',
|
|
346
|
-
353: 'Missing Support for Integrity Check',
|
|
347
|
-
354: 'Improper Validation of Integrity Check Value',
|
|
348
|
-
356: 'Product UI does not Warn User of Unsafe Actions',
|
|
349
|
-
357: 'Insufficient UI Warning of Dangerous Operations',
|
|
350
|
-
358: 'Improperly Implemented Security Check for Standard',
|
|
351
|
-
359: 'Exposure of Private Personal Information to an Unauthorized Actor',
|
|
352
|
-
360: 'Trust of System Event Data',
|
|
353
|
-
362: 'Concurrent Execution using Shared Resource with Improper '
|
|
354
|
-
'Synchronization',
|
|
355
|
-
363: 'Race Condition Enabling Link Following',
|
|
356
|
-
364: 'Signal Handler Race Condition',
|
|
357
|
-
365: 'DEPRECATED: Race Condition in Switch',
|
|
358
|
-
366: 'Race Condition within a Thread',
|
|
359
|
-
367: 'Time-of-check Time-of-use',
|
|
360
|
-
368: 'Context Switching Race Condition',
|
|
361
|
-
369: 'Divide By Zero',
|
|
362
|
-
370: 'Missing Check for Certificate Revocation after Initial Check',
|
|
363
|
-
372: 'Incomplete Internal State Distinction',
|
|
364
|
-
373: 'DEPRECATED: State Synchronization Error',
|
|
365
|
-
374: 'Passing Mutable Objects to an Untrusted Method',
|
|
366
|
-
375: 'Returning a Mutable Object to an Untrusted Caller',
|
|
367
|
-
377: 'Insecure Temporary File',
|
|
368
|
-
378: 'Creation of Temporary File With Insecure Permissions',
|
|
369
|
-
379: 'Creation of Temporary File in Directory with Insecure Permissions',
|
|
370
|
-
382: 'J2EE Bad Practices: Use of System.exit',
|
|
371
|
-
383: 'J2EE Bad Practices: Direct Use of Threads',
|
|
372
|
-
384: 'Session Fixation',
|
|
373
|
-
385: 'Covert Timing Channel',
|
|
374
|
-
386: 'Symbolic Name not Mapping to Correct Object',
|
|
375
|
-
390: 'Detection of Error Condition Without Action',
|
|
376
|
-
391: 'Unchecked Error Condition',
|
|
377
|
-
392: 'Missing Report of Error Condition',
|
|
378
|
-
393: 'Return of Wrong Status Code',
|
|
379
|
-
394: 'Unexpected Status Code or Return Value',
|
|
380
|
-
395: 'Use of NullPointerException Catch to Detect NULL Pointer Dereference',
|
|
381
|
-
396: 'Declaration of Catch for Generic Exception',
|
|
382
|
-
397: 'Declaration of Throws for Generic Exception',
|
|
383
|
-
400: 'Uncontrolled Resource Consumption',
|
|
384
|
-
401: 'Missing Release of Memory after Effective Lifetime',
|
|
385
|
-
402: 'Transmission of Private Resources into a New Sphere',
|
|
386
|
-
403: 'Exposure of File Descriptor to Unintended Control Sphere',
|
|
387
|
-
404: 'Improper Resource Shutdown or Release',
|
|
388
|
-
405: 'Asymmetric Resource Consumption',
|
|
389
|
-
406: 'Insufficient Control of Network Message Volume',
|
|
390
|
-
407: 'Inefficient Algorithmic Complexity',
|
|
391
|
-
408: 'Incorrect Behavior Order: Early Amplification',
|
|
392
|
-
409: 'Improper Handling of Highly Compressed Data',
|
|
393
|
-
410: 'Insufficient Resource Pool',
|
|
394
|
-
412: 'Unrestricted Externally Accessible Lock',
|
|
395
|
-
413: 'Improper Resource Locking',
|
|
396
|
-
414: 'Missing Lock Check',
|
|
397
|
-
415: 'Double Free',
|
|
398
|
-
416: 'Use After Free',
|
|
399
|
-
419: 'Unprotected Primary Channel',
|
|
400
|
-
420: 'Unprotected Alternate Channel',
|
|
401
|
-
421: 'Race Condition During Access to Alternate Channel',
|
|
402
|
-
422: 'Unprotected Windows Messaging Channel',
|
|
403
|
-
423: 'DEPRECATED: Proxied Trusted Channel',
|
|
404
|
-
424: 'Improper Protection of Alternate Path',
|
|
405
|
-
425: 'Direct Request',
|
|
406
|
-
426: 'Untrusted Search Path',
|
|
407
|
-
427: 'Uncontrolled Search Path Element',
|
|
408
|
-
428: 'Unquoted Search Path or Element',
|
|
409
|
-
430: 'Deployment of Wrong Handler',
|
|
410
|
-
431: 'Missing Handler',
|
|
411
|
-
432: 'Dangerous Signal Handler not Disabled During Sensitive Operations',
|
|
412
|
-
433: 'Unparsed Raw Web Content Delivery',
|
|
413
|
-
434: 'Unrestricted Upload of File with Dangerous Type',
|
|
414
|
-
435: 'Improper Interaction Between Multiple Correctly-Behaving Entities',
|
|
415
|
-
436: 'Interpretation Conflict',
|
|
416
|
-
437: 'Incomplete Model of Endpoint Features',
|
|
417
|
-
439: 'Behavioral Change in New Version or Environment',
|
|
418
|
-
440: 'Expected Behavior Violation',
|
|
419
|
-
441: 'Unintended Proxy or Intermediary',
|
|
420
|
-
443: 'DEPRECATED: HTTP response splitting',
|
|
421
|
-
444: 'Inconsistent Interpretation of HTTP Requests',
|
|
422
|
-
446: 'UI Discrepancy for Security Feature',
|
|
423
|
-
447: 'Unimplemented or Unsupported Feature in UI',
|
|
424
|
-
448: 'Obsolete Feature in UI',
|
|
425
|
-
449: 'The UI Performs the Wrong Action',
|
|
426
|
-
450: 'Multiple Interpretations of UI Input',
|
|
427
|
-
451: 'User Interface',
|
|
428
|
-
453: 'Insecure Default Variable Initialization',
|
|
429
|
-
454: 'External Initialization of Trusted Variables or Data Stores',
|
|
430
|
-
455: 'Non-exit on Failed Initialization',
|
|
431
|
-
456: 'Missing Initialization of a Variable',
|
|
432
|
-
457: 'Use of Uninitialized Variable',
|
|
433
|
-
458: 'DEPRECATED: Incorrect Initialization',
|
|
434
|
-
459: 'Incomplete Cleanup',
|
|
435
|
-
460: 'Improper Cleanup on Thrown Exception',
|
|
436
|
-
462: 'Duplicate Key in Associative List',
|
|
437
|
-
463: 'Deletion of Data Structure Sentinel',
|
|
438
|
-
464: 'Addition of Data Structure Sentinel',
|
|
439
|
-
466: 'Return of Pointer Value Outside of Expected Range',
|
|
440
|
-
467: 'Use of sizeof',
|
|
441
|
-
468: 'Incorrect Pointer Scaling',
|
|
442
|
-
469: 'Use of Pointer Subtraction to Determine Size',
|
|
443
|
-
470: 'Use of Externally-Controlled Input to Select Classes or Code',
|
|
444
|
-
471: 'Modification of Assumed-Immutable Data',
|
|
445
|
-
472: 'External Control of Assumed-Immutable Web Parameter',
|
|
446
|
-
473: 'PHP External Variable Modification',
|
|
447
|
-
474: 'Use of Function with Inconsistent Implementations',
|
|
448
|
-
475: 'Undefined Behavior for Input to API',
|
|
449
|
-
476: 'NULL Pointer Dereference',
|
|
450
|
-
477: 'Use of Obsolete Function',
|
|
451
|
-
478: 'Missing Default Case in Multiple Condition Expression',
|
|
452
|
-
479: 'Signal Handler Use of a Non-reentrant Function',
|
|
453
|
-
480: 'Use of Incorrect Operator',
|
|
454
|
-
481: 'Assigning instead of Comparing',
|
|
455
|
-
482: 'Comparing instead of Assigning',
|
|
456
|
-
483: 'Incorrect Block Delimitation',
|
|
457
|
-
484: 'Omitted Break Statement in Switch',
|
|
458
|
-
486: 'Comparison of Classes by Name',
|
|
459
|
-
487: 'Reliance on Package-level Scope',
|
|
460
|
-
488: 'Exposure of Data Element to Wrong Session',
|
|
461
|
-
489: 'Active Debug Code',
|
|
462
|
-
491: 'Public cloneable',
|
|
463
|
-
492: 'Use of Inner Class Containing Sensitive Data',
|
|
464
|
-
493: 'Critical Public Variable Without Final Modifier',
|
|
465
|
-
494: 'Download of Code Without Integrity Check',
|
|
466
|
-
495: 'Private Data Structure Returned From A Public Method',
|
|
467
|
-
496: 'Public Data Assigned to Private Array-Typed Field',
|
|
468
|
-
497: 'Exposure of Sensitive System Information to an Unauthorized Control '
|
|
469
|
-
'Sphere',
|
|
470
|
-
498: 'Cloneable Class Containing Sensitive Information',
|
|
471
|
-
499: 'Serializable Class Containing Sensitive Data',
|
|
472
|
-
500: 'Public Static Field Not Marked Final',
|
|
473
|
-
501: 'Trust Boundary Violation',
|
|
474
|
-
502: 'Deserialization of Untrusted Data',
|
|
475
|
-
506: 'Embedded Malicious Code',
|
|
476
|
-
507: 'Trojan Horse',
|
|
477
|
-
508: 'Non-Replicating Malicious Code',
|
|
478
|
-
509: 'Replicating Malicious Code',
|
|
479
|
-
510: 'Trapdoor',
|
|
480
|
-
511: 'Logic/Time Bomb',
|
|
481
|
-
512: 'Spyware',
|
|
482
|
-
514: 'Covert Channel',
|
|
483
|
-
515: 'Covert Storage Channel',
|
|
484
|
-
516: 'DEPRECATED: Covert Timing Channel',
|
|
485
|
-
520: '.NET Misconfiguration: Use of Impersonation',
|
|
486
|
-
521: 'Weak Password Requirements',
|
|
487
|
-
522: 'Insufficiently Protected Credentials',
|
|
488
|
-
523: 'Unprotected Transport of Credentials',
|
|
489
|
-
524: 'Use of Cache Containing Sensitive Information',
|
|
490
|
-
525: 'Use of Web Browser Cache Containing Sensitive Information',
|
|
491
|
-
526: 'Cleartext Storage of Sensitive Information in an Environment '
|
|
492
|
-
'Variable',
|
|
493
|
-
527: 'Exposure of Version-Control Repository to an Unauthorized Control '
|
|
494
|
-
'Sphere',
|
|
495
|
-
528: 'Exposure of Core Dump File to an Unauthorized Control Sphere',
|
|
496
|
-
529: 'Exposure of Access Control List Files to an Unauthorized Control '
|
|
497
|
-
'Sphere',
|
|
498
|
-
530: 'Exposure of Backup File to an Unauthorized Control Sphere',
|
|
499
|
-
531: 'Inclusion of Sensitive Information in Test Code',
|
|
500
|
-
532: 'Insertion of Sensitive Information into Log File',
|
|
501
|
-
533: 'DEPRECATED: Information Exposure Through Server Log Files',
|
|
502
|
-
534: 'DEPRECATED: Information Exposure Through Debug Log Files',
|
|
503
|
-
535: 'Exposure of Information Through Shell Error Message',
|
|
504
|
-
536: 'Servlet Runtime Error Message Containing Sensitive Information',
|
|
505
|
-
537: 'Java Runtime Error Message Containing Sensitive Information',
|
|
506
|
-
538: 'Insertion of Sensitive Information into Externally-Accessible File or'
|
|
507
|
-
' Directory',
|
|
508
|
-
539: 'Use of Persistent Cookies Containing Sensitive Information',
|
|
509
|
-
540: 'Inclusion of Sensitive Information in Source Code',
|
|
510
|
-
541: 'Inclusion of Sensitive Information in an Include File',
|
|
511
|
-
542: 'DEPRECATED: Information Exposure Through Cleanup Log Files',
|
|
512
|
-
543: 'Use of Singleton Pattern Without Synchronization in a Multithreaded '
|
|
513
|
-
'Context',
|
|
514
|
-
544: 'Missing Standardized Error Handling Mechanism',
|
|
515
|
-
545: 'DEPRECATED: Use of Dynamic Class Loading',
|
|
516
|
-
546: 'Suspicious Comment',
|
|
517
|
-
547: 'Use of Hard-coded, Security-relevant Constants',
|
|
518
|
-
548: 'Exposure of Information Through Directory Listing',
|
|
519
|
-
549: 'Missing Password Field Masking',
|
|
520
|
-
550: 'Server-generated Error Message Containing Sensitive Information',
|
|
521
|
-
551: 'Incorrect Behavior Order: Authorization Before Parsing and '
|
|
522
|
-
'Canonicalization',
|
|
523
|
-
552: 'Files or Directories Accessible to External Parties',
|
|
524
|
-
553: 'Command Shell in Externally Accessible Directory',
|
|
525
|
-
554: 'ASP.NET Misconfiguration: Not Using Input Validation Framework',
|
|
526
|
-
555: 'J2EE Misconfiguration: Plaintext Password in Configuration File',
|
|
527
|
-
556: 'ASP.NET Misconfiguration: Use of Identity Impersonation',
|
|
528
|
-
558: 'Use of getlogin',
|
|
529
|
-
560: 'Use of umask',
|
|
530
|
-
561: 'Dead Code',
|
|
531
|
-
562: 'Return of Stack Variable Address',
|
|
532
|
-
563: 'Assignment to Variable without Use',
|
|
533
|
-
564: 'SQL Injection: Hibernate',
|
|
534
|
-
565: 'Reliance on Cookies without Validation and Integrity Checking',
|
|
535
|
-
566: 'Authorization Bypass Through User-Controlled SQL Primary Key',
|
|
536
|
-
567: 'Unsynchronized Access to Shared Data in a Multithreaded Context',
|
|
537
|
-
568: 'finalize',
|
|
538
|
-
570: 'Expression is Always False',
|
|
539
|
-
571: 'Expression is Always True',
|
|
540
|
-
572: 'Call to Thread run',
|
|
541
|
-
573: 'Improper Following of Specification by Caller',
|
|
542
|
-
574: 'EJB Bad Practices: Use of Synchronization Primitives',
|
|
543
|
-
575: 'EJB Bad Practices: Use of AWT Swing',
|
|
544
|
-
576: 'EJB Bad Practices: Use of Java I/O',
|
|
545
|
-
577: 'EJB Bad Practices: Use of Sockets',
|
|
546
|
-
578: 'EJB Bad Practices: Use of Class Loader',
|
|
547
|
-
579: 'J2EE Bad Practices: Non-serializable Object Stored in Session',
|
|
548
|
-
580: 'clone',
|
|
549
|
-
581: 'Object Model Violation: Just One of Equals and Hashcode Defined',
|
|
550
|
-
582: 'Array Declared Public, Final, and Static',
|
|
551
|
-
583: 'finalize',
|
|
552
|
-
584: 'Return Inside Finally Block',
|
|
553
|
-
585: 'Empty Synchronized Block',
|
|
554
|
-
586: 'Explicit Call to Finalize',
|
|
555
|
-
587: 'Assignment of a Fixed Address to a Pointer',
|
|
556
|
-
588: 'Attempt to Access Child of a Non-structure Pointer',
|
|
557
|
-
589: 'Call to Non-ubiquitous API',
|
|
558
|
-
590: 'Free of Memory not on the Heap',
|
|
559
|
-
591: 'Sensitive Data Storage in Improperly Locked Memory',
|
|
560
|
-
592: 'DEPRECATED: Authentication Bypass Issues',
|
|
561
|
-
593: 'Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects '
|
|
562
|
-
'are Created',
|
|
563
|
-
594: 'J2EE Framework: Saving Unserializable Objects to Disk',
|
|
564
|
-
595: 'Comparison of Object References Instead of Object Contents',
|
|
565
|
-
596: 'DEPRECATED: Incorrect Semantic Object Comparison',
|
|
566
|
-
597: 'Use of Wrong Operator in String Comparison',
|
|
567
|
-
598: 'Use of GET Request Method With Sensitive Query Strings',
|
|
568
|
-
599: 'Missing Validation of OpenSSL Certificate',
|
|
569
|
-
600: 'Uncaught Exception in Servlet ',
|
|
570
|
-
601: 'URL Redirection to Untrusted Site',
|
|
571
|
-
602: 'Client-Side Enforcement of Server-Side Security',
|
|
572
|
-
603: 'Use of Client-Side Authentication',
|
|
573
|
-
605: 'Multiple Binds to the Same Port',
|
|
574
|
-
606: 'Unchecked Input for Loop Condition',
|
|
575
|
-
607: 'Public Static Final Field References Mutable Object',
|
|
576
|
-
608: 'Struts: Non-private Field in ActionForm Class',
|
|
577
|
-
609: 'Double-Checked Locking',
|
|
578
|
-
610: 'Externally Controlled Reference to a Resource in Another Sphere',
|
|
579
|
-
611: 'Improper Restriction of XML External Entity Reference',
|
|
580
|
-
612: 'Improper Authorization of Index Containing Sensitive Information',
|
|
581
|
-
613: 'Insufficient Session Expiration',
|
|
582
|
-
614: 'Sensitive Cookie in HTTPS Session Without Secure Attribute',
|
|
583
|
-
615: 'Inclusion of Sensitive Information in Source Code Comments',
|
|
584
|
-
616: 'Incomplete Identification of Uploaded File Variables',
|
|
585
|
-
617: 'Reachable Assertion',
|
|
586
|
-
618: 'Exposed Unsafe ActiveX Method',
|
|
587
|
-
619: 'Dangling Database Cursor',
|
|
588
|
-
620: 'Unverified Password Change',
|
|
589
|
-
621: 'Variable Extraction Error',
|
|
590
|
-
622: 'Improper Validation of Function Hook Arguments',
|
|
591
|
-
623: 'Unsafe ActiveX Control Marked Safe For Scripting',
|
|
592
|
-
624: 'Executable Regular Expression Error',
|
|
593
|
-
625: 'Permissive Regular Expression',
|
|
594
|
-
626: 'Null Byte Interaction Error',
|
|
595
|
-
627: 'Dynamic Variable Evaluation',
|
|
596
|
-
628: 'Function Call with Incorrectly Specified Arguments',
|
|
597
|
-
636: 'Not Failing Securely',
|
|
598
|
-
637: 'Unnecessary Complexity in Protection Mechanism',
|
|
599
|
-
638: 'Not Using Complete Mediation',
|
|
600
|
-
639: 'Authorization Bypass Through User-Controlled Key',
|
|
601
|
-
640: 'Weak Password Recovery Mechanism for Forgotten Password',
|
|
602
|
-
641: 'Improper Restriction of Names for Files and Other Resources',
|
|
603
|
-
642: 'External Control of Critical State Data',
|
|
604
|
-
643: 'Improper Neutralization of Data within XPath Expressions',
|
|
605
|
-
644: 'Improper Neutralization of HTTP Headers for Scripting Syntax',
|
|
606
|
-
645: 'Overly Restrictive Account Lockout Mechanism',
|
|
607
|
-
646: 'Reliance on File Name or Extension of Externally-Supplied File',
|
|
608
|
-
647: 'Use of Non-Canonical URL Paths for Authorization Decisions',
|
|
609
|
-
648: 'Incorrect Use of Privileged APIs',
|
|
610
|
-
649: 'Reliance on Obfuscation or Encryption of Security-Relevant Inputs '
|
|
611
|
-
'without Integrity Checking',
|
|
612
|
-
650: 'Trusting HTTP Permission Methods on the Server Side',
|
|
613
|
-
651: 'Exposure of WSDL File Containing Sensitive Information',
|
|
614
|
-
652: 'Improper Neutralization of Data within XQuery Expressions',
|
|
615
|
-
653: 'Improper Isolation or Compartmentalization',
|
|
616
|
-
654: 'Reliance on a Single Factor in a Security Decision',
|
|
617
|
-
655: 'Insufficient Psychological Acceptability',
|
|
618
|
-
656: 'Reliance on Security Through Obscurity',
|
|
619
|
-
657: 'Violation of Secure Design Principles',
|
|
620
|
-
662: 'Improper Synchronization',
|
|
621
|
-
663: 'Use of a Non-reentrant Function in a Concurrent Context',
|
|
622
|
-
664: 'Improper Control of a Resource Through its Lifetime',
|
|
623
|
-
665: 'Improper Initialization',
|
|
624
|
-
666: 'Operation on Resource in Wrong Phase of Lifetime',
|
|
625
|
-
667: 'Improper Locking',
|
|
626
|
-
668: 'Exposure of Resource to Wrong Sphere',
|
|
627
|
-
669: 'Incorrect Resource Transfer Between Spheres',
|
|
628
|
-
670: 'Always-Incorrect Control Flow Implementation',
|
|
629
|
-
671: 'Lack of Administrator Control over Security',
|
|
630
|
-
672: 'Operation on a Resource after Expiration or Release',
|
|
631
|
-
673: 'External Influence of Sphere Definition',
|
|
632
|
-
674: 'Uncontrolled Recursion',
|
|
633
|
-
675: 'Multiple Operations on Resource in Single-Operation Context',
|
|
634
|
-
676: 'Use of Potentially Dangerous Function',
|
|
635
|
-
680: 'Integer Overflow to Buffer Overflow',
|
|
636
|
-
681: 'Incorrect Conversion between Numeric Types',
|
|
637
|
-
682: 'Incorrect Calculation',
|
|
638
|
-
683: 'Function Call With Incorrect Order of Arguments',
|
|
639
|
-
684: 'Incorrect Provision of Specified Functionality',
|
|
640
|
-
685: 'Function Call With Incorrect Number of Arguments',
|
|
641
|
-
686: 'Function Call With Incorrect Argument Type',
|
|
642
|
-
687: 'Function Call With Incorrectly Specified Argument Value',
|
|
643
|
-
688: 'Function Call With Incorrect Variable or Reference as Argument',
|
|
644
|
-
689: 'Permission Race Condition During Resource Copy',
|
|
645
|
-
690: 'Unchecked Return Value to NULL Pointer Dereference',
|
|
646
|
-
691: 'Insufficient Control Flow Management',
|
|
647
|
-
692: 'Incomplete Denylist to Cross-Site Scripting',
|
|
648
|
-
693: 'Protection Mechanism Failure',
|
|
649
|
-
694: 'Use of Multiple Resources with Duplicate Identifier',
|
|
650
|
-
695: 'Use of Low-Level Functionality',
|
|
651
|
-
696: 'Incorrect Behavior Order',
|
|
652
|
-
697: 'Incorrect Comparison',
|
|
653
|
-
698: 'Execution After Redirect',
|
|
654
|
-
703: 'Improper Check or Handling of Exceptional Conditions',
|
|
655
|
-
704: 'Incorrect Type Conversion or Cast',
|
|
656
|
-
705: 'Incorrect Control Flow Scoping',
|
|
657
|
-
706: 'Use of Incorrectly-Resolved Name or Reference',
|
|
658
|
-
707: 'Improper Neutralization',
|
|
659
|
-
708: 'Incorrect Ownership Assignment',
|
|
660
|
-
710: 'Improper Adherence to Coding Standards',
|
|
661
|
-
732: 'Incorrect Permission Assignment for Critical Resource',
|
|
662
|
-
733: 'Compiler Optimization Removal or Modification of Security-critical '
|
|
663
|
-
'Code',
|
|
664
|
-
749: 'Exposed Dangerous Method or Function',
|
|
665
|
-
754: 'Improper Check for Unusual or Exceptional Conditions',
|
|
666
|
-
755: 'Improper Handling of Exceptional Conditions',
|
|
667
|
-
756: 'Missing Custom Error Page',
|
|
668
|
-
757: 'Selection of Less-Secure Algorithm During Negotiation',
|
|
669
|
-
758: 'Reliance on Undefined, Unspecified, or Implementation-Defined '
|
|
670
|
-
'Behavior',
|
|
671
|
-
759: 'Use of a One-Way Hash without a Salt',
|
|
672
|
-
760: 'Use of a One-Way Hash with a Predictable Salt',
|
|
673
|
-
761: 'Free of Pointer not at Start of Buffer',
|
|
674
|
-
762: 'Mismatched Memory Management Routines',
|
|
675
|
-
763: 'Release of Invalid Pointer or Reference',
|
|
676
|
-
764: 'Multiple Locks of a Critical Resource',
|
|
677
|
-
765: 'Multiple Unlocks of a Critical Resource',
|
|
678
|
-
766: 'Critical Data Element Declared Public',
|
|
679
|
-
767: 'Access to Critical Private Variable via Public Method',
|
|
680
|
-
768: 'Incorrect Short Circuit Evaluation',
|
|
681
|
-
769: 'DEPRECATED: Uncontrolled File Descriptor Consumption',
|
|
682
|
-
770: 'Allocation of Resources Without Limits or Throttling',
|
|
683
|
-
771: 'Missing Reference to Active Allocated Resource',
|
|
684
|
-
772: 'Missing Release of Resource after Effective Lifetime',
|
|
685
|
-
773: 'Missing Reference to Active File Descriptor or Handle',
|
|
686
|
-
774: 'Allocation of File Descriptors or Handles Without Limits or '
|
|
687
|
-
'Throttling',
|
|
688
|
-
775: 'Missing Release of File Descriptor or Handle after Effective '
|
|
689
|
-
'Lifetime',
|
|
690
|
-
776: 'Improper Restriction of Recursive Entity References in DTDs',
|
|
691
|
-
777: 'Regular Expression without Anchors',
|
|
692
|
-
778: 'Insufficient Logging',
|
|
693
|
-
779: 'Logging of Excessive Data',
|
|
694
|
-
780: 'Use of RSA Algorithm without OAEP',
|
|
695
|
-
781: 'Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control '
|
|
696
|
-
'Code',
|
|
697
|
-
782: 'Exposed IOCTL with Insufficient Access Control',
|
|
698
|
-
783: 'Operator Precedence Logic Error',
|
|
699
|
-
784: 'Reliance on Cookies without Validation and Integrity Checking in a '
|
|
700
|
-
'Security Decision',
|
|
701
|
-
785: 'Use of Path Manipulation Function without Maximum-sized Buffer',
|
|
702
|
-
786: 'Access of Memory Location Before Start of Buffer',
|
|
703
|
-
787: 'Out-of-bounds Write',
|
|
704
|
-
788: 'Access of Memory Location After End of Buffer',
|
|
705
|
-
789: 'Memory Allocation with Excessive Size Value',
|
|
706
|
-
790: 'Improper Filtering of Special Elements',
|
|
707
|
-
791: 'Incomplete Filtering of Special Elements',
|
|
708
|
-
792: 'Incomplete Filtering of One or More Instances of Special Elements',
|
|
709
|
-
793: 'Only Filtering One Instance of a Special Element',
|
|
710
|
-
794: 'Incomplete Filtering of Multiple Instances of Special Elements',
|
|
711
|
-
795: 'Only Filtering Special Elements at a Specified Location',
|
|
712
|
-
796: 'Only Filtering Special Elements Relative to a Marker',
|
|
713
|
-
797: 'Only Filtering Special Elements at an Absolute Position',
|
|
714
|
-
798: 'Use of Hard-coded Credentials',
|
|
715
|
-
799: 'Improper Control of Interaction Frequency',
|
|
716
|
-
804: 'Guessable CAPTCHA',
|
|
717
|
-
805: 'Buffer Access with Incorrect Length Value',
|
|
718
|
-
806: 'Buffer Access Using Size of Source Buffer',
|
|
719
|
-
807: 'Reliance on Untrusted Inputs in a Security Decision',
|
|
720
|
-
820: 'Missing Synchronization',
|
|
721
|
-
821: 'Incorrect Synchronization',
|
|
722
|
-
822: 'Untrusted Pointer Dereference',
|
|
723
|
-
823: 'Use of Out-of-range Pointer Offset',
|
|
724
|
-
824: 'Access of Uninitialized Pointer',
|
|
725
|
-
825: 'Expired Pointer Dereference',
|
|
726
|
-
826: 'Premature Release of Resource During Expected Lifetime',
|
|
727
|
-
827: 'Improper Control of Document Type Definition',
|
|
728
|
-
828: 'Signal Handler with Functionality that is not Asynchronous-Safe',
|
|
729
|
-
829: 'Inclusion of Functionality from Untrusted Control Sphere',
|
|
730
|
-
830: 'Inclusion of Web Functionality from an Untrusted Source',
|
|
731
|
-
831: 'Signal Handler Function Associated with Multiple Signals',
|
|
732
|
-
832: 'Unlock of a Resource that is not Locked',
|
|
733
|
-
833: 'Deadlock',
|
|
734
|
-
834: 'Excessive Iteration',
|
|
735
|
-
835: 'Loop with Unreachable Exit Condition',
|
|
736
|
-
836: 'Use of Password Hash Instead of Password for Authentication',
|
|
737
|
-
837: 'Improper Enforcement of a Single, Unique Action',
|
|
738
|
-
838: 'Inappropriate Encoding for Output Context',
|
|
739
|
-
839: 'Numeric Range Comparison Without Minimum Check',
|
|
740
|
-
841: 'Improper Enforcement of Behavioral Workflow',
|
|
741
|
-
842: 'Placement of User into Incorrect Group',
|
|
742
|
-
843: 'Access of Resource Using Incompatible Type',
|
|
743
|
-
862: 'Missing Authorization',
|
|
744
|
-
863: 'Incorrect Authorization',
|
|
745
|
-
908: 'Use of Uninitialized Resource',
|
|
746
|
-
909: 'Missing Initialization of Resource',
|
|
747
|
-
910: 'Use of Expired File Descriptor',
|
|
748
|
-
911: 'Improper Update of Reference Count',
|
|
749
|
-
912: 'Hidden Functionality',
|
|
750
|
-
913: 'Improper Control of Dynamically-Managed Code Resources',
|
|
751
|
-
914: 'Improper Control of Dynamically-Identified Variables',
|
|
752
|
-
915: 'Improperly Controlled Modification of Dynamically-Determined Object '
|
|
753
|
-
'Attributes',
|
|
754
|
-
916: 'Use of Password Hash With Insufficient Computational Effort',
|
|
755
|
-
917: 'Improper Neutralization of Special Elements used in an Expression '
|
|
756
|
-
'Language Statement',
|
|
757
|
-
918: 'Server-Side Request Forgery',
|
|
758
|
-
920: 'Improper Restriction of Power Consumption',
|
|
759
|
-
921: 'Storage of Sensitive Data in a Mechanism without Access Control',
|
|
760
|
-
922: 'Insecure Storage of Sensitive Information',
|
|
761
|
-
923: 'Improper Restriction of Communication Channel to Intended Endpoints',
|
|
762
|
-
924: 'Improper Enforcement of Message Integrity During Transmission in a '
|
|
763
|
-
'Communication Channel',
|
|
764
|
-
925: 'Improper Verification of Intent by Broadcast Receiver',
|
|
765
|
-
926: 'Improper Export of Android Application Components',
|
|
766
|
-
927: 'Use of Implicit Intent for Sensitive Communication',
|
|
767
|
-
939: 'Improper Authorization in Handler for Custom URL Scheme',
|
|
768
|
-
940: 'Improper Verification of Source of a Communication Channel',
|
|
769
|
-
941: 'Incorrectly Specified Destination in a Communication Channel',
|
|
770
|
-
942: 'Permissive Cross-domain Policy with Untrusted Domains',
|
|
771
|
-
943: 'Improper Neutralization of Special Elements in Data Query Logic',
|
|
772
|
-
1004: 'Sensitive Cookie Without HttpOnly Flag',
|
|
773
|
-
1007: 'Insufficient Visual Distinction of Homoglyphs Presented to User',
|
|
774
|
-
1021: 'Improper Restriction of Rendered UI Layers or Frames',
|
|
775
|
-
1022: 'Use of Web Link to Untrusted Target with window.opener Access',
|
|
776
|
-
1023: 'Incomplete Comparison with Missing Factors',
|
|
777
|
-
1024: 'Comparison of Incompatible Types',
|
|
778
|
-
1025: 'Comparison Using Wrong Factors',
|
|
779
|
-
1037: 'Processor Optimization Removal or Modification of '
|
|
780
|
-
'Security-critical Code',
|
|
781
|
-
1038: 'Insecure Automated Optimizations',
|
|
782
|
-
1039: 'Automated Recognition Mechanism with Inadequate Detection or '
|
|
783
|
-
'Handling of Adversarial Input Perturbations',
|
|
784
|
-
1041: 'Use of Redundant Code',
|
|
785
|
-
1042: 'Static Member Data Element outside of a Singleton Class Element',
|
|
786
|
-
1043: 'Data Element Aggregating an Excessively Large Number of '
|
|
787
|
-
'Non-Primitive Elements',
|
|
788
|
-
1044: 'Architecture with Number of Horizontal Layers Outside of Expected '
|
|
789
|
-
'Range',
|
|
790
|
-
1045: 'Parent Class with a Virtual Destructor and a Child Class without a '
|
|
791
|
-
'Virtual Destructor',
|
|
792
|
-
1046: 'Creation of Immutable Text Using String Concatenation',
|
|
793
|
-
1047: 'Modules with Circular Dependencies',
|
|
794
|
-
1048: 'Invokable Control Element with Large Number of Outward Calls',
|
|
795
|
-
1049: 'Excessive Data Query Operations in a Large Data Table',
|
|
796
|
-
1050: 'Excessive Platform Resource Consumption within a Loop',
|
|
797
|
-
1051: 'Initialization with Hard-Coded Network Resource Configuration Data',
|
|
798
|
-
1052: 'Excessive Use of Hard-Coded Literals in Initialization',
|
|
799
|
-
1053: 'Missing Documentation for Design',
|
|
800
|
-
1054: 'Invocation of a Control Element at an Unnecessarily Deep '
|
|
801
|
-
'Horizontal Layer',
|
|
802
|
-
1055: 'Multiple Inheritance from Concrete Classes',
|
|
803
|
-
1056: 'Invokable Control Element with Variadic Parameters',
|
|
804
|
-
1057: 'Data Access Operations Outside of Expected Data Manager Component',
|
|
805
|
-
1058: 'Invokable Control Element in Multi-Thread Context with non-Final '
|
|
806
|
-
'Static Storable or Member Element',
|
|
807
|
-
1059: 'Insufficient Technical Documentation',
|
|
808
|
-
1060: 'Excessive Number of Inefficient Server-Side Data Accesses',
|
|
809
|
-
1061: 'Insufficient Encapsulation',
|
|
810
|
-
1062: 'Parent Class with References to Child Class',
|
|
811
|
-
1063: 'Creation of Class Instance within a Static Code Block',
|
|
812
|
-
1064: 'Invokable Control Element with Signature Containing an Excessive '
|
|
813
|
-
'Number of Parameters',
|
|
814
|
-
1065: 'Runtime Resource Management Control Element in a Component Built '
|
|
815
|
-
'to Run on Application Servers',
|
|
816
|
-
1066: 'Missing Serialization Control Element',
|
|
817
|
-
1067: 'Excessive Execution of Sequential Searches of Data Resource',
|
|
818
|
-
1068: 'Inconsistency Between Implementation and Documented Design',
|
|
819
|
-
1069: 'Empty Exception Block',
|
|
820
|
-
1070: 'Serializable Data Element Containing non-Serializable Item Elements',
|
|
821
|
-
1071: 'Empty Code Block',
|
|
822
|
-
1072: 'Data Resource Access without Use of Connection Pooling',
|
|
823
|
-
1073: 'Non-SQL Invokable Control Element with Excessive Number of Data '
|
|
824
|
-
'Resource Accesses',
|
|
825
|
-
1074: 'Class with Excessively Deep Inheritance',
|
|
826
|
-
1075: 'Unconditional Control Flow Transfer outside of Switch Block',
|
|
827
|
-
1076: 'Insufficient Adherence to Expected Conventions',
|
|
828
|
-
1077: 'Floating Point Comparison with Incorrect Operator',
|
|
829
|
-
1078: 'Inappropriate Source Code Style or Formatting',
|
|
830
|
-
1079: 'Parent Class without Virtual Destructor Method',
|
|
831
|
-
1080: 'Source Code File with Excessive Number of Lines of Code',
|
|
832
|
-
1082: 'Class Instance Self Destruction Control Element',
|
|
833
|
-
1083: 'Data Access from Outside Expected Data Manager Component',
|
|
834
|
-
1084: 'Invokable Control Element with Excessive File or Data Access '
|
|
835
|
-
'Operations',
|
|
836
|
-
1085: 'Invokable Control Element with Excessive Volume of Commented-out '
|
|
837
|
-
'Code',
|
|
838
|
-
1086: 'Class with Excessive Number of Child Classes',
|
|
839
|
-
1087: 'Class with Virtual Method without a Virtual Destructor',
|
|
840
|
-
1088: 'Synchronous Access of Remote Resource without Timeout',
|
|
841
|
-
1089: 'Large Data Table with Excessive Number of Indices',
|
|
842
|
-
1090: 'Method Containing Access of a Member Element from Another Class',
|
|
843
|
-
1091: 'Use of Object without Invoking Destructor Method',
|
|
844
|
-
1092: 'Use of Same Invokable Control Element in Multiple Architectural '
|
|
845
|
-
'Layers',
|
|
846
|
-
1093: 'Excessively Complex Data Representation',
|
|
847
|
-
1094: 'Excessive Index Range Scan for a Data Resource',
|
|
848
|
-
1095: 'Loop Condition Value Update within the Loop',
|
|
849
|
-
1096: 'Singleton Class Instance Creation without Proper Locking or '
|
|
850
|
-
'Synchronization',
|
|
851
|
-
1097: 'Persistent Storable Data Element without Associated Comparison '
|
|
852
|
-
'Control Element',
|
|
853
|
-
1098: 'Data Element containing Pointer Item without Proper Copy Control '
|
|
854
|
-
'Element',
|
|
855
|
-
1099: 'Inconsistent Naming Conventions for Identifiers',
|
|
856
|
-
1100: 'Insufficient Isolation of System-Dependent Functions',
|
|
857
|
-
1101: 'Reliance on Runtime Component in Generated Code',
|
|
858
|
-
1102: 'Reliance on Machine-Dependent Data Representation',
|
|
859
|
-
1103: 'Use of Platform-Dependent Third Party Components',
|
|
860
|
-
1104: 'Use of Unmaintained Third Party Components',
|
|
861
|
-
1105: 'Insufficient Encapsulation of Machine-Dependent Functionality',
|
|
862
|
-
1106: 'Insufficient Use of Symbolic Constants',
|
|
863
|
-
1107: 'Insufficient Isolation of Symbolic Constant Definitions',
|
|
864
|
-
1108: 'Excessive Reliance on Global Variables',
|
|
865
|
-
1109: 'Use of Same Variable for Multiple Purposes',
|
|
866
|
-
1110: 'Incomplete Design Documentation',
|
|
867
|
-
1111: 'Incomplete I/O Documentation',
|
|
868
|
-
1112: 'Incomplete Documentation of Program Execution',
|
|
869
|
-
1113: 'Inappropriate Comment Style',
|
|
870
|
-
1114: 'Inappropriate Whitespace Style',
|
|
871
|
-
1115: 'Source Code Element without Standard Prologue',
|
|
872
|
-
1116: 'Inaccurate Comments',
|
|
873
|
-
1117: 'Callable with Insufficient Behavioral Summary',
|
|
874
|
-
1118: 'Insufficient Documentation of Error Handling Techniques',
|
|
875
|
-
1119: 'Excessive Use of Unconditional Branching',
|
|
876
|
-
1120: 'Excessive Code Complexity',
|
|
877
|
-
1121: 'Excessive McCabe Cyclomatic Complexity',
|
|
878
|
-
1122: 'Excessive Halstead Complexity',
|
|
879
|
-
1123: 'Excessive Use of Self-Modifying Code',
|
|
880
|
-
1124: 'Excessively Deep Nesting',
|
|
881
|
-
1125: 'Excessive Attack Surface',
|
|
882
|
-
1126: 'Declaration of Variable with Unnecessarily Wide Scope',
|
|
883
|
-
1127: 'Compilation with Insufficient Warnings or Errors',
|
|
884
|
-
1164: 'Irrelevant Code',
|
|
885
|
-
1173: 'Improper Use of Validation Framework',
|
|
886
|
-
1174: 'ASP.NET Misconfiguration: Improper Model Validation',
|
|
887
|
-
1176: 'Inefficient CPU Computation',
|
|
888
|
-
1177: 'Use of Prohibited Code',
|
|
889
|
-
1187: 'DEPRECATED: Use of Uninitialized Resource',
|
|
890
|
-
1188: 'Insecure Default Initialization of Resource',
|
|
891
|
-
1189: 'Improper Isolation of Shared Resources on System-on-a-Chip',
|
|
892
|
-
1190: 'DMA Device Enabled Too Early in Boot Phase',
|
|
893
|
-
1191: 'On-Chip Debug and Test Interface With Improper Access Control',
|
|
894
|
-
1192: 'System-on-Chip',
|
|
895
|
-
1193: 'Power-On of Untrusted Execution Core Before Enabling Fabric Access '
|
|
896
|
-
'Control',
|
|
897
|
-
1204: 'Generation of Weak Initialization Vector',
|
|
898
|
-
1209: 'Failure to Disable Reserved Bits',
|
|
899
|
-
1220: 'Insufficient Granularity of Access Control',
|
|
900
|
-
1221: 'Incorrect Register Defaults or Module Parameters',
|
|
901
|
-
1222: 'Insufficient Granularity of Address Regions Protected by Register '
|
|
902
|
-
'Locks',
|
|
903
|
-
1223: 'Race Condition for Write-Once Attributes',
|
|
904
|
-
1224: 'Improper Restriction of Write-Once Bit Fields',
|
|
905
|
-
1229: 'Creation of Emergent Resource',
|
|
906
|
-
1230: 'Exposure of Sensitive Information Through Metadata',
|
|
907
|
-
1231: 'Improper Prevention of Lock Bit Modification',
|
|
908
|
-
1232: 'Improper Lock Behavior After Power State Transition',
|
|
909
|
-
1233: 'Security-Sensitive Hardware Controls with Missing Lock Bit '
|
|
910
|
-
'Protection',
|
|
911
|
-
1234: 'Hardware Internal or Debug Modes Allow Override of Locks',
|
|
912
|
-
1235: 'Incorrect Use of Autoboxing and Unboxing for Performance Critical '
|
|
913
|
-
'Operations',
|
|
914
|
-
1236: 'Improper Neutralization of Formula Elements in a CSV File',
|
|
915
|
-
1239: 'Improper Zeroization of Hardware Register',
|
|
916
|
-
1240: 'Use of a Cryptographic Primitive with a Risky Implementation',
|
|
917
|
-
1241: 'Use of Predictable Algorithm in Random Number Generator',
|
|
918
|
-
1242: 'Inclusion of Undocumented Features or Chicken Bits',
|
|
919
|
-
1243: 'Sensitive Non-Volatile Information Not Protected During Debug',
|
|
920
|
-
1244: 'Internal Asset Exposed to Unsafe Debug Access Level or State',
|
|
921
|
-
1245: 'Improper Finite State Machines',
|
|
922
|
-
1246: 'Improper Write Handling in Limited-write Non-Volatile Memories',
|
|
923
|
-
1247: 'Improper Protection Against Voltage and Clock Glitches',
|
|
924
|
-
1248: 'Semiconductor Defects in Hardware Logic with Security-Sensitive '
|
|
925
|
-
'Implications',
|
|
926
|
-
1249: 'Application-Level Admin Tool with Inconsistent View of Underlying '
|
|
927
|
-
'Operating System',
|
|
928
|
-
1250: 'Improper Preservation of Consistency Between Independent '
|
|
929
|
-
'Representations of Shared State',
|
|
930
|
-
1251: 'Mirrored Regions with Different Values',
|
|
931
|
-
1252: 'CPU Hardware Not Configured to Support Exclusivity of Write and '
|
|
932
|
-
'Execute Operations',
|
|
933
|
-
1253: 'Incorrect Selection of Fuse Values',
|
|
934
|
-
1254: 'Incorrect Comparison Logic Granularity',
|
|
935
|
-
1255: 'Comparison Logic is Vulnerable to Power Side-Channel Attacks',
|
|
936
|
-
1256: 'Improper Restriction of Software Interfaces to Hardware Features',
|
|
937
|
-
1257: 'Improper Access Control Applied to Mirrored or Aliased Memory '
|
|
938
|
-
'Regions',
|
|
939
|
-
1258: 'Exposure of Sensitive System Information Due to Uncleared Debug '
|
|
940
|
-
'Information',
|
|
941
|
-
1259: 'Improper Restriction of Security Token Assignment',
|
|
942
|
-
1260: 'Improper Handling of Overlap Between Protected Memory Ranges',
|
|
943
|
-
1261: 'Improper Handling of Single Event Upsets',
|
|
944
|
-
1262: 'Improper Access Control for Register Interface',
|
|
945
|
-
1263: 'Improper Physical Access Control',
|
|
946
|
-
1264: 'Hardware Logic with Insecure De-Synchronization between Control and '
|
|
947
|
-
'Data Channels',
|
|
948
|
-
1265: 'Unintended Reentrant Invocation of Non-reentrant Code Via Nested '
|
|
949
|
-
'Calls',
|
|
950
|
-
1266: 'Improper Scrubbing of Sensitive Data from Decommissioned Device',
|
|
951
|
-
1267: 'Policy Uses Obsolete Encoding',
|
|
952
|
-
1268: 'Policy Privileges are not Assigned Consistently Between Control and '
|
|
953
|
-
'Data Agents',
|
|
954
|
-
1269: 'Product Released in Non-Release Configuration',
|
|
955
|
-
1270: 'Generation of Incorrect Security Tokens',
|
|
956
|
-
1271: 'Uninitialized Value on Reset for Registers Holding Security '
|
|
957
|
-
'Settings',
|
|
958
|
-
1272: 'Sensitive Information Uncleared Before Debug/Power State Transition',
|
|
959
|
-
1273: 'Device Unlock Credential Sharing',
|
|
960
|
-
1274: 'Improper Access Control for Volatile Memory Containing Boot Code',
|
|
961
|
-
1275: 'Sensitive Cookie with Improper SameSite Attribute',
|
|
962
|
-
1276: 'Hardware Child Block Incorrectly Connected to Parent System',
|
|
963
|
-
1277: 'Firmware Not Updateable',
|
|
964
|
-
1278: 'Missing Protection Against Hardware Reverse Engineering Using '
|
|
965
|
-
'Integrated Circuit',
|
|
966
|
-
1279: 'Cryptographic Operations are run Before Supporting Units are Ready',
|
|
967
|
-
1280: 'Access Control Check Implemented After Asset is Accessed',
|
|
968
|
-
1281: 'Sequence of Processor Instructions Leads to Unexpected Behavior',
|
|
969
|
-
1282: 'Assumed-Immutable Data is Stored in Writable Memory',
|
|
970
|
-
1283: 'Mutable Attestation or Measurement Reporting Data',
|
|
971
|
-
1284: 'Improper Validation of Specified Quantity in Input',
|
|
972
|
-
1285: 'Improper Validation of Specified Index, Position, or Offset in '
|
|
973
|
-
'Input',
|
|
974
|
-
1286: 'Improper Validation of Syntactic Correctness of Input',
|
|
975
|
-
1287: 'Improper Validation of Specified Type of Input',
|
|
976
|
-
1288: 'Improper Validation of Consistency within Input',
|
|
977
|
-
1289: 'Improper Validation of Unsafe Equivalence in Input',
|
|
978
|
-
1290: 'Incorrect Decoding of Security Identifiers ',
|
|
979
|
-
1291: 'Public Key Re-Use for Signing both Debug and Production Code',
|
|
980
|
-
1292: 'Incorrect Conversion of Security Identifiers',
|
|
981
|
-
1293: 'Missing Source Correlation of Multiple Independent Data',
|
|
982
|
-
1294: 'Insecure Security Identifier Mechanism',
|
|
983
|
-
1295: 'Debug Messages Revealing Unnecessary Information',
|
|
984
|
-
1296: 'Incorrect Chaining or Granularity of Debug Components',
|
|
985
|
-
1297: 'Unprotected Confidential Information on Device is Accessible by '
|
|
986
|
-
'OSAT Vendors',
|
|
987
|
-
1298: 'Hardware Logic Contains Race Conditions',
|
|
988
|
-
1299: 'Missing Protection Mechanism for Alternate Hardware Interface',
|
|
989
|
-
1300: 'Improper Protection of Physical Side Channels',
|
|
990
|
-
1301: 'Insufficient or Incomplete Data Removal within Hardware Component',
|
|
991
|
-
1302: 'Missing Security Identifier',
|
|
992
|
-
1303: 'Non-Transparent Sharing of Microarchitectural Resources',
|
|
993
|
-
1304: 'Improperly Preserved Integrity of Hardware Configuration State '
|
|
994
|
-
'During a Power Save/Restore Operation',
|
|
995
|
-
1310: 'Missing Ability to Patch ROM Code',
|
|
996
|
-
1311: 'Improper Translation of Security Attributes by Fabric Bridge',
|
|
997
|
-
1312: 'Missing Protection for Mirrored Regions in On-Chip Fabric Firewall',
|
|
998
|
-
1313: 'Hardware Allows Activation of Test or Debug Logic at Runtime',
|
|
999
|
-
1314: 'Missing Write Protection for Parametric Data Values',
|
|
1000
|
-
1315: 'Improper Setting of Bus Controlling Capability in Fabric End-point',
|
|
1001
|
-
1316: 'Fabric-Address Map Allows Programming of Unwarranted Overlaps of '
|
|
1002
|
-
'Protected and Unprotected Ranges',
|
|
1003
|
-
1317: 'Improper Access Control in Fabric Bridge',
|
|
1004
|
-
1318: 'Missing Support for Security Features in On-chip Fabrics or Buses',
|
|
1005
|
-
1319: 'Improper Protection against Electromagnetic Fault Injection',
|
|
1006
|
-
1320: 'Improper Protection for Outbound Error Messages and Alert Signals',
|
|
1007
|
-
1321: 'Improperly Controlled Modification of Object Prototype Attributes',
|
|
1008
|
-
1322: 'Use of Blocking Code in Single-threaded, Non-blocking Context',
|
|
1009
|
-
1323: 'Improper Management of Sensitive Trace Data',
|
|
1010
|
-
1324: 'DEPRECATED: Sensitive Information Accessible by Physical Probing '
|
|
1011
|
-
'of JTAG Interface',
|
|
1012
|
-
1325: 'Improperly Controlled Sequential Memory Allocation',
|
|
1013
|
-
1326: 'Missing Immutable Root of Trust in Hardware',
|
|
1014
|
-
1327: 'Binding to an Unrestricted IP Address',
|
|
1015
|
-
1328: 'Security Version Number Mutable to Older Versions',
|
|
1016
|
-
1329: 'Reliance on Component That is Not Updateable',
|
|
1017
|
-
1330: 'Remanent Data Readable after Memory Erase',
|
|
1018
|
-
1331: 'Improper Isolation of Shared Resources in Network On Chip',
|
|
1019
|
-
1332: 'Improper Handling of Faults that Lead to Instruction Skips',
|
|
1020
|
-
1333: 'Inefficient Regular Expression Complexity',
|
|
1021
|
-
1334: 'Unauthorized Error Injection Can Degrade Hardware Redundancy',
|
|
1022
|
-
1335: 'Incorrect Bitwise Shift of Integer',
|
|
1023
|
-
1336: 'Improper Neutralization of Special Elements Used in a Template '
|
|
1024
|
-
'Engine',
|
|
1025
|
-
1338: 'Improper Protections Against Hardware Overheating',
|
|
1026
|
-
1339: 'Insufficient Precision or Accuracy of a Real Number',
|
|
1027
|
-
1341: 'Multiple Releases of Same Resource or Handle',
|
|
1028
|
-
1342: 'Information Exposure through Microarchitectural State after '
|
|
1029
|
-
'Transient Execution',
|
|
1030
|
-
1351: 'Improper Handling of Hardware Behavior in Exceptionally Cold '
|
|
1031
|
-
'Environments',
|
|
1032
|
-
1357: 'Reliance on Insufficiently Trustworthy Component',
|
|
1033
|
-
1384: 'Improper Handling of Physical or Environmental Conditions',
|
|
1034
|
-
1385: 'Missing Origin Validation in WebSockets',
|
|
1035
|
-
1386: 'Insecure Operation on Windows Junction / Mount Point',
|
|
1036
|
-
1389: 'Incorrect Parsing of Numbers with Different Radices',
|
|
1037
|
-
1390: 'Weak Authentication',
|
|
1038
|
-
1391: 'Use of Weak Credentials',
|
|
1039
|
-
1392: 'Use of Default Credentials',
|
|
1040
|
-
1393: 'Use of Default Password',
|
|
1041
|
-
1394: 'Use of Default Cryptographic Key',
|
|
1042
|
-
1395: 'Dependency on Vulnerable Third-Party Component'
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
TOML_TEMPLATE = {
|
|
1046
|
-
"depscan_version": get_version(),
|
|
1047
|
-
"note": [
|
|
1048
|
-
{"audience": "", "category": "", "text": "", "title": ""},
|
|
1049
|
-
],
|
|
1050
|
-
"reference": [
|
|
1051
|
-
{"category": "", "summary": "", "url": ""},
|
|
1052
|
-
{"category": "", "summary": "", "url": ""},
|
|
1053
|
-
],
|
|
1054
|
-
"distribution": {"label": "", "text": "", "url": ""},
|
|
1055
|
-
"document": {"category": "csaf_vex", "title": "Your Title"},
|
|
1056
|
-
"product_tree": {"easy_import": ""},
|
|
1057
|
-
"publisher": {
|
|
1058
|
-
"category": "vendor",
|
|
1059
|
-
"contact_details": "vendor@mcvendorson.com",
|
|
1060
|
-
"name": "Vendor McVendorson",
|
|
1061
|
-
"namespace": "https://appthreat.com",
|
|
1062
|
-
},
|
|
1063
|
-
"tracking": {
|
|
1064
|
-
"current_release_date": "",
|
|
1065
|
-
"id": "",
|
|
1066
|
-
"initial_release_date": "",
|
|
1067
|
-
"status": "draft",
|
|
1068
|
-
"version": "",
|
|
1069
|
-
"revision_history": [{"date": "", "number": "", "summary": ""}],
|
|
1070
|
-
},
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
REF_MAP = {
|
|
1074
|
-
r"(?P<org>[^\s./]+).(?:com|org)/(?:[\S]+)?/(?P<id>("
|
|
1075
|
-
r"?:ghsa|ntap|rhsa|rhba|zdi|dsa|cisco|intel)-?[\w\d\-:]+)": "Advisory",
|
|
1076
|
-
r"cve-[0-9]{4,}-[0-9]{4,}$": "CVE Record",
|
|
1077
|
-
r"(?<=bugzilla.)\S+(?=.\w{3}/show_bug.cgi\?)": "Bugzilla",
|
|
1078
|
-
r"github.com/[\w\-.]+/[\w\-.]+/pull/\d+": "GitHub Pull Request",
|
|
1079
|
-
r"github.com/[\w\-.]+/[\w\-.]+/release": "GitHub Repository Release",
|
|
1080
|
-
r"(github|bitbucket|chromium)(?:.com|.org)/([\w\-.]+)/([\w\-.]+)/issues/("
|
|
1081
|
-
r"?:detail\?id=)?(\d+)": "Issue",
|
|
1082
|
-
r"github.com/[\w\-.]+/[\w\-.]+/blob": "GitHub Blob Reference",
|
|
1083
|
-
r"github.com/[\w\-.]+/[\w\-.]+/commit": "GitHub Commit",
|
|
1084
|
-
r"github.com/[\w\-.]+/[\w\-.]+/?$": "GitHub Repository",
|
|
1085
|
-
"gist.github.com": "GitHub Gist",
|
|
1086
|
-
r"github.com/": "GitHub Other",
|
|
1087
|
-
"npmjs.com/advisories/": "NPM Advisory",
|
|
1088
|
-
r"npmjs.com/package/@?\w+/?\w+": "NPM Package Page",
|
|
1089
|
-
"oracle.com/security-alerts": "Oracle Security Alert",
|
|
1090
|
-
"security.snyk.io/vuln|https://snyk.io/vuln/": "Snyk Vulnerability "
|
|
1091
|
-
"Database Entry",
|
|
1092
|
-
"security.gentoo.org/glsa": "Advisory",
|
|
1093
|
-
r"usn.ubuntu.com/[\d\-]+|ubuntu.com/security/notices/USN\-[\d\-]+":
|
|
1094
|
-
"Ubuntu Security Notice",
|
|
1095
|
-
r"lists.[\w\-]+.org/[\S]+announce": "Mailing List Announcement",
|
|
1096
|
-
r"lists.[\w\-]+.org/": "Mailing List Other",
|
|
1097
|
-
"blog": "Blog Post",
|
|
1098
|
-
r"bitbucket.org/[^\s/]+/[^\s/]+/?(?!.)": "Bitbucket Repository",
|
|
1099
|
-
r"bitbucket.org/[^\s/]+/[^\s/]+/commits": "Bitbucket Commit",
|
|
1100
|
-
r"bitbucket.org/[^\s/]+/[^\s/]+/issues/\d+(/)?": "Bitbucket Issue",
|
|
1101
|
-
r"bitbucket.org/[^\s/]+/[^\s/]+/wiki/": "Bitbucket Wiki Entry",
|
|
1102
|
-
r"https://vuldb.com/\?id.\d+": "VulDB Entry",
|
|
1103
|
-
}
|
|
1104
|
-
SORTED_REF_MAP = dict(
|
|
1105
|
-
sorted(REF_MAP.items(), key=lambda x: len(x[0]), reverse=True)
|
|
1106
|
-
)
|
|
1107
|
-
|
|
1108
|
-
COMPILED_REF_PATTERNS = {
|
|
1109
|
-
re.compile(pattern, re.IGNORECASE): value
|
|
1110
|
-
for pattern, value in SORTED_REF_MAP.items()
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
ISSUES_REGEX = re.compile(
|
|
1114
|
-
r"(?P<host>github|bitbucket|chromium)(?:.com|.org)/(?P<owner>["
|
|
1115
|
-
r"\w\-.]+)/(?P<repo>[\w\-.]+)/issues/(?:detail\?id=)?(?P<id>\d+)",
|
|
1116
|
-
re.IGNORECASE,
|
|
1117
|
-
)
|
|
1118
|
-
ADVISORY_REGEX = re.compile(
|
|
1119
|
-
r"(?P<org>[^\s/.]+).(?:com|org)/(?:\S+/)*/?(?P<id>[\w\-:]+)",
|
|
1120
|
-
re.IGNORECASE,
|
|
1121
|
-
)
|
|
1122
|
-
BUGZILLA_REGEX = re.compile(
|
|
1123
|
-
r"(?<=bugzilla.)(?P<owner>\S+)\.\w{3}/show_bug.cgi\?id=(?P<id>\S+)",
|
|
1124
|
-
re.IGNORECASE,
|
|
1125
|
-
)
|
|
1126
|
-
USN_REGEX = re.compile(
|
|
1127
|
-
r"(?<=usn.ubuntu.com/)[\d\-]+|(?<=ubuntu.com/security/notices/USN-)"
|
|
1128
|
-
r"[\d\-]+",
|
|
1129
|
-
re.IGNORECASE,
|
|
1130
|
-
)
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
def vdr_to_csaf(res):
|
|
1134
|
-
"""
|
|
1135
|
-
Processes a vulnerability from the VDR format to CSAF format.
|
|
1136
|
-
|
|
1137
|
-
:param res: The metadata for a single vulnerability.
|
|
1138
|
-
:type res: dict
|
|
1139
|
-
|
|
1140
|
-
:return: The processed vulnerability in CSAF format.
|
|
1141
|
-
:rtype: dict
|
|
1142
|
-
"""
|
|
1143
|
-
cve = res.get("id", "")
|
|
1144
|
-
acknowledgements = get_acknowledgements(res.get("source", {}))
|
|
1145
|
-
[products, product_status] = get_products(
|
|
1146
|
-
res.get("affects", []), res.get("properties", [])
|
|
1147
|
-
)
|
|
1148
|
-
cwe, notes = parse_cwe(res.get("cwes", []))
|
|
1149
|
-
cvss_v3 = parse_cvss(res.get("ratings", [{}]))
|
|
1150
|
-
description = (
|
|
1151
|
-
res.get("description", "")
|
|
1152
|
-
.replace("\n", " ")
|
|
1153
|
-
.replace("\t", " ")
|
|
1154
|
-
.replace("\n", " ")
|
|
1155
|
-
.replace("\t", " ")
|
|
1156
|
-
)
|
|
1157
|
-
ids, references = format_references(res.get("advisories", []))
|
|
1158
|
-
orig_date = res.get("published")
|
|
1159
|
-
update_date = res.get("updated")
|
|
1160
|
-
discovery_date = orig_date or update_date
|
|
1161
|
-
vuln = {}
|
|
1162
|
-
if cve.startswith("CVE"):
|
|
1163
|
-
vuln["cve"] = cve
|
|
1164
|
-
vuln["cwe"] = cwe
|
|
1165
|
-
vuln["acknowledgements"] = acknowledgements
|
|
1166
|
-
vuln["discovery_date"] = str(discovery_date) if discovery_date else None
|
|
1167
|
-
vuln["product_status"] = product_status
|
|
1168
|
-
vuln["references"] = references
|
|
1169
|
-
vuln["ids"] = ids
|
|
1170
|
-
vuln["scores"] = [{"cvss_v3": cvss_v3, "products": products}]
|
|
1171
|
-
notes.append(
|
|
1172
|
-
{
|
|
1173
|
-
"category": "general",
|
|
1174
|
-
"text": description,
|
|
1175
|
-
"details": "Vulnerability Description",
|
|
1176
|
-
}
|
|
1177
|
-
)
|
|
1178
|
-
vuln["notes"] = notes
|
|
1179
|
-
|
|
1180
|
-
return vuln
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
def get_products(affects, props):
|
|
1184
|
-
"""
|
|
1185
|
-
Generates a list of unique products and a dictionary of version statuses for
|
|
1186
|
-
the vulnerability.
|
|
1187
|
-
|
|
1188
|
-
:param affects: Affected and fixed versions with associated purls
|
|
1189
|
-
:type affects: list[dict]
|
|
1190
|
-
:param props: List of properties
|
|
1191
|
-
:type props: list[dict]
|
|
1192
|
-
|
|
1193
|
-
:return: Packages affected by the vulnerability and their statuses
|
|
1194
|
-
:rtype: tuple[list[str], dict[str, str]]
|
|
1195
|
-
"""
|
|
1196
|
-
if not affects and not props:
|
|
1197
|
-
return [], {}
|
|
1198
|
-
|
|
1199
|
-
known_affected = []
|
|
1200
|
-
fixed = []
|
|
1201
|
-
products = set()
|
|
1202
|
-
for i in affects:
|
|
1203
|
-
for v in i.get("versions", []):
|
|
1204
|
-
purl = None
|
|
1205
|
-
try:
|
|
1206
|
-
purl = PackageURL.from_string(i.get("ref", ""))
|
|
1207
|
-
namespace = purl.namespace
|
|
1208
|
-
pkg_name = purl.name
|
|
1209
|
-
version = purl.version
|
|
1210
|
-
except ValueError:
|
|
1211
|
-
purl = i.get("ref", "")
|
|
1212
|
-
namespace = None
|
|
1213
|
-
pkg_name = i.get("ref", "")
|
|
1214
|
-
version = None
|
|
1215
|
-
if purl and v.get("status") == "affected":
|
|
1216
|
-
known_affected.append(
|
|
1217
|
-
f'{namespace}/{pkg_name}@{version}')
|
|
1218
|
-
elif purl and v.get("status") == "unaffected":
|
|
1219
|
-
fixed.append(f'{namespace}/{pkg_name}@{v.get("version")}')
|
|
1220
|
-
elif not purl and v.get("status") == "affected":
|
|
1221
|
-
known_affected.append(i.get("ref"))
|
|
1222
|
-
product = ''
|
|
1223
|
-
try:
|
|
1224
|
-
purl = PackageURL.from_string(i.get("ref", ""))
|
|
1225
|
-
if purl.namespace:
|
|
1226
|
-
product += f'{purl.namespace}/'
|
|
1227
|
-
product += f'{purl.name}@{purl.version}'
|
|
1228
|
-
except ValueError:
|
|
1229
|
-
product = i.get("ref", "")
|
|
1230
|
-
products.add(product)
|
|
1231
|
-
|
|
1232
|
-
if version_range := [
|
|
1233
|
-
{i["name"]: i["value"]}
|
|
1234
|
-
for i in props
|
|
1235
|
-
if i["name"] == "affectedVersionRange"
|
|
1236
|
-
]:
|
|
1237
|
-
for v in version_range:
|
|
1238
|
-
products.add(v["affectedVersionRange"])
|
|
1239
|
-
known_affected.append(v["affectedVersionRange"])
|
|
1240
|
-
|
|
1241
|
-
known_affected = [
|
|
1242
|
-
i.replace("None/", "").replace("@None", "")
|
|
1243
|
-
for i in known_affected
|
|
1244
|
-
]
|
|
1245
|
-
fixed = [
|
|
1246
|
-
i.replace("None/", "").replace("@None", "") for i in fixed
|
|
1247
|
-
]
|
|
1248
|
-
|
|
1249
|
-
return list(products), {"known_affected": known_affected, "fixed": fixed}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
def get_acknowledgements(source):
|
|
1253
|
-
"""
|
|
1254
|
-
Generates the acknowledgements from the source data information
|
|
1255
|
-
:param source: A dictionary with the source information
|
|
1256
|
-
:type source: dict
|
|
1257
|
-
|
|
1258
|
-
:return: A dictionary containing the acknowledgements
|
|
1259
|
-
:rtype: dict
|
|
1260
|
-
"""
|
|
1261
|
-
if not source.get("name"):
|
|
1262
|
-
return {}
|
|
1263
|
-
|
|
1264
|
-
return {
|
|
1265
|
-
"organization": source["name"],
|
|
1266
|
-
"urls": [source.get("url")]
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
def parse_cwe(cwe):
|
|
1271
|
-
"""
|
|
1272
|
-
Takes a list of CWE numbers and returns a single CSAF CWE entry, with any
|
|
1273
|
-
additional CWEs returned in notes (CSAF 2.0 only allows one CWE).
|
|
1274
|
-
|
|
1275
|
-
:param cwe: A list of CWE numbers
|
|
1276
|
-
:type cwe: list
|
|
1277
|
-
|
|
1278
|
-
:return: A single CSAF CWE entry (dict) and notes (list)
|
|
1279
|
-
:rtype: tuple
|
|
1280
|
-
"""
|
|
1281
|
-
fmt_cwe = None
|
|
1282
|
-
new_notes = []
|
|
1283
|
-
|
|
1284
|
-
if not cwe:
|
|
1285
|
-
return fmt_cwe, new_notes
|
|
1286
|
-
|
|
1287
|
-
for i, cwe_id in enumerate(cwe):
|
|
1288
|
-
cwe_name = CWE_MAP.get(cwe_id, "UNABLE TO LOCATE CWE NAME")
|
|
1289
|
-
if not cwe_name:
|
|
1290
|
-
LOG.warning(
|
|
1291
|
-
"We couldn't locate the name of the CWE with the following "
|
|
1292
|
-
"id: %s. Help us out by reporting the id at "
|
|
1293
|
-
"https://github.com/owasp-dep-scan/dep-scan/issues.", i, )
|
|
1294
|
-
if i == 0:
|
|
1295
|
-
fmt_cwe = {"id": str(cwe_id), "name": cwe_name, }
|
|
1296
|
-
else:
|
|
1297
|
-
new_notes.append(
|
|
1298
|
-
{"title": f"Additional CWE: {cwe_id}", "audience": "developers",
|
|
1299
|
-
"category": "other", "text": cwe_name, })
|
|
1300
|
-
|
|
1301
|
-
return fmt_cwe, new_notes
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
def parse_cvss(ratings):
|
|
1305
|
-
"""
|
|
1306
|
-
Parses the CVSS information from pkg_vulnerabilities
|
|
1307
|
-
|
|
1308
|
-
:param ratings: The ratings data
|
|
1309
|
-
:type ratings: list[dict]
|
|
1310
|
-
|
|
1311
|
-
:return: The parsed CVSS information as a single dictionary
|
|
1312
|
-
:rtype: dict
|
|
1313
|
-
"""
|
|
1314
|
-
if not ratings or not (vector_string := ratings[0].get("vector")):
|
|
1315
|
-
return {}
|
|
1316
|
-
if not vector_string or vector_string == "None":
|
|
1317
|
-
return {}
|
|
1318
|
-
try:
|
|
1319
|
-
cvss_v3 = cvss.CVSS3(vector_string)
|
|
1320
|
-
cvss_v3.check_mandatory()
|
|
1321
|
-
except Exception:
|
|
1322
|
-
return {}
|
|
1323
|
-
|
|
1324
|
-
cvss_v3_dict = cvss_v3.as_json()
|
|
1325
|
-
|
|
1326
|
-
cvss_v3 = {k: v for k, v in cvss_v3_dict.items() if v != "NOT_DEFINED"}
|
|
1327
|
-
|
|
1328
|
-
return cleanup_dict(cvss_v3)
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
def format_references(advisories):
|
|
1332
|
-
"""
|
|
1333
|
-
Formats the advisories as references.
|
|
1334
|
-
|
|
1335
|
-
:param advisories: List of dictionaries of advisories online
|
|
1336
|
-
:type advisories: list
|
|
1337
|
-
|
|
1338
|
-
:return: A list of dictionaries with the formatted references.
|
|
1339
|
-
:rtype: list
|
|
1340
|
-
"""
|
|
1341
|
-
if not advisories:
|
|
1342
|
-
return [], []
|
|
1343
|
-
ref = [i["url"] for i in advisories]
|
|
1344
|
-
fmt_refs = [{"summary": get_ref_summary(r), "url": r} for r in ref]
|
|
1345
|
-
ids = []
|
|
1346
|
-
id_types = ["Advisory", "Issue", "Ubuntu Security Notice", "Bugzilla"]
|
|
1347
|
-
parse = [i for i in fmt_refs if i.get("summary") in id_types]
|
|
1348
|
-
refs = [i for i in fmt_refs if i.get("summary") not in id_types]
|
|
1349
|
-
for reference in parse:
|
|
1350
|
-
url = reference["url"]
|
|
1351
|
-
summary = reference["summary"]
|
|
1352
|
-
if summary == "Advisory":
|
|
1353
|
-
url = url.replace("glsa/", "glsa-")
|
|
1354
|
-
if adv := re.search(ADVISORY_REGEX, url):
|
|
1355
|
-
system_name = (
|
|
1356
|
-
(adv["org"].capitalize() + " Advisory")
|
|
1357
|
-
.replace("Redhat", "Red Hat")
|
|
1358
|
-
.replace("Zerodayinitiative", "Zero Day Initiative")
|
|
1359
|
-
.replace("Github", "GitHub")
|
|
1360
|
-
.replace("Netapp", "NetApp")
|
|
1361
|
-
)
|
|
1362
|
-
ids.append({"system_name": system_name, "text": adv["id"]})
|
|
1363
|
-
summary = system_name
|
|
1364
|
-
elif issue := re.search(ISSUES_REGEX, url):
|
|
1365
|
-
summary = (
|
|
1366
|
-
issue["host"].capitalize().replace("Github", "GitHub")
|
|
1367
|
-
+ " Issue"
|
|
1368
|
-
)
|
|
1369
|
-
ids.append(
|
|
1370
|
-
{
|
|
1371
|
-
"system_name": summary
|
|
1372
|
-
+ (
|
|
1373
|
-
f" [{issue['owner']}/{issue['repo']}]"
|
|
1374
|
-
if issue["owner"] != "p"
|
|
1375
|
-
else f" [{issue['repo']}]"
|
|
1376
|
-
),
|
|
1377
|
-
"text": issue["id"],
|
|
1378
|
-
}
|
|
1379
|
-
)
|
|
1380
|
-
elif bugzilla := re.search(BUGZILLA_REGEX, url):
|
|
1381
|
-
system_name = f"{bugzilla['owner'].capitalize()} Bugzilla"
|
|
1382
|
-
system_name = system_name.replace("Redhat", "Red Hat")
|
|
1383
|
-
ids.append(
|
|
1384
|
-
{"system_name": f"{system_name} ID", "text": bugzilla["id"]}
|
|
1385
|
-
)
|
|
1386
|
-
summary = system_name
|
|
1387
|
-
elif usn := re.search(USN_REGEX, url):
|
|
1388
|
-
ids.append({"system_name": summary, "text": f"USN-{usn[0]}"})
|
|
1389
|
-
refs.append({"summary": summary, "url": url})
|
|
1390
|
-
new_ids = {(idx["system_name"], idx["text"]) for idx in ids}
|
|
1391
|
-
ids = [{"system_name": idx[0], "text": idx[1]} for idx in new_ids]
|
|
1392
|
-
ids = sorted(ids, key=lambda x: x["text"])
|
|
1393
|
-
return ids, refs
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
def get_ref_summary(url):
|
|
1397
|
-
"""
|
|
1398
|
-
Returns the summary string associated with a given URL.
|
|
1399
|
-
|
|
1400
|
-
:param url: The URL to match against the patterns in the REF_MAP.
|
|
1401
|
-
:type url: str
|
|
1402
|
-
|
|
1403
|
-
:return: The summary string corresponding to the matched pattern in REF_MAP.
|
|
1404
|
-
:rtype: str
|
|
1405
|
-
|
|
1406
|
-
:raises: TypeError if url is not a string
|
|
1407
|
-
"""
|
|
1408
|
-
if not isinstance(url, str):
|
|
1409
|
-
raise TypeError("url must be a string")
|
|
1410
|
-
|
|
1411
|
-
return next(
|
|
1412
|
-
(
|
|
1413
|
-
value
|
|
1414
|
-
for pattern, value in COMPILED_REF_PATTERNS.items()
|
|
1415
|
-
if pattern.search(url)
|
|
1416
|
-
),
|
|
1417
|
-
"Other",
|
|
1418
|
-
)
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
def parse_revision_history(tracking):
|
|
1422
|
-
"""
|
|
1423
|
-
Parses the revision history from the tracking data.
|
|
1424
|
-
|
|
1425
|
-
:param tracking: The tracking object containing the revision history
|
|
1426
|
-
:type tracking: dict
|
|
1427
|
-
|
|
1428
|
-
:return: The updated tracking object
|
|
1429
|
-
:rtype: dict
|
|
1430
|
-
"""
|
|
1431
|
-
hx = deepcopy(tracking.get("revision_history")) or []
|
|
1432
|
-
if not hx and (tracking.get("version")) != "1":
|
|
1433
|
-
LOG.warning("Revision history is empty. Correcting the version number.")
|
|
1434
|
-
tracking["version"] = 1
|
|
1435
|
-
|
|
1436
|
-
elif hx and (len(hx) > 0):
|
|
1437
|
-
hx = cleanup_list(hx)
|
|
1438
|
-
if tracking.get("status") == "final" and int(
|
|
1439
|
-
tracking.get("version", 1)
|
|
1440
|
-
) > (len(hx) + 1):
|
|
1441
|
-
LOG.warning(
|
|
1442
|
-
"Revision history is inconsistent with the version "
|
|
1443
|
-
"number. Correcting the version number."
|
|
1444
|
-
)
|
|
1445
|
-
tracking["version"] = int(len(hx) + 1)
|
|
1446
|
-
status = tracking.get("status")
|
|
1447
|
-
if not status or len(status) == 0:
|
|
1448
|
-
status = "draft"
|
|
1449
|
-
dt = datetime.now().strftime(TIME_FMT)
|
|
1450
|
-
tracking = cleanup_dict(tracking)
|
|
1451
|
-
# Format dates
|
|
1452
|
-
try:
|
|
1453
|
-
tracking["initial_release_date"] = (
|
|
1454
|
-
convert_time(
|
|
1455
|
-
tracking.get(
|
|
1456
|
-
"initial_release_date",
|
|
1457
|
-
tracking.get("current_release_date", dt),
|
|
1458
|
-
)
|
|
1459
|
-
)
|
|
1460
|
-
).strftime(TIME_FMT)
|
|
1461
|
-
tracking["current_release_date"] = (
|
|
1462
|
-
convert_time(
|
|
1463
|
-
tracking.get(
|
|
1464
|
-
"current_release_date", tracking.get("initial_release_date")
|
|
1465
|
-
)
|
|
1466
|
-
)
|
|
1467
|
-
).strftime(TIME_FMT)
|
|
1468
|
-
except AttributeError:
|
|
1469
|
-
LOG.warning("Your dates don't appear to be in ISO format.")
|
|
1470
|
-
if status == "final" and (not hx or len(hx) == 0):
|
|
1471
|
-
choose_date = max(
|
|
1472
|
-
tracking.get("initial_release_date"),
|
|
1473
|
-
tracking.get("current_release_date"),
|
|
1474
|
-
)
|
|
1475
|
-
hx.append(
|
|
1476
|
-
{
|
|
1477
|
-
"date": choose_date,
|
|
1478
|
-
"number": "1",
|
|
1479
|
-
"summary": "Initial",
|
|
1480
|
-
}
|
|
1481
|
-
)
|
|
1482
|
-
tracking["current_release_date"] = choose_date
|
|
1483
|
-
tracking["initial_release_date"] = choose_date
|
|
1484
|
-
elif status == "final":
|
|
1485
|
-
hx = sorted(hx, key=lambda x: x["number"])
|
|
1486
|
-
tracking["initial_release_date"] = hx[0]["date"]
|
|
1487
|
-
if tracking["current_release_date"] == hx[-1]["date"]:
|
|
1488
|
-
tracking["current_release_date"] = dt
|
|
1489
|
-
hx.append(
|
|
1490
|
-
{
|
|
1491
|
-
"date": tracking["current_release_date"],
|
|
1492
|
-
"number": str(len(hx) + 1),
|
|
1493
|
-
"summary": "Update",
|
|
1494
|
-
}
|
|
1495
|
-
)
|
|
1496
|
-
if len(hx) > 0:
|
|
1497
|
-
tracking["version"] = str(
|
|
1498
|
-
max(int(tracking.get("version", 0)), int(hx[-1]["number"]))
|
|
1499
|
-
)
|
|
1500
|
-
else:
|
|
1501
|
-
tracking["version"] = "1"
|
|
1502
|
-
if not tracking.get("id") or len(tracking.get("id")) == 0:
|
|
1503
|
-
LOG.info("No tracking id, generating one.")
|
|
1504
|
-
tracking["id"] = f"{dt}_v{tracking['version']}"
|
|
1505
|
-
if (tracking["initial_release_date"]) > (tracking["current_release_date"]):
|
|
1506
|
-
LOG.warning(
|
|
1507
|
-
"Your initial release date is later than the current release date."
|
|
1508
|
-
)
|
|
1509
|
-
hx = sorted(hx, key=lambda x: x["number"])
|
|
1510
|
-
|
|
1511
|
-
tracking["revision_history"] = hx
|
|
1512
|
-
tracking["status"] = status
|
|
1513
|
-
return tracking
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
def import_product_tree(tree):
|
|
1517
|
-
"""
|
|
1518
|
-
Set the product tree by loading it from a file.
|
|
1519
|
-
|
|
1520
|
-
:param tree: The dictionary representing the tree.
|
|
1521
|
-
:type tree: dict
|
|
1522
|
-
|
|
1523
|
-
:return: The product tree loaded from the file, or None if file is empty.
|
|
1524
|
-
:rtype: dict or None
|
|
1525
|
-
"""
|
|
1526
|
-
product_tree = None
|
|
1527
|
-
if len(tree["easy_import"]) > 0:
|
|
1528
|
-
try:
|
|
1529
|
-
with open(tree["easy_import"], "r", encoding="utf-8") as f:
|
|
1530
|
-
product_tree = json.load(f)
|
|
1531
|
-
except JSONDecodeError:
|
|
1532
|
-
LOG.warning(
|
|
1533
|
-
"Unable to load product tree file. Please verify that your "
|
|
1534
|
-
"product tree is a valid json file. Visit "
|
|
1535
|
-
"https://github.com/owasp-dep-scan/dep-scan/blob/master/test"
|
|
1536
|
-
"/data/product_tree.json for an example."
|
|
1537
|
-
)
|
|
1538
|
-
except FileNotFoundError:
|
|
1539
|
-
LOG.warning(
|
|
1540
|
-
"Cannot locate product tree at %s. Please verify you "
|
|
1541
|
-
"have entered the correct filepath in your csaf.toml.",
|
|
1542
|
-
tree["easy_import"],
|
|
1543
|
-
)
|
|
1544
|
-
return product_tree
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
def parse_toml(metadata):
|
|
1548
|
-
"""
|
|
1549
|
-
Parses the given metadata from csaf.toml and generates an output dictionary.
|
|
1550
|
-
|
|
1551
|
-
:param metadata: The data read from csaf.toml
|
|
1552
|
-
|
|
1553
|
-
:return: The processed metadata ready to use in the CSAF document.
|
|
1554
|
-
"""
|
|
1555
|
-
tracking = parse_revision_history(metadata.get("tracking"))
|
|
1556
|
-
refs = list(metadata.get("reference"))
|
|
1557
|
-
notes = list(metadata.get("note"))
|
|
1558
|
-
product_tree = import_product_tree(metadata["product_tree"])
|
|
1559
|
-
return {
|
|
1560
|
-
"document": {
|
|
1561
|
-
"aggregate_severity": {},
|
|
1562
|
-
"category": metadata["document"]["category"],
|
|
1563
|
-
"title": metadata["document"]["title"] or "Test",
|
|
1564
|
-
"csaf_version": "2.0",
|
|
1565
|
-
"distribution": metadata.get("distribution"),
|
|
1566
|
-
"lang": "en",
|
|
1567
|
-
"notes": notes,
|
|
1568
|
-
"publisher": {
|
|
1569
|
-
"category": metadata["publisher"]["category"],
|
|
1570
|
-
"contact_details": metadata["publisher"].get("contact_details"),
|
|
1571
|
-
"name": metadata["publisher"]["name"],
|
|
1572
|
-
"namespace": metadata["publisher"]["namespace"],
|
|
1573
|
-
},
|
|
1574
|
-
"references": refs,
|
|
1575
|
-
"tracking": tracking,
|
|
1576
|
-
},
|
|
1577
|
-
"product_tree": product_tree,
|
|
1578
|
-
"vulnerabilities": [],
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
def toml_compatibility(metadata):
|
|
1583
|
-
"""
|
|
1584
|
-
Applies any changes to the formatting of the TOML after a depscan
|
|
1585
|
-
minor or patch update
|
|
1586
|
-
|
|
1587
|
-
:param metadata: The toml data
|
|
1588
|
-
"""
|
|
1589
|
-
|
|
1590
|
-
return metadata
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
def export_csaf(pkg_vulnerabilities, src_dir, reports_dir, bom_file):
|
|
1594
|
-
"""
|
|
1595
|
-
Generates a CSAF 2.0 JSON document from the results.
|
|
1596
|
-
|
|
1597
|
-
:param pkg_vulnerabilities: List of vulnerabilities
|
|
1598
|
-
:type pkg_vulnerabilities: list
|
|
1599
|
-
:param src_dir: The source directory.
|
|
1600
|
-
:type src_dir: str
|
|
1601
|
-
:param reports_dir: The reports directory.
|
|
1602
|
-
:type reports_dir: str
|
|
1603
|
-
:param bom_file: The BOM file path
|
|
1604
|
-
:type bom_file: str
|
|
1605
|
-
|
|
1606
|
-
"""
|
|
1607
|
-
toml_file_path = os.getenv(
|
|
1608
|
-
"DEPSCAN_CSAF_TEMPLATE", os.path.join(src_dir, "csaf.toml")
|
|
1609
|
-
)
|
|
1610
|
-
metadata = import_csaf_toml(toml_file_path)
|
|
1611
|
-
metadata = toml_compatibility(metadata)
|
|
1612
|
-
template = parse_toml(metadata)
|
|
1613
|
-
new_results = add_vulnerabilities(template, pkg_vulnerabilities)
|
|
1614
|
-
new_results = cleanup_dict(new_results)
|
|
1615
|
-
[new_results, metadata] = verify_components_present(
|
|
1616
|
-
new_results, metadata, bom_file
|
|
1617
|
-
)
|
|
1618
|
-
|
|
1619
|
-
outfile = os.path.join(
|
|
1620
|
-
reports_dir,
|
|
1621
|
-
f"csaf_v{new_results['document']['tracking']['version']}.json",
|
|
1622
|
-
)
|
|
1623
|
-
|
|
1624
|
-
with open(outfile, "w", encoding="utf-8") as f:
|
|
1625
|
-
json.dump(new_results, f, indent=4, sort_keys=True)
|
|
1626
|
-
LOG.info("CSAF report written to %s", outfile)
|
|
1627
|
-
write_toml(toml_file_path, metadata)
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
def import_csaf_toml(toml_file_path):
|
|
1631
|
-
"""
|
|
1632
|
-
Reads the csaf.toml file and returns it as a dictionary.
|
|
1633
|
-
|
|
1634
|
-
:param toml_file_path: The path to the csaf.toml file.
|
|
1635
|
-
:type toml_file_path: str
|
|
1636
|
-
|
|
1637
|
-
:return: A dictionary containing the parsed contents of the csaf.toml.
|
|
1638
|
-
:rtype: dict
|
|
1639
|
-
|
|
1640
|
-
:raises TOMLDecodeError: If the TOML is invalid.
|
|
1641
|
-
"""
|
|
1642
|
-
try:
|
|
1643
|
-
with open(toml_file_path, "r", encoding="utf-8") as f:
|
|
1644
|
-
try:
|
|
1645
|
-
toml_data = toml.load(f)
|
|
1646
|
-
except toml.TomlDecodeError:
|
|
1647
|
-
LOG.error(
|
|
1648
|
-
"Invalid TOML. Please make sure you do not have any "
|
|
1649
|
-
"duplicate keys and that any filepaths are properly escaped"
|
|
1650
|
-
"if using Windows."
|
|
1651
|
-
)
|
|
1652
|
-
sys.exit(1)
|
|
1653
|
-
except FileNotFoundError:
|
|
1654
|
-
write_toml(toml_file_path)
|
|
1655
|
-
return import_csaf_toml(toml_file_path)
|
|
1656
|
-
|
|
1657
|
-
return toml_compatibility(toml_data)
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
def write_toml(toml_file_path, metadata=None):
|
|
1661
|
-
"""
|
|
1662
|
-
Writes the toml data out to file. If no toml data is provided, a toml is
|
|
1663
|
-
generated based on the default template.
|
|
1664
|
-
|
|
1665
|
-
:param toml_file_path: The filepath to save the TOML template to.
|
|
1666
|
-
:type toml_file_path: str
|
|
1667
|
-
:param metadata: A dictionary containing the TOML metadata.
|
|
1668
|
-
:type metadata: dict
|
|
1669
|
-
|
|
1670
|
-
"""
|
|
1671
|
-
if not metadata:
|
|
1672
|
-
metadata = TOML_TEMPLATE
|
|
1673
|
-
metadata["depscan_version"] = get_version()
|
|
1674
|
-
with open(toml_file_path, "w", encoding="utf-8") as f:
|
|
1675
|
-
toml.dump(metadata, f)
|
|
1676
|
-
LOG.debug("The csaf.toml has been updated at %s", toml_file_path)
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
def cleanup_list(d):
|
|
1680
|
-
"""
|
|
1681
|
-
Cleans up a list by removing empty or None values recursively.
|
|
1682
|
-
|
|
1683
|
-
:param d: The list to be cleaned up.
|
|
1684
|
-
|
|
1685
|
-
:return: The new list or None
|
|
1686
|
-
"""
|
|
1687
|
-
new_lst = []
|
|
1688
|
-
for dl in d:
|
|
1689
|
-
if isinstance(dl, dict):
|
|
1690
|
-
if entry := cleanup_dict(dl):
|
|
1691
|
-
new_lst.append(entry)
|
|
1692
|
-
elif isinstance(dl, str):
|
|
1693
|
-
new_lst.append(dl)
|
|
1694
|
-
return new_lst
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
def cleanup_dict(d):
|
|
1698
|
-
"""
|
|
1699
|
-
Cleans up a dictionary by removing empty or None values recursively.
|
|
1700
|
-
|
|
1701
|
-
:param d: The dictionary to be cleaned up.
|
|
1702
|
-
|
|
1703
|
-
:return: The new dictionary or None
|
|
1704
|
-
"""
|
|
1705
|
-
new_dict = {}
|
|
1706
|
-
for key, value in d.items():
|
|
1707
|
-
entry = None
|
|
1708
|
-
if value and str(value) != "":
|
|
1709
|
-
if isinstance(value, list):
|
|
1710
|
-
entry = cleanup_list(value)
|
|
1711
|
-
elif isinstance(value, dict):
|
|
1712
|
-
entry = cleanup_dict(value)
|
|
1713
|
-
else:
|
|
1714
|
-
entry = value
|
|
1715
|
-
if entry:
|
|
1716
|
-
new_dict[key] = entry
|
|
1717
|
-
return new_dict
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
def import_root_component(bom_file):
|
|
1721
|
-
"""
|
|
1722
|
-
Import the root component from the VDR file if no product tree is present
|
|
1723
|
-
and gene external references.
|
|
1724
|
-
|
|
1725
|
-
:param bom_file: The path to the VDR file.
|
|
1726
|
-
:type bom_file: str
|
|
1727
|
-
|
|
1728
|
-
:returns: The product tree (dict) and additional references (list of dicts).
|
|
1729
|
-
:rtype: tuple
|
|
1730
|
-
"""
|
|
1731
|
-
with open(bom_file, "r", encoding="utf-8") as f:
|
|
1732
|
-
bom = json.load(f)
|
|
1733
|
-
|
|
1734
|
-
refs = []
|
|
1735
|
-
product_tree = {}
|
|
1736
|
-
|
|
1737
|
-
if component := bom["metadata"].get("component"):
|
|
1738
|
-
product_tree = {
|
|
1739
|
-
"full_product_names": [
|
|
1740
|
-
{
|
|
1741
|
-
"name": component.get("name"),
|
|
1742
|
-
"product_id": f"{component.get('name')}:"
|
|
1743
|
-
f"{component.get('version')}",
|
|
1744
|
-
"product_identification_helper": {
|
|
1745
|
-
"purl": component.get("purl"),
|
|
1746
|
-
},
|
|
1747
|
-
}
|
|
1748
|
-
]
|
|
1749
|
-
}
|
|
1750
|
-
if external_references := component.get("externalReferences"):
|
|
1751
|
-
refs.extend(
|
|
1752
|
-
{
|
|
1753
|
-
"summary": r.get("type"),
|
|
1754
|
-
"url": r.get("url"),
|
|
1755
|
-
}
|
|
1756
|
-
for r in external_references
|
|
1757
|
-
)
|
|
1758
|
-
if product_tree:
|
|
1759
|
-
LOG.debug("Successfully imported root component into the product tree.")
|
|
1760
|
-
else:
|
|
1761
|
-
LOG.debug(
|
|
1762
|
-
"Unable to import root component for product tree, so product "
|
|
1763
|
-
"tree will not be included."
|
|
1764
|
-
)
|
|
1765
|
-
|
|
1766
|
-
return product_tree, refs
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
def verify_components_present(data, metadata, bom_file):
|
|
1770
|
-
"""
|
|
1771
|
-
Verify if the required components are present
|
|
1772
|
-
|
|
1773
|
-
:param data: The dictionary representing the csaf document itself.
|
|
1774
|
-
:type data: dict
|
|
1775
|
-
:param metadata: The dictionary that will be written back to the csaf.toml.
|
|
1776
|
-
:type metadata: dict
|
|
1777
|
-
:param bom_file: The path to the vdr_file.
|
|
1778
|
-
:type bom_file: str
|
|
1779
|
-
|
|
1780
|
-
:return: The modified template and metadata dictionaries.
|
|
1781
|
-
:rtype: tuple
|
|
1782
|
-
"""
|
|
1783
|
-
template = deepcopy(data)
|
|
1784
|
-
new_metadata = deepcopy(metadata)
|
|
1785
|
-
disclaimer = {
|
|
1786
|
-
"category": "legal_disclaimer",
|
|
1787
|
-
"text": "Depscan reachable code only covers the project source code, "
|
|
1788
|
-
"not the code of dependencies. A dependency may execute "
|
|
1789
|
-
"vulnerable code when called even if it is not in the "
|
|
1790
|
-
"project's source code. Regard the Depscan-set flag of "
|
|
1791
|
-
"'code_not_in_execute_path' with this in mind.",
|
|
1792
|
-
}
|
|
1793
|
-
if template["document"].get("notes"):
|
|
1794
|
-
template["document"]["notes"].append(
|
|
1795
|
-
{"category": "legal_disclaimer", "text": disclaimer}
|
|
1796
|
-
)
|
|
1797
|
-
else:
|
|
1798
|
-
template["document"]["notes"] = [disclaimer]
|
|
1799
|
-
|
|
1800
|
-
# Add product tree if not present
|
|
1801
|
-
if not template.get("product_tree"):
|
|
1802
|
-
[template["product_tree"], extra_ref] = import_root_component(bom_file)
|
|
1803
|
-
if extra_ref and template["document"].get("references"):
|
|
1804
|
-
template["document"]["references"] += extra_ref
|
|
1805
|
-
elif extra_ref:
|
|
1806
|
-
template["document"]["references"] = extra_ref
|
|
1807
|
-
|
|
1808
|
-
# CSAF forbids revision entries unless the status is final, but requires
|
|
1809
|
-
# this to be here nonetheless
|
|
1810
|
-
if not template["document"]["tracking"].get("revision_history"):
|
|
1811
|
-
template["document"]["tracking"]["revision_history"] = []
|
|
1812
|
-
else:
|
|
1813
|
-
new_metadata["tracking"] = deepcopy(template["document"]["tracking"])
|
|
1814
|
-
|
|
1815
|
-
# Reset the id if it's one we've generated
|
|
1816
|
-
if re.match(
|
|
1817
|
-
r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}_v", new_metadata["tracking"]["id"]
|
|
1818
|
-
):
|
|
1819
|
-
new_metadata["tracking"]["id"] = ""
|
|
1820
|
-
|
|
1821
|
-
return template, new_metadata
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
def add_vulnerabilities(template, pkg_vulnerabilities):
|
|
1825
|
-
"""
|
|
1826
|
-
Add vulnerabilities to the given data.
|
|
1827
|
-
|
|
1828
|
-
:param template: The CSAF data so far.
|
|
1829
|
-
:type template: dict
|
|
1830
|
-
:param pkg_vulnerabilities: The vulnerabilities to add.
|
|
1831
|
-
:type pkg_vulnerabilities: list
|
|
1832
|
-
|
|
1833
|
-
:return: The modified data with added vulnerability information.
|
|
1834
|
-
:rtype: dict
|
|
1835
|
-
"""
|
|
1836
|
-
new_results = deepcopy(template)
|
|
1837
|
-
agg_score = set()
|
|
1838
|
-
severity_ref = {
|
|
1839
|
-
"CRITICAL": 1,
|
|
1840
|
-
"HIGH": 2,
|
|
1841
|
-
"MEDIUM": 3,
|
|
1842
|
-
"LOW": 4,
|
|
1843
|
-
"UNKNOWN": 5,
|
|
1844
|
-
"NONE": 6,
|
|
1845
|
-
}
|
|
1846
|
-
for r in pkg_vulnerabilities:
|
|
1847
|
-
new_vuln = vdr_to_csaf(r)
|
|
1848
|
-
if sev := new_vuln["scores"][0]["cvss_v3"].get("baseSeverity"):
|
|
1849
|
-
agg_score.add(severity_ref.get(sev))
|
|
1850
|
-
new_results["vulnerabilities"].append(new_vuln)
|
|
1851
|
-
if agg_score := list(agg_score):
|
|
1852
|
-
agg_score.sort()
|
|
1853
|
-
severity_ref = {v: k for k, v in severity_ref.items()}
|
|
1854
|
-
agg_severity = (
|
|
1855
|
-
severity_ref[agg_score[0]][0]
|
|
1856
|
-
+ severity_ref[agg_score[0]][1:].lower()
|
|
1857
|
-
)
|
|
1858
|
-
new_results["document"]["aggregate_severity"] = {"text": agg_severity}
|
|
1859
|
-
|
|
1860
|
-
return new_results
|