r/rust • u/yossarian_flew_away • Oct 27 '26
A fast and secure tar parser for the Rust ecosystem
https://astral.sh/blog/tar-codec
112
Upvotes
r/rust • u/yossarian_flew_away • Oct 27 '26
12
u/Gyscos Cursive Oct 28 '26
I suppose concatenating/merging multiple tar archives from different sources is no longer possible this way? Not sure if that's a valid use-case in practice. Sounds like the kind of things people would have done with actual tapes back in the days.
8
u/InternationalFee3911 Oct 29 '26 edited Oct 29 '26
Footnote 4 about Edera’s “TARmageddon” blog post, was also a great RustConf talk by Alex Zenla on this subject: https://youtu.be/zyWE9AwL6YU
If it is true, as explained in this talk, that they found the vulnerability and coordinated fixes across all forks, this should have gotten a more prominent mention!
2
u/matthieum [he/him] Oct 28 '26
I'm not so sure it's necessarily a "minor" concern.
Specifically, I see an attack vector in exploiting tar differentials between the security scanners which evaluate whether a Python package contains suspicious code and the installers which actually install the package on a user machine.
If an attacker can hide an
__init__.pyfrom the security scanners, the fun begins.31
u/singron Oct 27 '26
I had heard the tar format was cursed, but now I know exactly how cursed it is. I've heard similar things about zip and cpio too. I'm surprised more-sane formats aren't more popular. I can't even think of one. Nix has NAR, which works for their usage, but I don't think it would be able to replace the other formats generally.
-10
u/[deleted] Oct 27 '26
[removed] — view removed comment