test: Deep dive audit — verify and fix all findings #81
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?
Summary
Master tracking issue for all bugs, security issues, and code quality findings from the full codebase audit (2026-06-21). Each sub-issue has a fix described — verify the fix works, then close.
Critical (must fix before release)
High (fix before next minor release)
Medium (not yet tracked as issues — fix opportunistically)
BackupEngine.php:324—$archiveNamemay be undefined in catch blockSteppedSession.php:68— session directory 0755, encryption password readable by co-tenantsSteppedBackupEngine.php:397—$session->profileIdnot cast to int after JSON deserializationDatabaseDumper.php:142— no ORDER BY in chunked dump, duplicates/gaps during concurrent writesSteppedBackupEngine.php:478—backupstartempty string in notifications from stepped engineBackupEngine.php:547— sanitizeConfiguration() regex misses values with embedded newlinesBackupEngine.php:207— plaintext archive left on disk when AES encryption failsBackupsModel.php:74— sort column uses escape() instead of quoteName()TarGzArchiver.php:51— intermediate .tar not cleaned up if compress() throwsCleanupCommand.php:79— dry-run double-counts records in max-count outputLow (cosmetic / defense-in-depth)
api/BackupsController.php:124— profiles() leaks credentials (covered by #78)SteppedSession.php:113— session properties not type-validated on loadBackupEngine.php:468— setPassword() is a no-op for ZIP write (misleading)Testing Strategy
Additional findings: PreflightCheck itself has issues
The silent failure hunter reviewed PR #70's PreflightCheck and found issues with the preflight system itself:
Critical
PreflightCheck::run()and all sub-methods have unguarded database queries — if the DB is down, the preflight throws an uncaught exception that cascades into BackupEngine (where$recordIdis undefined), crashing worse than having no preflight at allrun()body in try-catch, convert DB exceptions to errorsHigh
@mkdir()at line 120 suppresses the actual failure reason (permissions? open_basedir? quota?)disk_free_space()calculation uses(int)cast — integer overflow on 32-bit PHP with >1.7GB backupscheckRequiredExtensions()still in BackupEngine + silent ZIP fallback increateArchiver()default caseMedium
mb-phaseelement, then immediately overwritten byupdateProgress()— warnings are invisible to users[HOME]can't be resolvedThese should be fixed before the preflight feature is considered production-ready.