Skip to content

Commit 1d26190

Browse files
committed
Added vulnerable parts to the gradle and maven projects
1 parent 9dd910a commit 1d26190

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

java/gradle/src/main/java/com/example/ExploreMe.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public static void exploreMe(int a, int b, String c) {
99
if (c.startsWith("@")) {
1010
String className = c.substring(1);
1111
try {
12-
Class.forName(className);
13-
} catch (ClassNotFoundException ignored) {
12+
Class.forName(className).newInstance();
13+
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException ignored) {
1414
}
1515
}
1616
}

java/maven/src/main/java/com/example/ExploreMe.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public static void exploreMe(int a, int b, String c) {
99
if (c.startsWith("@")) {
1010
String className = c.substring(1);
1111
try {
12-
Class.forName(className);
13-
} catch (ClassNotFoundException ignored) {
12+
Class.forName(className).newInstance();
13+
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException ignored) {
1414
}
1515
}
1616
}

0 commit comments

Comments
 (0)