security(import): validate PDF magic bytes before S3 upload #618

Merged
marcel merged 10 commits from worktree-feat+issue-529-pdf-magic-bytes into main 2026-05-19 09:45:04 +02:00
Showing only changes of commit e770b81ea5 - Show all commits

View File

@@ -575,7 +575,8 @@ class MassImportServiceTest {
File unreadable = tempDir.resolve("unreadable.pdf").toFile();
buildMinimalImportXlsx(tempDir, "unreadable.pdf");
ReflectionTestUtils.setField(service, "importDir", tempDir.toString());
assumeTrue(unreadable.setReadable(false), "Requires non-root file permissions");
unreadable.setReadable(false);
assumeTrue(!unreadable.canRead(), "Requires non-root file permissions");
try {
service.runImportAsync();
assertThat(service.getStatus().skipped()).isEqualTo(1);