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