GHSA-3pv8-6f4r-ffg2: tar has a PAX header desynchronization issue
When a tar stream contains multiple “header” entries prior to a file entry, tar-rs applies the PAX header (x) to the next entry in the stream, regardless of type. For example, a stream of x -> L -> file (PAX, GNU longname, file) would result in x’s extensions being applied to L rather than to file.
Per POSIX pax, this is incorrect: a PAX header always applies to a file entry, not any intermediary entries. See the “pax Header Block” section for the specific prescription there.
As a result of this, an attacker can contrive a tar containing a sequence of tar headers such that tar-rs applies the PAX header’s size extension to the next header in sequence, effectively desynchronizing the stream and enabling tar-rs specific skippage/extraction of members. In other words, a file can be contrived to extract differently on tar-rs than on other tar parsers.
References
Code Behaviors & Features
Detect and mitigate GHSA-3pv8-6f4r-ffg2 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →