1.5 KiB
1.5 KiB
A08: Software and Data Integrity Failures
Last updated: March 1, 2026
Findings addressed
- Backup/restore workflow did not verify backup artifact integrity before restoring.
- Restores could proceed with tampered/corrupted dump files, risking silent data corruption.
Fixes implemented
- Added checksum artifact generation during backups:
scripts/backup.shnow generates a SHA-256 checksum file next to each dump (.sha256).
- Added checksum verification before restore:
scripts/restore.shnow requires${BACKUP_FILE}.sha256.- Validates checksum format (64 hex chars).
- Computes runtime SHA-256 of backup file and blocks restore on mismatch.
Files changed
scripts/backup.shscripts/restore.shapi/tests/software-data-integrity-failures.test.tsapi/vitest.security.config.ts
Verification
Command:
cd api
npx vitest run -c vitest.security.config.ts tests/software-data-integrity-failures.test.ts
Verified output:
- Test Files:
1 passed (1) - Tests:
2 passed (2)
Dedicated A08 checks in software-data-integrity-failures.test.ts:
- Executes
scripts/backup.shwith stubbedpg_dumpand verifies dump +.sha256artifact generation. - Executes
scripts/restore.shwith tampered checksum and verifies restore is blocked before DB commands are invoked.
Residual notes
- This secures backup artifact integrity in operational scripts.
- For CI/CD artifact integrity hardening, next step is attestation/signature verification for deployed build artifacts.