Knowledge Base · general

SQLite WAL Forensics

generaltechnique notetechniquesqlite-wal

SQLite’s Write-Ahead Log and shared-memory files retain earlier database pages, letting you recover data the live DB no longer shows.

How it works

  • db-wal contains committed frames not yet checkpointed; db-shm is the index.
  • A row truncated or overwritten in the main DB can still be fully present in the WAL.
  • Dump all pages / all frames (sqlite3, sqlite-forensic, or manual WAL parsing) and diff revisions.

Detection & defence

  • For sensitive data, checkpoint + VACUUM and use PRAGMA secure_delete=ON.
  • Understand that a mobile app’s private DB is only as private as the device.