Discussion / Issue: Evil Maid "Doctored SD Card" Defense: Run-from-RAM (toram) & Physical Media Removal
Context & Inbound Community Question:
"I almost like doing something myself though -- makes it that much less likely someone's gonna just throw together a doctored SD card that'll be similar enough that I won't notice but malicious enough to do anything. Seedsigner is great but if someone wants to hit you with a malicious SD card it's not THAT hard to swap out the malicious SD card and leave you none the wiser." (via Nostr peer review)
1. Problem Statement: The Evil Maid Physical Swap Attack
In devices that maintain active reads/writes from physical storage (e.g. Raspberry Pi running from an SD card, or live Linux running persistent overlays):
- An attacker (or malicious actor with brief physical access) replaces the genuine storage card with a visually identical "doctored" SD card containing subtle seed-exfiltration or backdoored PRNG logic.
- The user powers on the device, unaware that the physical media was swapped.
- Even if the user built the original card themselves, they cannot visually distinguish a substituted card from their own.
2. SubZero Keyosk Defense Architecture
SubZero addresses the physical swap / evil maid vector through two complementary layers:
A. Run-from-RAM (toram) & Compulsory Media Ejection
- Early Boot Init Hand-off:
- GRUB loads the kernel and initial ramdisk from the USB/SD card.
- The custom initramfs copies
rootfs.squashfs directly into a 1GB volatile tmpfs RAM disk.
- The init script cleanly unmounts the physical FAT32 partition and hands execution over to OpenRC via
switch_root.
- Physical Drive Extraction:
- The user physically unplugs and removes the USB drive or SD card immediately once the TUI appears on-screen.
- Zero Physical Media Present During Entropy Generation: When the user enters their 128 coin flips or 50 dice rolls, the physical storage medium is not even in the laptop.
- Zero Post-Session Persistence: When the machine is powered off, volatile RAM loses charge instantly, wiping all private keys and entropy buffers.
B. Deterministic Build Verification & GPG Signatures
- Standalone Detached GPG Signatures:
- Every official release publishes
SHA256SUMS and detached signature SHA256SUMS.asc signed by an isolated release key (567DEEEBDB2CADC1).
- Single-Script Reproducibility:
- Any user can re-compile the raw
.img file in under 3 minutes using scripts/build_alpine_kiosk.sh inside Docker to verify byte-for-byte SHA-256 equivalence.
3. Threat Model Comparison: Persistent SD vs. Amnesic RAM Extraction
| Attack Vector |
Persistent SD / HWW Storage |
SubZero Keyosk (toram) |
| Physical Card Swap (Pre-Boot) |
Vulnerable unless hash checked on another trusted machine |
Mitigated by GPG checksum verification before flashing |
| On-Disk Malware Implantation (Post-Boot) |
Vulnerable (malware writes malicious payload or exfiltrates keys to disk partition) |
Impossible (Drive is physically unplugged; storage partition is unmounted) |
| Post-Session Memory Extraction |
Flash NAND retains written logs / traces |
Impossible (Power cutoff wipes RAM; memory zeroization on exit) |
4. Action Items & Documentation Updates
Discussion / Issue: Evil Maid "Doctored SD Card" Defense: Run-from-RAM (toram) & Physical Media Removal
Context & Inbound Community Question:
1. Problem Statement: The Evil Maid Physical Swap Attack
In devices that maintain active reads/writes from physical storage (e.g. Raspberry Pi running from an SD card, or live Linux running persistent overlays):
2. SubZero Keyosk Defense Architecture
SubZero addresses the physical swap / evil maid vector through two complementary layers:
A. Run-from-RAM (
toram) & Compulsory Media Ejectionrootfs.squashfsdirectly into a 1GB volatiletmpfsRAM disk.switch_root.B. Deterministic Build Verification & GPG Signatures
SHA256SUMSand detached signatureSHA256SUMS.ascsigned by an isolated release key (567DEEEBDB2CADC1)..imgfile in under 3 minutes usingscripts/build_alpine_kiosk.shinside Docker to verify byte-for-byte SHA-256 equivalence.3. Threat Model Comparison: Persistent SD vs. Amnesic RAM Extraction
toram)4. Action Items & Documentation Updates
docs/TRUST_MODELS.md.