Re: sharutils: Directory traversal (security issue) in uudecode

John Cowan <[email protected]> Mon, 28 Nov 2022 00:51:35 -0500
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <CAD2gp_QnTP_3BC81eg9xiNBOTcOz1c1DTfq4ihjC9fQX3JC=Aw@mail.gmail.com>
On Sun, Nov 27, 2022 at 12:30 PM Paul Eggert <[email protected]> wrote:


> Another possibility is to do as GNU 'tar' does, and warn about dubious
> file names starting with '/' or '~', while stripping leading prefixes
> (including anything ending in ".."), while retaining the current
> behavior if POSIXLY_CORRECT is set. uudecode could steal tar's code to
> do that.
>

Of course none of this really solves the problem: if the UUID is root and
the current directory is /, or the UUID is not root and the current
directory is the home directory for that UUID, an unsafe archive file can
damage the filesystem even if these protective features are in place.  This
applies to any unarchiver: cpio, pax, unzip, gunzip, etc. etc.  At most it
makes the problem less likely.