mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-03-17 21:36:54 +01:00
Sanitized user-provided file names in HTTP multipart uploads
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package stirling.software.SPDF.controller.api;
|
||||
|
||||
import io.github.pixee.security.Filenames;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@@ -112,6 +113,6 @@ public class ScalePagesController {
|
||||
|
||||
return WebResponseUtils.bytesToWebResponse(
|
||||
baos.toByteArray(),
|
||||
file.getOriginalFilename().replaceFirst("[.][^.]+$", "") + "_scaled.pdf");
|
||||
Filenames.toSimpleFileName(file.getOriginalFilename()).replaceFirst("[.][^.]+$", "") + "_scaled.pdf");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user