astral-sh / astral-sh/tar-codec

Embedded NUL in an xattr PAX keyword is accepted

Open
#74 3 comments 0 reactions 0 assignees View on GitHub
diff:permissive
Dominant language
Rust
Stars
9
Forks
3
Avg merge
9m
Merged PRs (30d)
3

Description

## Summary

`TarReader` accepts an embedded NUL in an extended-attribute PAX keyword. The
[reproduction archive](https://gist.githubusercontent.com/zaniebot/88e6b0a9b7e9376324cd3357098e5e40/raw/6399c074efaa58541a60291ef1e243ddc5981b63/TC-P14.tar) is Go's open-source `pax-nul-xattrs.tar`
fixture; Go `archive/tar` rejects it while the other maintained readers accept.

Tested at `1ac1199559a1b96f0f953ac99520ccc296503808`.

## Observed behavior

The record keyword contains `SCHILY.xattr.null\0`. Tar-codec classifies it as
vendor metadata and returns the member.

## Expected behavior

Consider rejecting NUL-bearing PAX keywords before vendor or xattr policy is
applied.

## Impact

An xattr name can acquire different identities across Rust strings, C APIs, and
filesystem interfaces.

Contributor guide

Open the contributing guide

Research direction

Start with TarReader's PAX keyword parsing and reproduce the issue using the linked pax-nul-xattrs.tar archive, comparing the behavior with Go's archive/tar. Trace how the keyword is classified as vendor metadata, then verify that NUL-bearing keywords are rejected before that policy is applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.