Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/example/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ private static void doVulnerableCode() throws SQLException {
Connection conn = DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");
}

private static void anotherVulnerableCode() {
var regex = "/^([a-zA-Z0-9])(([\\-.]|[_]+)?([a-zA-Z0-9]+))*(@){1}[a-z0-9]+[.]{1}(([a-z]{2,3})|([a-z]{2,3}[.]{1}[a-z]{2,3}))$/";

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '0'.
if (!"some phrase".matches(regex)){
throw new Error("Invalid mail format");
}
}

}