Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
<version>1.18.46</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ public AttackResult completed(@RequestParam String url) {
// going to use session auth to view this one
String authUserId = (String) userSessionData.getValue("idor-authenticated-user-id");
// don't care about http://localhost:8080 ... just want WebGoat/
String[] urlParts = url.split("/");
if (urlParts[0].equals("WebGoat")
// Use limit -1 so a trailing slash doesn't get silently swallowed (Java's split()
// drops trailing empty strings by default), then require the path to be exactly
// four segments long so extra/trailing segments appended after the user id can't
// be smuggled past this check.
String[] urlParts = url.split("/", -1);
if (urlParts.length == 4
&& urlParts[0].equals("WebGoat")
&& urlParts[1].equals("IDOR")
&& urlParts[2].equals("profile")
&& urlParts[3].equals(authUserId)) {
Expand Down
Loading