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
Tara Drwenski committed Sep 19, 2024
1 parent 4251be7 commit 471b846
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 471b846

Please sign in to comment.