Temp file permissions too permissive in export/import services #169
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM
Location
lib/Service/EncryptedExportService.php:114-164,lib/Service/BundleImportService.php:309-351Description
Both services create temporary files with
tempnam(). Whilefinallyblocks clean up the files, a race condition exists: betweenfile_put_contentsandunlink, another process could read sensitive exported data from the temp directory.Recommendation
Set restrictive permissions on temp files (
chmod 0600) immediately after creation.