mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-27 06:39:24 +00:00
Introduced protections against predictable RNG abuse
This commit is contained in:
parent
e9c9a1594b
commit
ce0efdf98d
@ -7,6 +7,7 @@ import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
@ -45,7 +46,7 @@ import stirling.software.common.util.WebResponseUtils;
|
||||
public class ScannerEffectController {
|
||||
|
||||
private final CustomPDFDocumentFactory pdfDocumentFactory;
|
||||
private static final Random RANDOM = new Random();
|
||||
private static final Random RANDOM = new SecureRandom();
|
||||
|
||||
// Size limits to prevent OutOfMemoryError
|
||||
private static final int MAX_IMAGE_WIDTH = 8192;
|
||||
|
Loading…
x
Reference in New Issue
Block a user