Skip to content

Commit

Permalink
Allow two periods in file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrwenski committed Sep 20, 2024
1 parent ae751d3 commit 9fcfcbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tds/src/main/java/thredds/util/TdsPathUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public static String extractPath(HttpServletRequest req, String removePrefix) {
if (dataPath.startsWith("/"))
dataPath = dataPath.substring(1);

if (dataPath.contains("..")) // LOOK what about escapes ??
throw new IllegalArgumentException("path cannot contain '..'");
if (dataPath.contains("../")) // LOOK what about escapes ??
throw new IllegalArgumentException("path cannot contain '../'");

return dataPath;
}
Expand Down

0 comments on commit 9fcfcbe

Please sign in to comment.