r/dfir • • 6d ago

[Open Source] starshield-forensics v0.3.8: Zero-dependency Python Chromium LevelDB .log carver, zero-PII precheck & CRC32C frame quarantine (google/dfindexeddb#92)

Hi everyone,

I’m sharing starshield-forensics (v0.3.8, MIT License), an offline, read-only Python >= 3.10 standard-library toolkit (0 third-party runtime dependencies, 0 network calls) built for deterministic Chromium IndexedDB / Web Storage uncompacted write-ahead log (.log) carving, pre-engagement compaction triage, PNG/JPEG structural container inspection, financial IOC checksum validation, and privacy-by-default stdio MCP integration (starshield mcp).

(Note on current scope up front: v0.3.8 applies to LevelDB-backed Chromium stores—including existing IndexedDB directories and current Local Storage; newly created IndexedDB stores using Chromium's Chrome 150+ SQLite backend have no LevelDB .log frames. Within LevelDB stores, v0.3.8 covers uncompacted .log WAL frames only and does not decompress Snappy-compressed .ldb SSTables or non-JSON Blink StructuredClone primitives yet—.ldb Snappy support is deferred to v0.4.)

If you have uv installed, you can run the built-in synthetic clean-room showcase immediately without installing anything into your global environment:

uvx --from starshield-forensics starshield demo

(Also available via pip install starshield-forensics, brew install Ziqi/tap/starshield-forensics, or as a reproducible single-file zipapp starshield.pyz for air-gapped forensic VMs.)


Why build a specialized .log carver alongside dfindexeddb / ccl_chromium_reader?

During pre-action incident triage (for example, evaluating whether soft-deleted web messenger or B2B portal records still survive in local Chromium storage before a full lab acquisition), we kept running into three practical gaps:

  1. Zero-PII Compaction Feasibility Gate (starshield precheck): Before transferring multi-gigabyte browser profiles, responders often just need a deterministic GO / PARTIAL / NO_GO_COMPACTED_OR_UNSUPPORTED manifest showing whether uncompacted .log WAL frames exist or if records have already compacted into .ldb SSTables (checked via footer magic 0xdb4775248b80fb57)—with ephemeral HMAC-SHA256 pseudonymization enabled by default so filenames, raw hashes, and plaintext never leak into shared terminal logs unless --unredacted is explicitly passed in an offline lab.
  2. Distinguishing Intact Frames from Accidental Corruption via Masked Castagnoli CRC32C (google/dfindexeddb#92): While cross-checking 482 synthetic clean-room test vectors (v0.3.7 validation archive Zenodo 10.5281/zenodo.24156262, alongside our separate 24-case StarShield-Bench-24 benchmark; v0.3.8 does not change .log frame parsing, checksums, or reassembly) against dfindexeddb (20260210) and Pillow (13.0.0), we noted a checksum-policy difference in dfindexeddb's PhysicalRecord.FromDecoder: it decodes the 32-bit header checksum without recomputing LevelDB's masked Castagnoli CRC32C (0x82F63B78 + 0xA282EAD8) over the payload. Truncated frames or invalid record types still raise parser errors, but when accidental storage corruption (a bit flip, torn write, or bad block) leaves the corrupted bytes structurally parseable (e.g., synthetic vector S1-V05), dfindexeddb emits the altered record alongside intact ones.
    • Recorded at https://github.com/google/dfindexeddb/issues/92 (opened on 2026-11-14 by the author; no maintainer reply yet): emitting structurally valid records while preserving header fields is one defensible forensic default, whereas starshield-forensics adopts a stricter policy—logging the physical header byte offset and both checksums in corrupted_frames, dropping the damaged payload, and continuing (or resynchronising at the next 32,768-byte boundary if a corrupted length overflows its block) so examiners can inspect flagged offsets directly in a hex editor. (Important caveat: CRC32C is non-cryptographic—it detects accidental storage corruption, not deliberate tampering where an actor recomputes the frame checksum.)
  3. Explicit Epistemic Tiers & In-House Validation Record: Every JSON output item is tagged OBSERVED, DERIVED, INFERRED, or UNKNOWN. Our reproducible 482-vector in-house validation record (patterned on ISO/IEC 17025:2017 clause 7.2.2 concepts; not assessed by the UK Forensic Science Regulator and not accreditation for FSA – DIG 100) is documented here:
    • Cross-Check Summary: https://github.com/Ziqi/starshield-forensics/blob/v0.3.8/VALIDATION_REPORT_FSR_ISO17025.md

Honest Scope & Current Limitations (v0.3.8)

To save everyone time evaluating fit:

  • LevelDB .log WAL only — does NOT decompress Snappy-compressed .ldb SSTables, decode non-JSON Blink StructuredClone binary primitives, or parse Chrome 150+ SQLite-backed IndexedDB stores (.ldb Snappy + StructuredClone planned for v0.4—for compacted .ldb tables today, use dfindexeddb or ccl_chromium_reader; starshield precheck explicitly flags .ldb-only folders as NO_GO_COMPACTED_OR_UNSUPPORTED; Zstandard in current Chromium applies to SQLite IndexedDB values rather than LevelDB .ldb blocks).
  • CRC32C detects accidental corruption, not deliberate forgery: If an adversary edits a .log file and recomputes the masked CRC32C header checksum, frame verification passes.
  • Image inspection (inspect-image) is strictly structural, not pixel-level "forgery detection": It validates RFC 2083 PNG chunk CRC32s, bounded-decompresses iCCP (acsp) headers (<= 16 MiB zip-bomb cap), and reassembles multi-chunk JPEG APP2 / APP13 (8BIM) markers alongside mandatory benign OS-screenshot/resave caveats.

Supply-Chain & Reproducibility Posture

  • OpenSSF Best Practices Silver (#16602) · OpenSSF Scorecard 8.0/10 · SLSA Level 3 & PyPI PEP 740 attestations · Zenodo Concept DOI 10.5281/zenodo.24145804
  • Docs & Sample Workpaper: https://ziqi.github.io/starshield/

Very interested in feedback from practitioners on edge-case Chromium WAL schemas or multi-block corruption patterns you’ve encountered in the wild!

1 Upvotes

0 comments sorted by