(Snyk) Fixed finding: "java/PT"

This commit is contained in:
pixeebotstirling[bot] 2025-07-17 16:02:38 +00:00 committed by GitHub
parent fc9551a332
commit 279600e04c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -327,6 +327,10 @@ public class PipelineProcessor {
}
List<Resource> outputFiles = new ArrayList<>();
for (File file : files) {
Path normalizedPath = Paths.get(file.getName()).normalize();
if (normalizedPath.startsWith("..")) {
throw new SecurityException("Potential path traversal attempt in file name: " + file.getName());
}
Path path = Paths.get(file.getAbsolutePath());
// debug statement
log.info("Reading file: " + path);