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
{{ message }}
Repository navigation
Incorrect parsing of TarInfo header when GNU long name and type AREGTYPE are combined #141707
When an entry uses GNU long name encoding the tarfile module reads in the data blocks for the name and then calls self.fromtarfile() again to get the 'actual' header. This second header is the source of truth for everything except the name which is just garbage data.
The problem is that fromtarfile() eventually calls frombuf() where this logic incorrectly uses the garbage data and overrides the entry type to directory, corrupting the entry.
Because the entry is detected as a directory, the offset is not updated properly and the next call to read a TarInfo entry will usually result in an exception. However, the exception lands up in this block where neither of the if conditions are met, so the exception is silently discarded. tarinfo remains None and the code eventually decides that there are no more entries in the tar file.
I initially ran into this issue due to reports of invalid sdists being generated by maturin.
See: PyO3/maturin#2855
Activity
Set entry type when adding to the tar file (#2859)
Set entry type when adding to the tar file (#2859)
konstin commentedon Dec 11, 2025
uv is affected by this too: astral-sh/uv#17043
pythongh-141707: Fix tarfile type corruption with GNU long names
pythongh-141707: Fix tarfile type corruption with GNU long names
pythongh-141707: Skip TarInfo DIRTYPE normalization during GNU long n…
gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name ha…
pythongh-141707: Skip TarInfo DIRTYPE normalization during GNU long n…
pythongh-141707: Skip TarInfo DIRTYPE normalization during GNU long n…
pythongh-141707: Skip TarInfo DIRTYPE normalization during GNU long n…
pythongh-141707: Skip TarInfo DIRTYPE normalization during GNU long n…
1 remaining item
[3.14] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long …
[3.13] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long …
pythongh-141707: Skip TarInfo DIRTYPE normalization during GNU long n…
[3.11] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long …
[3.10] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long …
[3.12] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long …
package/python3: security bump to v3.12.14
[CVE-2025-13462] Skip TarInfo DIRTYPE normalization during GNU long n…
[CVE-2025-13462] Skip TarInfo DIRTYPE normalization during GNU long n…
[CVE-2025-13462] Skip TarInfo DIRTYPE normalization during GNU long n…
[CVE-2025-13462] Skip TarInfo DIRTYPE normalization during GNU long n…
[CVE-2025-13462] Skip TarInfo DIRTYPE normalization during GNU long n…
[CVE-2025-13462] Skip TarInfo DIRTYPE normalization during GNU long n…