Skip to content

Commit

Permalink
Merge pull request #4 from BulkSecurityGeneratorProjectV2/fix/JLL/par…
Browse files Browse the repository at this point in the history
…tial-path-traversal-vulnerability

[SECURITY] Fix Partial Path Traversal Vulnerability
  • Loading branch information
jlangch committed Jul 29, 2022
2 parents 4b2fb36 + c942c73 commit 215ae91
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -258,7 +258,7 @@ private boolean isFileWithinDirectory(
if (dir_.isDirectory()) {
final File fl = new File(dir_, file.getPath());
if (fl.isFile()) {
if (fl.getCanonicalPath().startsWith(dir_.getCanonicalPath())) {
if (fl.getCanonicalFile().toPath().startsWith(dir_.getCanonicalFile().toPath())) {
// Prevent accessing files outside the load-path.
// E.g.: ../../coffee
return true;
Expand Down

0 comments on commit 215ae91

Please sign in to comment.