Skip to content

Security: ABiswasDev/Ombracrux

SECURITY.md

Security Policy & Cryptographic Specification

Supported Versions

Ombracrux is under active R&D. Security fixes are applied to the main branch and shipped in the latest tagged release.

  • Supported Wire Format: Current multi-cipher authenticated wire format (shared across Desktop GUI and ombracrux-cli).
  • Unsupported Wire Formats: Older legacy headers are explicitly rejected with an unsupported version error. No silent downgrade path exists.

Reporting a Vulnerability

Please do not report security vulnerabilities through public GitHub issues or discussions. Public disclosure before a fix is available puts users at risk.

Report vulnerabilities, memory-handling flaws, filesystem bypasses, or cryptographic defects privately:

What to Include

  • A concise description of the vulnerability, affected component (ombracrux-core, apps/cli, or src-tauri), and potential impact.
  • The exact Ombracrux version or commit hash and host OS.
  • Step-by-step reproduction instructions or a minimal proof-of-concept fixture.

Response Protocol

  1. Acknowledgment: Receipt will be confirmed privately as soon as possible.
  2. Triage & Patching: If validated, a fix and regression test will be engineered and released promptly.
  3. Attribution: With your explicit consent, you will be credited in the release notes for responsible disclosure.

Binary Wire Format Specification

Every .ombracrx share file consists of a fixed-structure Share Header followed immediately by a sequence of Length-Prefixed AEAD Payload Frames, ending with a mandatory Authenticated Final Closure Record. All multi-byte integers are big-endian.

1. Share Header Layout

  • 256-bit suites (XChaCha20-Poly1305, AES-256-GCM-SIV): 113 bytes total (33-byte Shamir share fragment).
  • 512-bit Cascaded suite: 145 bytes total (65-byte Shamir share fragment).
Byte Offset Size (Bytes) Field Description
0..8 8 magic ASCII magic bytes identifying an Ombracrux share
8..10 2 version Wire format revision (u16 BE = 5)
10 1 cipher_suite Cipher suite ID (u8)
11..27 16 bundle_id Random CSPRNG (OsRng) identifier shared by all shares in the vault
27 1 total_shares Total shares generated ($N$, 2..=255)
28 1 threshold Minimum shares required to recover ($T$, 1..=N)
29 1 share_index 1-based unique index for this share (1..=N)
30..46 16 base_nonce_prefix Random CSPRNG (OsRng) nonce prefix shared by the bundle
46..48 2 ssss_len Byte length of ssss_share_data (u16 BE: 33 or 65)
48..(48+ssss_len) 33 or 65 ssss_share_data Raw Shamir fragment over $GF(2^8)$ (blahaj)
Last 32 bytes 32 header_auth HMAC-SHA256 authentication tag over all preceding header fields

Header Authentication & Key Derivation

  • The master key (32 bytes for 256-bit suites; 64 bytes for 512-bit Cascaded) is generated via OsRng and split into $N$ shares with threshold $T$ over $GF(2^8)$ using blahaj (with its zeroize feature enabled).
  • A dedicated 32-byte header authentication subkey is derived from the master key via HKDF-SHA256 (scoped to bundle_id and domain-separated info context).
  • header_auth is computed as HMAC-SHA256 over all serialized header fields preceding the tag.
  • During verify and restore, Ombracrux reconstructs the candidate master key from the supplied Shamir fragments and verifies header_auth in constant time on every supplied share header before decrypting any payload bytes.
  • ShareHeader implements a custom Debug formatter that replaces ssss_share_data with <REDACTED ...> so Shamir key fragments cannot leak into debug logs or error traces.

2. Payload Stream Framing & AEAD Construction

Plaintext TAR output is split into ordered chunks of at most CHUNK_SIZE = 1,048,576 bytes (1 MiB). Each encrypted frame is written as:

[ frame_len: u32 (Big-Endian) ] [ ciphertext || auth_tag(s) ]

Nonce Derivation (Per Chunk)

  • XChaCha20-Poly1305 (24-byte nonce): base_nonce_prefix[0..16] || chunk_index.to_be_bytes() (8 bytes).
  • AES-256-GCM-SIV (12-byte nonce): base_nonce_prefix[0..4] || chunk_index.to_be_bytes() (8 bytes).

Associated Data (AAD) Layout (41 Bytes)

Every AEAD operation binds the exact chunk position, vault identity, cipher suite, cascade layer, and final-record state into a 41-byte AAD:

Byte Offset Size (Bytes) Field Value
0..2 2 version Current format revision (5u16 BE)
2 1 cipher_suite Cipher suite ID (u8)
3 1 layer_id 0x00 single-layer, 0x01 cascade inner AES, 0x02 cascade outer XChaCha20
4..20 16 bundle_id 16-byte bundle identifier from header
20..28 8 chunk_index 0-based sequential chunk index (u64 BE); equals total_chunks on EOF record
28..32 4 plaintext_len Chunk plaintext length (u32 BE); 0 on EOF record
32..40 8 total_plaintext_len 0 on data chunks; exact cumulative plaintext bytes (u64 BE) on EOF record
40 1 is_final 0 on data chunks; 1 on EOF closure record

Cascaded Suite Composition (512-bit)

  • Master key bytes 0..32 key the inner AES-256-GCM-SIV cipher (layer_id = 0x01).
  • Master key bytes 32..64 key the outer XChaCha20-Poly1305 cipher (layer_id = 0x02).
  • On encryption, plaintext is sealed with the inner cipher (producing plaintext_len + 16 bytes), and that inner ciphertext is sealed with the outer cipher (producing plaintext_len + 32 bytes).
  • On decryption and verification, the outer XChaCha20-Poly1305 tag is verified before the inner AES-256-GCM-SIV layer is opened.

Final Closure Record & Trailing-Byte Rejection

  • After the final data chunk, Ombracrux emits an empty-plaintext (0-byte) AEAD record with is_final = 1, chunk_index = total_chunks, and total_plaintext_len set to the exact uncompressed TAR byte count.
  • Its frame_len equals tag_overhead (16 bytes for single-layer suites; 32 bytes for Cascaded).
  • Both verify and restore fail if the final closure record is missing, fails authentication, or is followed by even a single trailing byte.

Frozen Golden Fixtures

  • Immutable canonical binary fixtures for all three cipher suites live under crates/ombracrux-core/tests/fixtures/ and are verified on every CI run across Linux, Windows, and macOS.

Dependency & Third-Party Audit Boundaries

Ombracrux strives for complete transparency about what has and has not been independently audited:

Component / Crate Role in Ombracrux Audit Status & Notes
Ombracrux (ombracrux-core, apps/cli, src-tauri) Threshold orchestration, wire framing, fs_guard, tar_policy, hygiene, staging, GUI/CLI Not independently audited. Covered by automated unit, golden-fixture, streaming, and interop tests plus 3 seeded libFuzzer parser harnesses with dictionaries.
chacha20poly1305 (RustCrypto) Default 256-bit AEAD and outer Cascaded layer Third-party security audit completed (NCC Group, 2020). Recommended default cipher.
aes (RustCrypto) Underlying AES block primitive Third-party security audit completed (NCC Group, 2020).
aes-gcm-siv (RustCrypto) Optional RFC 8452 AEAD and inner Cascaded layer Not independently audited as a standalone crate by a third party. Users preferring an audited cipher implementation should use the default XChaCha20-Poly1305 suite.
blahaj (features = ["zeroize"]) Shamir's Secret Sharing over $GF(2^8)$ Community crate; not independently audited. Replaced sharks to address random polynomial coefficient bias (RUSTSEC) and add zeroized share handling.
hkdf, hmac, sha2, zeroize (RustCrypto) Header subkey derivation, header MAC, manifest checksums, best-effort zeroization Widely deployed RustCrypto crates; zeroization remains subject to compiler and OS limits.

Supply-Chain, CI & Release Controls

  • Dependency Auditing: Every push and pull request runs npm audit --audit-level=moderate and cargo audit --deny unsound against the RustSec advisory database (with documented, unfixable transitive Tauri advisories tracked explicitly in .cargo/audit.toml).
  • Continuous Seeded Parser Fuzzing: Three standalone libFuzzer targets (fuzz_share_header, fuzz_payload_stream, and fuzz_tar_policy) live under fuzz/ alongside target-specific dictionaries (fuzz/dictionaries/*.dict). Before running on a weekly schedule or manual dispatch via .github/workflows/fuzz.yml, all three targets are seeded by generate_fuzz_seed_corpora with frozen share headers, decryptable single-chunk and multi-chunk encrypted streams across all three cipher suites, and valid plus adversarial TAR archives (including nested directories, GNU LongLink paths, and PAX headers).
  • Release Provenance: Desktop (release.yml) and CLI (release-cli.yml) release workflows pin third-party GitHub Actions to full commit SHAs, isolate build and publish permissions, classify -beta/-rc tags as GitHub pre-releases, generate .sha256 checksums, and emit SLSA build provenance attestations verifiable via gh attestation verify.

Filesystem, Durability, Memory, and Lifecycle Defenses

1. Symlink, Reparse-Point, Mutation & TAR Policy Protections (fs_guard.rs, archive.rs, preflight.rs, tar_policy.rs)

  • Source directories, output directories, manifest directories, and Hygiene target directories reject symbolic links and NTFS reparse points/junctions via symlink_metadata.
  • Splitting rejects output paths equal to or nested inside the canonicalized source directory tree.
  • Both archive.rs and preflight.rs exclude only a root-level regular file named .ombracrux-hygiene.lock so re-archiving a directory that previously hosted Ombracrux outputs does not capture internal coordination state. Symlinks with that name are still rejected, and nested user files with the same name inside subdirectories are preserved.
  • Regular files and directories inside a source tree are opened without following links (O_NOFOLLOW on Linux/macOS; FILE_FLAG_OPEN_REPARSE_POINT and FILE_FLAG_BACKUP_SEMANTICS on Windows) and checked against pre-open metadata to detect concurrent swaps.
  • During archiving (archive.rs), Ombracrux verifies exact byte count read, EOF growth probing, and pre/post-read file identity: (dev, ino) plus ctime on Unix, and handle-backed volume serial + 64-bit file index via same-file (GetFileInformationByHandle) alongside creation time, last-write time, and file size on Windows. On Windows virtual or network filesystems that do not expose handle-based file identity, replacement detection degrades gracefully to best-effort metadata comparison (creation_time, last_write_time, and file_size). (This is best-effort detection and is not a filesystem snapshot.)
  • Both verify and restore enforce the exact same TarPolicyValidator (tar_policy.rs), inspecting every TAR entry to reject empty paths, parent-directory traversal (..), root/prefix paths, duplicate normalized paths, and non-regular/non-directory entry types (such as injected symlinks, hard links, FIFOs, or device nodes).

2. Staged Output, Atomic No-Clobber Publication & Explicit Durability Reporting

  • Split (ShareOutputTransaction): Writes encrypted output to hidden .ombracrux-*.partial files in the destination folder, flushes and sync_all()s every file handle, and publishes each share atomically without overwriting existing outputs via persist_noclobber. If a handled commit failure occurs, previously published shares are rolled back where possible. Multi-share publication is not a single atomic filesystem transaction: a sudden power loss mid-commit can leave some completed shares published alongside remaining .partial files (which Hygiene can safely remove after reboot). Once published, Ombracrux marks the transaction committed and syncs parent directory metadata (sync_directory).
  • Restore (restore.rs & fs_guard.rs): Unpacks into a unique hidden .ombracrx-restore-<32-hex>.tmp staging directory inside the chosen destination (0700 permissions on Unix; inherited destination ACLs on Windows). After the entire TAR stream and final closure record authenticate cleanly, Ombracrux flushes restored regular files in bounded parallel batches (256 files per batch) and syncs staged directories bottom-up (sync_tree_no_symlinks), publishes the staging directory to Ombracrux-Restored-<32-hex> via publish_noclobber, and syncs parent directory metadata (sync_directory).
  • Atomic No-Clobber Publication (publish_noclobber): Both restore.rs and the non-hardlink fallback in manifest.rs use publish_noclobber, which invokes kernel-atomic no-replace primitives where supported—renameat2(RENAME_NOREPLACE) on Linux and renameatx_np(RENAME_EXCL) on macOS via rustix, and MoveFileExW(..., 0) (omitting MOVEFILE_REPLACE_EXISTING) on Windows—and falls back to a rechecked rename only when the underlying filesystem reports the atomic flag is unsupported (such as FAT32, exFAT, or FUSE mounts).
  • Recovery Manifests (manifest.rs): Stages <VaultName>.manifest.json and <VaultName>.recovery-card.html into hidden .ombracrux-meta-*.partial files, calls sync_all(), publishes via no-clobber hard_link (falling back to publish_noclobber on filesystems without hard-link support), and records parent directory durability.
  • Explicit Durability Reporting (SyncStatus & DurabilityReport): File and directory flush helpers return an explicit SyncStatus (Synced, Unsupported, or Skipped) aggregated into a DurabilityReport rather than silently collapsing skipped or unsupported operations into success:
    • Full sync confirmed: No warning or note is emitted.
    • Platform/filesystem limitation (Unsupported or Skipped): For example, directory fsync on Windows (Unsupported), Unix filesystems returning InvalidInput/Unsupported, or Windows read-only extracted files that cannot be reopened for FlushFileBuffers without modifying ACLs (Skipped). Publication succeeds and surfaces an informational durability Note: detailing the limitation.
    • Actual post-publish I/O sync failure: Across split, restore, and manifest, if parent-directory sync_directory() encounters an I/O error after outputs have already been published, Ombracrux returns the published paths alongside a durability Warning: rather than falsely reporting failed publication or deleting published outputs.
  • Classified Failover: RestoreError distinguishes payload/archive corruption (PayloadOrArchive) from destination filesystem failures (Destination, such as read-only permissions or full disk) and user cancellation (Cancelled). Failover retries the next share only on payload/archive errors; destination errors and cancellations abort immediately and remove the staging directory.

3. Cooperative Cancellation & Cross-Process Workspace Hygiene (hygiene.rs)

  • GUI: An RAII OperationControl / OperationLease lock prevents concurrent jobs and eliminates cancel-vs-start races when the user clicks Cancel.
  • CLI: A Ctrl+C (SIGINT) handler sets the shared AtomicBool cancel token, halts archiving/AEAD/verification/restoration loops cleanly, removes temporary .partial or .tmp artifacts, and exits with code 130.
  • Cross-Process Directory Coordination Lock: Active split, restore, and manifest operations acquire a shared lock on a persistent .ombracrux-hygiene.lock file in the target directory (opened with O_NOFOLLOW / FILE_FLAG_OPEN_REPARSE_POINT, 0o600 on Unix, never unlinked while locked). Standalone manifest runs acquire this shared lock automatically, while split shares its active lock with manifest export via write_recovery_files_locked.
  • Safe Hygiene Cleanup: clean_hygiene_dir acquires a non-blocking exclusive lock on .ombracrux-hygiene.lock (creating no lockfile in already clean directories). If any GUI or CLI process holds a shared operation lock on that directory, Hygiene reports an active operation and skips cleanup. Otherwise, it removes only direct-child files matching .ombracrux-*.partial and direct-child directories matching .ombracrx-restore-*.tmp, skipping symlinks and never modifying completed .ombracrx shares, recovery manifests, or user files.

4. Secret & Plaintext Memory Handling

  • Generated and reconstructed master keys, blahaj Shamir fragments, ShareHeader fragments, derived HKDF-SHA256 header subkeys, and streaming plaintext buffers in archive.rs, crypto.rs, restore.rs, and verify.rs are wrapped in zeroize::Zeroizing to clear heap buffers on drop.
  • While payload buffers and durability file-sync batches are strictly memory-bounded, TarPolicyValidator path bookkeeping and directory-sync tracking grow linearly with the number of archived filesystem entries.
  • User-space zeroization is a best-effort defense and cannot guarantee erasure of copies residing in CPU registers/caches, compiler temporaries, OS kernel buffers, or unencrypted swap space.

Explicit Non-Goals & Out-of-Scope Threats

  • Compromised Host OS: Ombracrux assumes a trusted local machine during execution. It cannot protect plaintext or keys against kernel rootkits, privileged malware, keyloggers, or live memory scraping.
  • Physical Flash / SSD Erasure: Staging cleanup and Workspace Hygiene use standard OS unlinking (remove_file / symlink-safe recursive remove_dir). They do not guarantee physical block erasure on wear-leveled SSDs, NVMe drives, or USB flash media.
  • Filesystem Snapshots & Untrusted Concurrent Writers: While archive.rs and fs_guard.rs perform no-follow opens, handle-backed identity checks (with metadata fallback on Windows virtual/network filesystems), and pre/post-read file mutation checks, Ombracrux is not a copy-on-write snapshot engine and assumes the source directory is frozen during an active split.
  • Atomic Multi-File Transactions Across Power Failure: Individual shares are published atomically without clobbering existing outputs, and handled commit failures roll back previously published shares where possible, but standard filesystems do not provide an all-or-nothing multi-file commit across a hard power cut.
  • Recovery Below Threshold or Total Payload Loss: There is no escrow key or bypass. If fewer than $T$ shares survive, or if every surviving share's encrypted payload is damaged, recovery is impossible.
  • Manifest-Only Authenticity: .manifest.json and .recovery-card.html provide unkeyed SHA-256 checksums for convenience against accidental bit-rot; they are not cryptographic signatures. Always rely on verify or restore for authoritative authentication.

There aren't any published security advisories