Critical · published June 3, 2025
🔥 A sneaky filesystem vulnerability lurks in the tarfile module, allowing untrusted tar archives to overwrite files outside the extraction directory! ⚡ Think of it like a delivery driver dropping off packages in anyone's backyard instead of the intended address. If you don't check the delivery logs, you could end up with a neighbor's mystery package inside your home! An attacker could potentially manipulate tar archives to write files all over your filesystem, leading to unauthorized access and data corruption. This could be absolutely devastating, as a malicious actor could replace crucial files or install backdoors while you’re none the wiser!
Think of it like a delivery driver dropping off packages in anyone's backyard instead of the intended address. If you don't check the delivery logs, you could end up with a neighbor's mystery package inside your home! This critical vulnerability allows arbitrary filesystem writes when using TarFile.extractall() or TarFile.extract(), especially with the filter set to 'data', leading to files being written outside the specified extraction directory.
An attacker could potentially manipulate tar archives to write files all over your filesystem, leading to unauthorized access and data corruption. This could be absolutely devastating, as a malicious actor could replace crucial files or install backdoors while you’re none the wiser! To protect yourself, update your Python tarfile module to a version earlier than 3.14, or ensure that you explicitly set the filter to 'no filtering' when extracting untrusted archives. It’s also wise to sanitize the input and verify archive integrity! You've got this! Follow these steps, and you'll keep your filesystem safe and sound. 🛡️