After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 323534 - Passwords improperly escaped for zip files
Passwords improperly escaped for zip files
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
2.12.x
Other Linux
: Normal critical
: ---
Assigned To: Paolo Bacchilega
file-roller-maint
Depends on:
Blocks:
 
 
Reported: 2005-12-08 10:10 UTC by Josselin Mouette
Modified: 2005-12-09 09:05 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12



Description Josselin Mouette 2005-12-08 10:10:13 UTC
Version details: 2.12.2

[ initial bug report at http://bugs.debian.org/342378 ]

When a password is used for zip files, it is made by passing the command "zip
-Ppassword" to a shell. However, some characters are improperly escaped. For
example, as the user reported, using a $ character leads to "zip -Pfoo$bar",
which is translated to "zip -Pfoo" by the shell.

Another, more striking example: entering "toto`touch /tmp/grouik`" as a password
will actually lead to creating /tmp/grouik. The security implications are
obvious. Only *?[] are escaped, according to zip_escape in fr-command-zip.c.
That makes at least '`"()$!; missing.

I will go further: my feeling is that, for security reasons, all of this should
be completely rewritten. Calling a shell is a very bad idea because you have to
check the strings for sanity, and you can never be sure a sanity check is
perfect. Calling zip -P is a very bad idea as well, as it makes the password
viewavable by any other user on the system, using the "ps" command. The zip
manual page states it itself:
       -P password
              use password to encrypt zipfile entries (if any).  THIS IS INSE‐
              CURE!   Many  multi-user  operating systems provide ways for any
              user to see the current command line of any other user; even  on
              stand-alone  systems  there  is  always  the threat of over-the-
              shoulder peeking.  Storing the plaintext password as part  of  a
              command  line  in  an  automated script is even worse.  Whenever
              possible, use the non-echoing, interactive prompt to enter pass‐
              words.
Comment 1 Paolo Bacchilega 2005-12-09 09:05:08 UTC
I think that if you want *real* security you shouldn't use the zip password at
all, gnupg is a better solution.  This is noted in the file-roller manual too.

Fixed the escape issue in current CVS now, thanks.