Temp file permissions too permissive in export/import services #169

Closed
opened 2026-04-10 16:04:01 +02:00 by shahondin1624 · 0 comments
Owner

Severity: MEDIUM

Location

lib/Service/EncryptedExportService.php:114-164, lib/Service/BundleImportService.php:309-351

Description

Both services create temporary files with tempnam(). While finally blocks clean up the files, a race condition exists: between file_put_contents and unlink, another process could read sensitive exported data from the temp directory.

Recommendation

Set restrictive permissions on temp files (chmod 0600) immediately after creation.

## Severity: MEDIUM ## Location `lib/Service/EncryptedExportService.php:114-164`, `lib/Service/BundleImportService.php:309-351` ## Description Both services create temporary files with `tempnam()`. While `finally` blocks clean up the files, a race condition exists: between `file_put_contents` and `unlink`, another process could read sensitive exported data from the temp directory. ## Recommendation Set restrictive permissions on temp files (`chmod 0600`) immediately after creation.
shahondin1624 added the backendsecuritypriority:medium labels 2026-04-10 16:04:01 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shahondin1624/Mitgliederverwaltung#169