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
I'm working on a test suite tar-minefield for tar file parsing (docs: stoppels.ch/tar), with the ultimate goal to ensure implementations converge on similar behavior, reducing parser differential vulnerabilities.
During this work, I found a few bugs in Haskell's tar.
Related to pax headers:
A pax header with both path and linkpath drops path. Test cases: N27 (symlink) and N28 (hard link). In this test case, GNU tar, libarchive, Python, Go and others extract a file with a 120-character name, while Haskell's tar produces one with 100 chars.
The pax size is ignored. POSIX: "This record shall override the size field in the following header block(s)". See F14.
For a repeated keyword, the first record wins, but according to POSIX: "When extended header records conflict, the last one given in the header shall take precedence". See N20.
Related to parsing of numeric fields:
8 and 9 are accepted as octal digits, so a size of 00000000090 is read as 72, where GNU tar, libarchive, Python and most others refuse it. See F37.
A negative base-256 number is read as positive, so size of -512 becomes 512. See F29.
A base-256 number that doesn't fit in 64 bits wraps around. See F30.
Activity
Bodigrim commentedon Nov 7, 2026
Thanks, I'll take a look!
haampie commentedon Nov 11, 2026
Thanks @Bodigrim! In a recent blog post I documented one more string encoding issue: https://stoppels.ch/2026/11/07/the-hardest-tarball.html. The file
caféis extracted ascafé.