You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
(dmg) switch encrypted-DMG crypto to purecrypto
(rar) support solid RAR5 archives, decoding the group once
(rar) RAR5 read-only reader (store + compressed) via compcol::rar5
Fixed
(qcow2) bound L1 table by file length, not minimum entries
(repack) bound source directory walk against cycles + strip '..'
(archive,grf) bounds-check entry fields and cap untrusted allocations
(iso9660,squashfs,tar) cap untrusted allocations + bound RR/PAX parsing
(f2fs,exfat,fat) cap untrusted-size allocations and validate geometry
(apfs) bound B-tree descent + checked spaceman math against malicious images
(hfs+) harden HFS+ reader against malicious images
(xfs) harden XFS reader against malicious images
(ntfs) harden NTFS reader against malicious images
(ext) harden ext2/3/4 reader against malicious images
(block,part) validate GPT/DMG/qcow2 header fields against malicious images
(doc) drop intra-doc links to private items (cargo doc -D warnings)
Other
(changelog) record security hardening pass
Security
Hardened every untrusted-input parser against malicious images/archives
following a full multi-section security audit. All issues were
denial-of-service class (panic / OOM / hang) reachable from the read path;
no memory-safety or arbitrary-write bugs were found (the lone unsafe
ioctl blocks were reviewed and are sound, and archive extraction is
image-namespaced, never host-FS). Fixes, by area:
Bounded structure traversal (was: infinite loop / stack overflow):
cycle/depth guards on the ext4 extent-tree descent, XFS bmbt, HFS+ and
APFS B-tree descents + leaf-chains, and the repack/analyze source
directory walk (visited-inode set + depth/entry caps).
Capped untrusted-size allocations (was: OOM): ext GDT, NTFS $DATA/index/compression buffers, XFS remote symlinks, HFS+ decmpfs,
exFAT NoFatChain + FAT tables, FAT32 FAT, SquashFS block lists, ISO9660
Rock Ridge CE, tar PAX/GNU-longname bodies, ZIP64 central directory,
cpio name/file sizes, GPT entry array, RAR5 window, qcow2 L1/refcount —
each now bounded against the device/file size before allocating.
Defense-in-depth: tar/repack path normalisation now drops ..
segments. Each fix returns a clean InvalidImage/Unsupported instead
of crashing/hanging; ~30 regression tests were added.
Changed
(dmg) encrypted-DMG (encrcdsa v2) crypto now runs on the pure-Rust purecrypto crate (KarpelesLab) instead of the RustCrypto stack. Drops aes, cbc, cipher, des, hmac, sha1, and pbkdf2 for a single
dependency: AES-128/256-CBC via Cbc, 3DES-EDE3-CBC keyblob unwrap via Cbc64/TdesEde3 (PKCS#7 stripped in-crate), HMAC-SHA1 chunk-IV
derivation, and PBKDF2-HMAC-SHA1 KEK derivation. Behaviour is unchanged —
the synthetic round-trips still pass and a new RFC 6070 PBKDF2-HMAC-SHA1
known-answer test pins the key-derivation bytes (so real Apple images still
decrypt). MSRV is raised to 1.95 (purecrypto's minimum); the codebase
adopts is_multiple_of accordingly.
Added
(rar) RAR5 (Rar!\x1A\x07\x01) read-only reader behind the rar feature
— walks the block chain (vint headers, file headers, compression info) and
streams each member out of its packed run: Store raw, and compressed
(no-filter / x86 E8E9) via compcol::rar5. Cross-checked against the
reference unrar extractor (committed rar -ma5 fixtures). RAR4,
encryption, and the delta/ARM/other RAR5 filters surface as a clean Unsupported; creation is unsupported (proprietary).
(rar)solid RAR5 archives. A solid group's members share one LZ
window, so it's decoded as a single continuous stream over the concatenated
packed runs (compcol's rar5 decoder is per-stream; we drive one resumable
decoder over the whole group). A persistent forward cursor lets a sequential
walk — notably repack — decompress the group exactly once instead of
re-decoding from the start per file; a backward/random read of an earlier
member rebuilds the cursor and re-decodes from the group start, staying
bounded-memory (no whole-group buffering). Validated against unrar with a
4-member cross-referencing fixture, plus a decode-once regression test. A
stored member inside a solid group stays Unsupported.