Skip to content

Commit

Permalink
fix: path traversal guard
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jan 3, 2025
1 parent cf61e24 commit 3425ee6
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/main/java/io/kestra/storage/s3/S3Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,6 @@ private String getPath(String tenantId, URI uri) {
return "/" + tenantId + path;
}

// Traversal does not work with s3 but it just return empty objects so throwing is more explicit
private void parentTraversalGuard(URI uri) {
if (uri.toString().contains("..")) {
throw new IllegalArgumentException("File should be accessed with their full path and not using relative '..' path.");
}
}

private static URI createUri(String tenantId, String key) {
return URI.create("kestra://%s".formatted(key).replace(tenantId + "/", ""));
}
Expand Down

0 comments on commit 3425ee6

Please sign in to comment.