Skip to content

Stop storing unlocked volume keys in the case file - #5

Merged
deadp merged 2 commits into
mainfrom
queue/q308
Oct 21, 2026
Merged

deadp merged 2 commits into
mainfrom
queue/q308

Conversation

@deadp

@deadp deadp commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Removed the volume_keys table, save/get/forget_volume_key and the restore-on-open path; unlocked state is now session memory only.
Opening a case drops any legacy volume_keys table.
Replaced the old key-storage test with one checking a legacy table is dropped and no key bytes remain in the case folder.
Full test suite passes (1408 passed, 14 skipped).

Queued from the dashboard (item 308). The request:

Goal (audit 21-10-2026, security): unlocked BitLocker/LUKS volume keys are written into the case file, which contradicts README (~line 62: keys are never written into the case). engine/server.py (~line 4009) calls save_volume_key, which stores into the volume_keys table in engine/casedb.py. Anyone holding a case file can decrypt the volume. Fix: stop persisting keys (keep them in memory for the session only), remove save_volume_key and the volume_keys table, and on opening an existing case drop/ignore any volume_keys table so old cases stop carrying keys. Add a test that unlocking a volume leaves no key material in the case DB. This fix will also be offered upstream to switch-nz/strata as its own PR, so keep it small and focused: only the files the fix needs, upstream's code style, a test, no fork-only files or docs.

Opened by the queue runner on LXC 113. The runner squash-merges this once CI checks pass.

🤖 Generated with Claude Code

Queue runner and others added 2 commits October 21, 2026 13:53
DROP TABLE alone leaves the key bytes in free pages and the journal; zero
them with secure_delete and rewrite the file with VACUUM, once, only when
an old volume_keys table is present. The test no longer vacuums for itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@deadp
deadp merged commit d861190 into main Oct 21, 2026
33 checks passed
@deadp
deadp deleted the queue/q308 branch October 21, 2026 01:01
deadp added a commit that referenced this pull request Oct 22, 2026
Co-authored-by: Queue runner <queue-runner@noreply.invalid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant