@@ -105,35 +105,69 @@ private static int figureCWE( TestCaseResult tcr, Node cwenode, Node catnode) {
105105 if ( cwe .equals ( "23" ) || cwe .equals ( "36" ) ) {
106106 cwe = "22" ;
107107 }
108+ // FSB identify DES/DESede as CWE-326 (Inadequate Encryption Strength) while Benchmark
109+ // marked it as CWE-327 (Use of a Broken or Risky Cryptographic Algorithm)
110+ else if ( cwe .equals ( "326" ) ) {
111+ cwe = "327" ;
112+ }
108113 return Integer .parseInt ( cwe );
109114 }
110-
115+
116+ //This is a fallback mapping for unsupported/old versions of the Find Security Bugs plugin
117+ //All important bug patterns have their CWE ID associated in later versions (1.4.3+).
111118 switch ( cat ) {
112- case "SECCU" : return 614 ; // insecure cookie use
113- case "SECPR" : return 330 ; // weak random
114- case "SECLDAPI" : return 90 ; // LDAP injection
115- case "SECPTO" : return 22 ; // path traversal
116- case "SECPTI" : return 22 ; // path traversal
117- case "CIPINT" : return 327 ; // weak encryption - cipher with no integrity
118- case "PADORA" : return 327 ; // padding oracle -- FIXME: probably wrong
119- case "SECXPI" : return 643 ; // XPATH injection
120- case "SECWMD" : return 328 ; // weak hash
121- case "SECCI" : return 78 ; // command injection
122- case "SECDU" : return 327 ; // weak encryption DES
123- case "SECXRW" : return 79 ; // XSS
124- case "SECXSS1" : return 79 ; // XSS
125- case "SECXSS2" : return 79 ; // XSS
126- case "SECXXEDOC" : return 611 ; // XXE - Probably DOM Parser
127- case "SECSQLIHIB" : return 564 ; // Hibernate Injection, child of SQL Injection
128- case "SECXXESAX" : return 611 ; // XXE - SAX Parser
129- case "STAIV" : return 329 ; // static initialization vector for crypto
130-
131- case "SECSP" : return 00 ; // servlet parameter - not a vuln
132- case "SECSH" : return 00 ; // servlet header -- not a vuln
133- case "SECSSQ" : return 00 ; // servlet query - not a vuln
134-
119+ //Cookies
120+ case "SECIC" : return 614 ; // insecure cookie use
121+ case "SECCU" : return 00 ; // servlet cookie
122+
123+ //Injections
124+ case "SECSQLIHIB" : return 564 ; // Hibernate Injection, child of SQL Injection
125+ case "SECSQLIJDO" : return 89 ;
126+ case "SECSQLIJPA" : return 89 ;
127+ case "SECSQLISPRJDBC" : return 89 ;
128+ case "SECSQLIJDBC" : return 89 ;
129+
130+ //LDAP injection
131+ case "SECLDAPI" : return 90 ; // LDAP injection
132+
133+ //XPath injection
134+ case "SECXPI" : return 643 ; // XPATH injection
135+
136+ //Command injection
137+ case "SECCI" : return 78 ; // command injection
138+
139+ //Weak random
140+ case "SECPR" : return 330 ; // weak random
141+
142+ //Weak encryption
143+ case "SECDU" : return 327 ; // weak encryption DES
144+ case "CIPINT" : return 327 ; // weak encryption - cipher with no integrity
145+ case "PADORA" : return 327 ; // padding oracle -- FIXME: probably wrong
146+ case "STAIV" : return 329 ; // static initialization vector for crypto
147+
148+ //Weak hash
149+ case "SECWMD" : return 328 ; // weak hash
150+
151+ //Path traversal
152+ case "SECPTO" : return 22 ; // path traversal
153+ case "SECPTI" : return 22 ; // path traversal
154+
155+ //XSS
156+ case "SECXRW" : return 79 ; // XSS
157+ case "SECXSS1" : return 79 ; // XSS
158+ case "SECXSS2" : return 79 ; // XSS
159+
160+ //XXE
161+ case "SECXXEDOC" : return 611 ; // XXE
162+ case "SECXXEREAD" : return 611 ; // XXE
163+ case "SECXXESAX" : return 611 ; // XXE
164+
165+ //Input sources
166+ case "SECSP" : return 00 ; // servlet parameter - not a vuln
167+ case "SECSH" : return 00 ; // servlet header -- not a vuln
168+ case "SECSSQ" : return 00 ; // servlet query - not a vuln
135169
136- default : System .out .println ( "Unknown category: " + cat );
170+ default : System .out .println ( "Unknown category: " + cat );
137171 }
138172
139173 return 0 ;
0 commit comments