Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

GdprMode.Strict warns that deleted documents are not zeroed, but every delete zero-fills them

Open Beginner friendly
#299 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@CaffeinatedCoder is already working on this.

Since Oct 18, 2026.

  • #318 by @CaffeinatedCoder — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp

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

bug gdpr package/core severity/low

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.DeleteCore compacts 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.FreePage writes 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.
  • VacuumAsync with VacuumOptions.SecureErase (default true) 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.md and 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EntglDb/BLite

All issues in EntglDb/BLite

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.