Skip to content

Leading-space checksum encoding is rejected #52

Description

@zaniebot

Summary

tar-framing rejects a checksum field whose octal digits are preceded by a
space.

The reproduction archive is the libarchive compatibility fixture
test_compat_perl_archive_tar.tar. It is accepted by Rust tar, Tokio TAR,
CPython tarfile, Go archive/tar, and JavaScript tar-stream; all five expose
the same five-byte regular member named file1.

Tested with tar-codec revision
1ac1199559a1b96f0f953ac99520ccc296503808.

Observed behavior

The checksum field is 11123\0. The stored value matches the header, but the
archive is rejected with:

at byte 0: invalid tar checksum: stored None, computed 4691

Expected behavior

Consider permitting leading space padding before checksum digits.

If rejecting this established encoding is intentional, it would be useful to
list it as a compatibility limitation.

Impact

This is an interoperability issue, not an extraction vulnerability. It affects
real compatibility fixtures rather than only a synthetic edge case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    diff:restrictiveA differential where tar-codec is more restrictive than other parsers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions