Skip to content

Commit

Permalink
Merge pull request AdoptOpenJDK#882 from BulkSecurityGeneratorProject…
Browse files Browse the repository at this point in the history
…V2/fix/JLL/partial-path-traversal-vulnerability

Fix Partial Path Traversal Vulnerability
  • Loading branch information
sclassen authored Nov 25, 2022
2 parents 83206bf + b09c6a4 commit 53f1322
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public static void recursiveDelete(File file, File base) throws IOException {
return;
}

if (!(file.getCanonicalPath().startsWith(base.getCanonicalPath()))) {
if (!(file.getCanonicalFile().toPath().startsWith(base.getCanonicalFile().toPath()))) {
throw new IOException("Trying to delete a file outside Netx's basedir: "
+ file.getCanonicalPath());
}
Expand Down

0 comments on commit 53f1322

Please sign in to comment.