Introduced protections against predictable RNG abuse

This commit is contained in:
pixeebot[bot] 2025-07-15 17:02:42 +00:00 committed by GitHub
parent e9c9a1594b
commit ce0efdf98d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;