|
19 | 19 |
|
20 | 20 | public class CweNumber { |
21 | 21 |
|
22 | | - /** 0000: To be used when the CWE reported is one we don't care about in any test suite */ |
23 | | - public static int DONTCARE = 0000; |
| 22 | + /** Used occasionally to indicate a CWE isn't mapped yet, but might get mapped properly later */ |
| 23 | + public static final int UNMAPPED = -1; |
24 | 24 |
|
25 | | - /** -1: To be used when the CWE reported is unknown */ |
26 | | - public static int UNKNOWN = -1; |
| 25 | + /** To be used when the CWE reported is one we don't care about in any test suite */ |
| 26 | + public static final int DONTCARE = 0000; |
27 | 27 |
|
28 | 28 | /** CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') */ |
29 | | - public static int PATH_TRAVERSAL = 22; |
| 29 | + public static final int PATH_TRAVERSAL = 22; |
30 | 30 |
|
31 | 31 | /** CWE-23: Relative Path Traversal */ |
32 | | - public static int RELATIVE_PATH_TRAVERSAL = 23; |
| 32 | + public static final int RELATIVE_PATH_TRAVERSAL = 23; |
33 | 33 |
|
34 | 34 | /** |
35 | 35 | * CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command |
36 | 36 | * Injection') |
37 | 37 | */ |
38 | | - public static int COMMAND_INJECTION = 78; |
| 38 | + public static final int COMMAND_INJECTION = 78; |
39 | 39 |
|
40 | 40 | /** |
41 | 41 | * CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') |
42 | 42 | */ |
43 | | - public static int XSS = 79; |
| 43 | + public static final int XSS = 79; |
44 | 44 |
|
45 | 45 | /** |
46 | 46 | * CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') |
47 | 47 | */ |
48 | | - public static int SQL_INJECTION = 89; |
| 48 | + public static final int SQL_INJECTION = 89; |
49 | 49 |
|
50 | 50 | /** |
51 | 51 | * CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection') |
52 | 52 | */ |
53 | | - public static int LDAP_INJECTION = 90; |
| 53 | + public static final int LDAP_INJECTION = 90; |
54 | 54 |
|
55 | 55 | /** CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection') */ |
56 | | - public static int CRLF_INJECTION = 93; |
| 56 | + public static final int CRLF_INJECTION = 93; |
57 | 57 |
|
58 | 58 | /** |
59 | 59 | * CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response |
60 | 60 | * Splitting') |
61 | 61 | */ |
62 | | - public static int HTTP_RESPONSE_SPLITTING = 113; |
| 62 | + public static final int HTTP_RESPONSE_SPLITTING = 113; |
63 | 63 |
|
64 | 64 | /** CWE-134: Use of Externally-Controlled Format String */ |
65 | | - public static int EXTERNALLY_CONTROLLED_STRING = 134; |
| 65 | + public static final int EXTERNALLY_CONTROLLED_STRING = 134; |
66 | 66 |
|
67 | 67 | /** CWE-284: Improper Access Control */ |
68 | | - public static int IMPROPER_ACCESS_CONTROL = 284; |
| 68 | + public static final int IMPROPER_ACCESS_CONTROL = 284; |
69 | 69 |
|
70 | 70 | /** CWE-327: Use of a Broken or Risky Cryptographic Algorithm */ |
71 | | - public static int WEAK_CRYPTO_ALGO = 327; |
| 71 | + public static final int WEAK_CRYPTO_ALGO = 327; |
72 | 72 |
|
73 | 73 | /** CWE-328: Use of Weak Hash */ |
74 | | - public static int WEAK_HASH_ALGO = 328; |
| 74 | + public static final int WEAK_HASH_ALGO = 328; |
75 | 75 |
|
76 | 76 | /** CWE-329: Generation of Predictable IV with CBC Mode */ |
77 | | - public static int STATIC_CRYPTO_INIT = 329; |
| 77 | + public static final int STATIC_CRYPTO_INIT = 329; |
78 | 78 |
|
79 | 79 | /** CWE-330: Use of Insufficiently Random Values */ |
80 | | - public static int WEAK_RANDOM = 330; |
| 80 | + public static final int WEAK_RANDOM = 330; |
81 | 81 |
|
82 | 82 | /** CWE-352: Cross-Site Request Forgery (CSRF) */ |
83 | | - public static int CSRF = 352; |
| 83 | + public static final int CSRF = 352; |
84 | 84 |
|
85 | 85 | /** CWE-382: J2EE Bad Practices: Use of System.exit() */ |
86 | | - public static int SYSTEM_EXIT = 382; |
| 86 | + public static final int SYSTEM_EXIT = 382; |
87 | 87 |
|
88 | 88 | /** CWE-395: Use of NullPointerException Catch to Detect NULL Pointer Dereference */ |
89 | | - public static int CATCHING_NULL_POINTER_EXCEPTION = 395; |
| 89 | + public static final int CATCHING_NULL_POINTER_EXCEPTION = 395; |
90 | 90 |
|
91 | 91 | /** CWE-396: Declaration of Catch for Generic Exception */ |
92 | | - public static int CATCH_GENERIC_EXCEPTION = 396; |
| 92 | + public static final int CATCH_GENERIC_EXCEPTION = 396; |
93 | 93 |
|
94 | 94 | /** CWE-397: Declaration of Throws for Generic Exception */ |
95 | | - public static int THROW_GENERIC_EXCEPTION = 397; |
| 95 | + public static final int THROW_GENERIC_EXCEPTION = 397; |
96 | 96 |
|
97 | 97 | /** CWE-478: Missing Default Case in Switch Statement */ |
98 | | - public static int MISSING_DEFAULT_CASE = 478; |
| 98 | + public static final int MISSING_DEFAULT_CASE = 478; |
99 | 99 |
|
100 | 100 | /** CWE-483: Incorrect Block Delimitation */ |
101 | | - public static int INCORRECT_BLOCK_DELIMITATION = 483; |
| 101 | + public static final int INCORRECT_BLOCK_DELIMITATION = 483; |
102 | 102 |
|
103 | 103 | /** CWE-484: Omitted Break Statement in Switch */ |
104 | | - public static int OMITTED_BREAK = 484; |
| 104 | + public static final int OMITTED_BREAK = 484; |
105 | 105 |
|
106 | 106 | /** CWE-493: Critical Public Variable Without Final Modifier */ |
107 | | - public static int PUBLIC_VAR_WITHOUT_FINAL = 493; |
| 107 | + public static final int PUBLIC_VAR_WITHOUT_FINAL = 493; |
108 | 108 |
|
109 | 109 | /** CWE-500: Public Static Field Not Marked Final */ |
110 | | - public static int PUBLIC_STATIC_NOT_FINAL = 500; |
| 110 | + public static final int PUBLIC_STATIC_NOT_FINAL = 500; |
111 | 111 |
|
112 | 112 | /** CWE-501: Trust Boundary Violation */ |
113 | | - public static int TRUST_BOUNDARY_VIOLATION = 501; |
| 113 | + public static final int TRUST_BOUNDARY_VIOLATION = 501; |
114 | 114 |
|
115 | 115 | /** CWE-502: Deserialization of Untrusted Data */ |
116 | | - public static int INSECURE_DESERIALIZATION = 502; |
| 116 | + public static final int INSECURE_DESERIALIZATION = 502; |
117 | 117 |
|
118 | 118 | /** CWE-523: Unprotected Transport of Credentials */ |
119 | | - public static int UNPROTECTED_CREDENTIALS_TRANSPORT = 523; |
| 119 | + public static final int UNPROTECTED_CREDENTIALS_TRANSPORT = 523; |
120 | 120 |
|
121 | 121 | /** CWE-532: Insertion of Sensitive Information into Log File */ |
122 | | - public static int SENSITIVE_LOGFILE = 532; |
| 122 | + public static final int SENSITIVE_LOGFILE = 532; |
123 | 123 |
|
124 | 124 | /** CWE-564: SQL Injection: Hibernate */ |
125 | | - public static int HIBERNATE_INJECTION = 564; |
| 125 | + public static final int HIBERNATE_INJECTION = 564; |
126 | 126 |
|
127 | 127 | /** CWE-572: Call to Thread run() instead of start() */ |
128 | | - public static int THREAD_WRONG_CALL = 572; |
| 128 | + public static final int THREAD_WRONG_CALL = 572; |
129 | 129 |
|
130 | 130 | /** CWE-580: clone() Method Without super.clone() */ |
131 | | - public static int CLONE_WITHOUT_SUPER_CLONE = 580; |
| 131 | + public static final int CLONE_WITHOUT_SUPER_CLONE = 580; |
132 | 132 |
|
133 | 133 | /** CWE-563: Assignment to Variable without Use */ |
134 | | - public static int UNUSED_VAR_ASSIGNMENT = 563; |
| 134 | + public static final int UNUSED_VAR_ASSIGNMENT = 563; |
135 | 135 |
|
136 | 136 | /** CWE-581: Object Model Violation: Just One of Equals and Hashcode Defined */ |
137 | | - public static int OBJECT_MODEL_VIOLATION = 581; |
| 137 | + public static final int OBJECT_MODEL_VIOLATION = 581; |
138 | 138 |
|
139 | 139 | /** CWE-583: finalize() Method Declared Public */ |
140 | | - public static int FINALIZE_DECLARED_PUBLIC = 583; |
| 140 | + public static final int FINALIZE_DECLARED_PUBLIC = 583; |
141 | 141 |
|
142 | 142 | /** CWE-584: Return Inside Finally Block */ |
143 | | - public static int RETURN_INSIDE_FINALLY = 584; |
| 143 | + public static final int RETURN_INSIDE_FINALLY = 584; |
144 | 144 |
|
145 | 145 | /** CWE-595: Comparison of Object References Instead of Object Contents */ |
146 | | - public static int OBJECT_REFERENCE_COMPARISON = 595; |
| 146 | + public static final int OBJECT_REFERENCE_COMPARISON = 595; |
147 | 147 |
|
148 | 148 | /** CWE-601: URL Redirection to Untrusted Site ('Open Redirect') */ |
149 | | - public static int OPEN_REDIRECT = 601; |
| 149 | + public static final int OPEN_REDIRECT = 601; |
150 | 150 |
|
151 | 151 | /** CWE-611: Improper Restriction of XML External Entity Reference */ |
152 | | - public static int XXE = 611; |
| 152 | + public static final int XXE = 611; |
153 | 153 |
|
154 | 154 | /** CWE-614: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute */ |
155 | | - public static int INSECURE_COOKIE = 614; |
| 155 | + public static final int INSECURE_COOKIE = 614; |
156 | 156 |
|
157 | 157 | /** CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection') */ |
158 | | - public static int XPATH_INJECTION = 643; |
| 158 | + public static final int XPATH_INJECTION = 643; |
159 | 159 |
|
160 | 160 | /** |
161 | 161 | * CWE-649: Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity |
162 | 162 | * Checking |
163 | 163 | */ |
164 | | - public static int OBFUSCATION = 649; |
| 164 | + public static final int OBFUSCATION = 649; |
165 | 165 |
|
166 | 166 | /** CWE-652: Improper Neutralization of Data within XQuery Expressions ('XQuery Injection') */ |
167 | 167 | public static int XQUERY_INJECTION = 652; |
168 | 168 |
|
169 | 169 | /** CWE-754: Improper Check for Unusual or Exceptional Conditions */ |
170 | | - public static int IMPROPER_CHECK_FOR_CONDITIONS = 754; |
| 170 | + public static final int IMPROPER_CHECK_FOR_CONDITIONS = 754; |
171 | 171 |
|
172 | 172 | /** |
173 | 173 | * CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') |
174 | 174 | */ |
175 | 175 | public static int XEE = 776; |
176 | 176 |
|
177 | 177 | /** CWE-783: Operator Precedence Logic Error */ |
178 | | - public static int OPERATOR_PRECEDENCE_LOGIC = 783; |
| 178 | + public static final int OPERATOR_PRECEDENCE_LOGIC = 783; |
179 | 179 |
|
180 | 180 | /** CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') */ |
181 | | - public static int LOOP_WITH_UNREACHABLE_EXIT = 835; |
| 181 | + public static final int LOOP_WITH_UNREACHABLE_EXIT = 835; |
182 | 182 |
|
183 | 183 | /** CWE-916: Use of Password Hash With Insufficient Computational Effort */ |
184 | | - public static int PASSWORD_HASH_WITH_INSUFFICIENT_COMPUTATIONAL_EFFORT = 916; |
| 184 | + public static final int PASSWORD_HASH_WITH_INSUFFICIENT_COMPUTATIONAL_EFFORT = 916; |
185 | 185 |
|
186 | 186 | /** CWE-918: Server-Side Request Forgery (SSRF) */ |
187 | | - public static int SSRF = 918; |
| 187 | + public static final int SSRF = 918; |
188 | 188 |
|
189 | 189 | /** CWE-1004: Sensitive Cookie Without 'HttpOnly' Flag */ |
190 | | - public static int COOKIE_WITHOUT_HTTPONLY = 1004; |
| 190 | + public static final int COOKIE_WITHOUT_HTTPONLY = 1004; |
191 | 191 |
|
192 | 192 | /** CWE-1021: Improper Restriction of Rendered UI Layers or Frames */ |
193 | | - public static int IMPROPER_UI_LAYER_RESTRICTION = 1021; |
| 193 | + public static final int IMPROPER_UI_LAYER_RESTRICTION = 1021; |
194 | 194 |
|
195 | 195 | /** CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine */ |
196 | | - public static int SSTI = 1336; |
| 196 | + public static final int SSTI = 1336; |
197 | 197 | } |
0 commit comments