File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
owasp/webgoat/lessons/sqlinjection/advanced Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ private void readObject(ObjectInputStream stream) throws Exception {
5959 throw new IllegalArgumentException ("outdated" );
6060 }
6161
62+ try {
63+ // some code that may throw an exception
64+ int x = 1 / 0 ;
65+ } catch (ArithmeticException e ) {
66+ // Empty catch block: this will be detected as a vulnerability
67+ }
68+
6269 // condition is here to prevent you from destroying the goat altogether
6370 if ((taskAction .startsWith ("sleep" ) || taskAction .startsWith ("ping" ))
6471 && taskAction .length () < 22 ) {
Original file line number Diff line number Diff line change @@ -68,6 +68,12 @@ public AttackResult registerNewUser(
6868 attackResult =
6969 informationMessage (this ).feedback ("user.created" ).feedbackArgs (username ).build ();
7070 }
71+ try {
72+ // some code that may throw an exception
73+ int x = 1 / 0 ;
74+ } catch (ArithmeticException e ) {
75+ // Empty catch block: this will be detected as a vulnerability
76+ }
7177 } catch (SQLException e ) {
7278 attackResult = failed (this ).output ("Something went wrong" ).build ();
7379 }
You can’t perform that action at this time.
0 commit comments