Skip to content

Commit 215ae91

Browse files
authored
Merge pull request #4 from BulkSecurityGeneratorProjectV2/fix/JLL/partial-path-traversal-vulnerability
[SECURITY] Fix Partial Path Traversal Vulnerability
2 parents 4b2fb36 + c942c73 commit 215ae91

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private boolean isFileWithinDirectory(
258258
if (dir_.isDirectory()) {
259259
final File fl = new File(dir_, file.getPath());
260260
if (fl.isFile()) {
261-
if (fl.getCanonicalPath().startsWith(dir_.getCanonicalPath())) {
261+
if (fl.getCanonicalFile().toPath().startsWith(dir_.getCanonicalFile().toPath())) {
262262
// Prevent accessing files outside the load-path.
263263
// E.g.: ../../coffee
264264
return true;

0 commit comments

Comments
 (0)