GdprMode.Strict warns that deleted documents are not zeroed, but every delete zero-fills them
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start with the warning in src/BLite.Core/GDPR/GdprStrictValidator.cs and compare it with DocumentCollection.DeleteCore, DynamicCollection.DeleteSlot, PageFile.FreePage, and docs/DPIA_CHECKLIST.md. Update the warning and related guidance to describe checkpoint timing, then run the issue’s delete-and-scan reproduction and the GDPR oracle-plan scenario referenced in #288; success means no incorrect claim that deleted document bytes remain until a future implementation.
Written by the indexing model from the issue text.
Description
Opening a database with GdprMode.Strict traces this warning (event 9006):
GdprMode.Strict: SecureEraseOnDelete is not yet available as an engine-level setting. Deleted document slots are not currently zeroed at the page layer. Track MISSING_FEATURES.md §3 for the planned implementation.
The second sentence is not true. Both delete paths zero-fill the bytes a deleted document occupied, and they have done so since #96 (646d940, 2026-04-29), five days before the warning was added in #113 (01ad3fa, 2026-05-04). A team doing a GDPR review reads the warning, concludes that erasure needs extra work, and asks the wrong question. docs/DPIA_CHECKLIST.md adds a third answer ("call VacuumAsync after deletion").
Found while compiling and running the README samples for #298.
Repro
// 1. The warning
Trace.Listeners.Add(listener);
using var strict = new BLiteEngine("strict.db", new CryptoOptions("pw"),
new BLiteKvOptions { DefaultGdprMode = GdprMode.Strict });
// traced: "[BLite GDPR EventId:9006] ... Deleted document slots are not currently zeroed ..."
// 2. What a delete does (plaintext, so the bytes are visible in the file)
const string Marker = "ZZ-PERSONAL-MARKER-7f3a9c-ZZ";
// typed context: insert { Name = "keep-me" }, { Name = Marker } and { Name = ~40 KB with Marker 40 times } (overflow pages),
// SaveChangesAsync, dispose → Marker occurs 41 times in typed.db
// reopen, DeleteAsync both, SaveChangesAsync, dispose → 0 times in typed.db and typed.wal
// BLiteEngine: insert { name = Marker }, CommitAsync, CheckpointAsync, close → 1 time in dyn.db
// reopen, DeleteAsync, CommitAsync, close (no checkpoint) → still 1 time in dyn.db
// reopen, CheckpointAsync, close → 0 times
Expected: the warning describes what the engine does, or is not emitted.
Actual: it says deleted slots are not zeroed; they are.
Where in the code (0450b97)
- Warning:
src/BLite.Core/GDPR/GdprStrictValidator.cs:101-107. - Typed delete:
DocumentCollection.DeleteCorecompacts the page and clears the free area (src/BLite.Core/Collections/DocumentCollection.cs:3495-3503, "Secure erase: zero-fill the free space area so the deleted document bytes are unrecoverable at the page level"). - Dynamic delete:
DynamicCollection.DeleteSlot→SlottedPageUtils.CompactAndErase(src/BLite.Core/DynamicCollection.cs:2688-2689). - Overflow pages of a deleted typed document go through
FreeOverflowChain→FreePageOnCommit;PageFile.FreePagewrites a new zero buffer with only the Free header (src/BLite.Core/Storage/PageFile.cs:1130-1144). That is why all 40 copies in the overflow pages are gone. VacuumAsyncwithVacuumOptions.SecureErase(defaulttrue) zero-fills the free space of every data page (src/BLite.Core/VacuumOptions.cs:14).
What is true, and could replace the warning
The one real caveat is timing. A delete writes the zeroed page through the WAL; the database file gets it at the next checkpoint. Until then the .db file still holds the deleted bytes (seen above for BLiteEngine, which does not checkpoint on dispose; DocumentDbContext does). So a warning, if any, would say: "Deleted documents are zero-filled on their page; the database file holds the old bytes until the next checkpoint. Call CheckpointAsync after deleting personal data." Encryption at rest, which Strict mode requires, already makes those bytes unreadable without the key.
Suggested fix
- Remove event 9006, or reword it to the checkpoint caveat above.
- Drop the pointer to
MISSING_FEATURES.md §3; #296 section 8 proposes deleting that file because everything in it has shipped. - Align
docs/DPIA_CHECKLIST.mdand the README (done in #298) on the same answer. - A test that holds it: the GDPR row of the oracle plan in #288 ("secure erase leaves no bytes of the erased document in the file"), with a checkpoint before the scan.
Related: #96 (slot-level secure erase), #113 (GdprMode.Strict), #296 section 8, #298.
- Dominant language
- C#
- Stars
- 66
- Forks
- 6
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EntglDb/BLite
-
bug package/core severity/medium triage
Difficulty 4/5 3-5 days Newbie friendliness 54/100
Maintainers usually reply within 2 days
-
bug package/core severity/medium
Difficulty 4/5 3-5 days Newbie friendliness 48/100
EntglDb/BLite#322 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement package/core
Difficulty 4/5 3-5 days Newbie friendliness 48/100
EntglDb/BLite#320 · 1 comment ·
Maintainers usually reply within 2 days
-
BLiteSession.Rollback() does not await the rollback: it returns while the transaction is still active, and failures go unobservedPossibly taken @CaffeinatedCoder claimed this 1 day ago. Openbug package/core severity/medium
Difficulty 3/5 1-2 days Newbie friendliness 78/100
EntglDb/BLite#307 · 1 comment ·
Maintainers usually reply within 2 days
-
area/indexing bug package/core severity/medium
Difficulty 4/5 3-5 days Newbie friendliness 55/100
EntglDb/BLite#305 · 1 comment ·
Maintainers usually reply within 2 days
Similar issues
-
bug priority: P2
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
[Docs] README/PRIVACY still name AppCenter although v1.5.6.0+ uses the Microsoft Store Services SDKOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/azure-sdk-tools#17317 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
swisstopo/swissgeol-boreholes-suite#3086 ·
Maintainers usually reply within 1 day