| Summary: | busybox tar allows un-escaped filenames to be printed to stdout/stderr | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Ian Norton <ian.norton> |
| Component: | Other | Assignee: | unassigned |
| Status: | NEW --- | ||
| Severity: | critical | CC: | busybox-cvs |
| Priority: | P1 | ||
| Version: | 1.37.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
|
Description
Ian Norton
2024-04-03 14:02:42 UTC
A similar bug was found as a result of other projects exploring the contributions from the person behind the xz hacks. libarchive is one such project that fixed this unescaped output (which was contributed by the attacker) the original suspicious commit there was: https://github.com/libarchive/libarchive/commit/f27c173d17dc807733b3a4f8c11207c3f04ff34f recently fixed in: https://github.com/libarchive/libarchive/commit/6110e9c82d8ba830c3440f36b990483ceaaea52c Where the fix correctly escapes archive member names (just as GNU Tar does) The following python program demonstrates creating an archive with an entry that can hide one or more previous entries from the list and verbose extract output:
#!/usr/bin/env python3
import tarfile
with tarfile.open("bad.tar", "w") as tf:
tf.add(__file__, arcname="hidden.txt")
tf.add(__file__, arcname="\033[1A\033[1Ka-totally-innocent-filename.txt")
|