astral-sh / astral-sh/tar-codec
Full-width checksum field without a terminator
- Dominant language
- Rust
- Stars
- 9
- Forks
- 3
- Avg merge
- 9m
- Merged PRs (30d)
- 3
Description
## Summary
`tar-framing` rejects a TAR header when the checksum occupies all eight bytes
of its fixed-width field without a trailing NUL or space.
The [reproduction archive](https://gist.githubusercontent.com/zaniebot/88e6b0a9b7e9376324cd3357098e5e40/raw/6399c074efaa58541a60291ef1e243ddc5981b63/TC-C11.tar) is accepted by Rust `tar`, Tokio TAR,
CPython `tarfile`, Go `archive/tar`, and JavaScript `tar-stream`. All five expose
the same empty regular member named `file`.
Tested with tar-codec revision
`1ac1199559a1b96f0f953ac99520ccc296503808`.
## Observed behavior
The checksum field contains the eight octal digits `00011645`. Its decoded
value matches the header, but the archive is rejected with:
```text
at byte 0: invalid tar checksum: stored None, computed 5029
```
## Expected behavior
Consider accepting a checksum when every field byte is an octal digit and the
decoded value matches, even if the field has no explicit terminator.
If the terminator requirement is intentional, it would be useful to list it as
a compatibility limitation.
## Impact
This is an interoperability issue, not an extraction vulnerability. A readable
archive can be rejected before its first member is returned.
Contributor guide
Research direction
Reproduce the failure with the linked TC-C11.tar archive at revision 1ac1199559a1b96f0f953ac99520ccc296503808, then trace checksum handling in the TAR header parser. Compare the all-digit, unterminated field with the current validation; done means the compatibility behavior is resolved and covered by a regression test or clearly documented as a limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100