squashfs: Add security hardening based on CVE research
Security fixes based on CVE research in C squashfs-tools:
- CVE-2015-4645: Integer overflow in fragment table
- CVE-2015-4646: DoS via crafted input
- CVE-2012-4025: Integer overflow via crafted block_log
- CVE-2021-40153: Directory traversal via symbolic link
Mitigations added:
- Block size validation (max 1MB per SquashFS spec)
- File size limits for read_file (default 100MB)
- Bounds checking for all metadata reads
- Symlink path traversal detection (is_path_traversal, safe_read_link)
- ID table bounds validation
- Device node detection helper (is_device)
Security documentation added to .mli with extraction guidelines.
CVE regression tests added to test suite.
Fuzz tests expanded with crafted superblock values.
References:
- https://www.cvedetails.com/vulnerability-list/vendor_id-16355/Squashfs-Project.html