mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
✨ (Snyk) Fixed finding: "java/PT"
This commit is contained in:
parent
fc9551a332
commit
279600e04c
@ -327,6 +327,10 @@ public class PipelineProcessor {
|
|||||||
}
|
}
|
||||||
List<Resource> outputFiles = new ArrayList<>();
|
List<Resource> outputFiles = new ArrayList<>();
|
||||||
for (File file : files) {
|
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());
|
Path path = Paths.get(file.getAbsolutePath());
|
||||||
// debug statement
|
// debug statement
|
||||||
log.info("Reading file: " + path);
|
log.info("Reading file: " + path);
|
||||||
|
Loading…
Reference in New Issue
Block a user