Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 159817 - CAN-2005-0758 bzgrep has security issue in sed usage
Summary: CAN-2005-0758 bzgrep has security issue in sed usage
Alias: None
Product: Fedora
Classification: Fedora
Component: bzip2
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jiri Ryska
QA Contact: Ben Levenson
: 159818 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-08 09:54 UTC by Mark J. Cox
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version: bzip2-1.0.2-13.FC3.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-06-17 11:33:51 UTC

Attachments (Terms of Use)

Description Mark J. Cox 2005-06-08 09:54:43 UTC
Note this is already fixed in FC4 (since FC4-re0522.0)

+++ This bug was initially created as a clone of Bug #121514 +++

Al Viro posted to vendor-sec on Apr22:

zgrep contains the following gem:

for i do
      if test $with_filename -eq 1; then
      $grep $opt "$pat" | sed "$sed_script"

Aside of the correctness issues (try to use zgrep on files with e.g.
'&' in names), it leads to obvious fun when zgrep arguments had been
obtained by globbing in an untrusted place.  Even with standard sed we
have at least ;w<filename>; to deal with; for GNU sed there's also ;e;
on top of that (execute the contents of pattern space).  bzgrep is no
better - it's based on zgrep.

AFAICS, there are two solutions - one is to do what *BSD had done and
make grep(1) use zlib and libbz; then zgrep become links to
grep.  Another is to quote \, |, ; and newlines, which means extra
invocation of sed(1)...

Comment 1 Mark J. Cox 2005-06-08 09:56:45 UTC
(actually does affect FC4, creating separate bug)

Comment 2 Jiri Ryska 2005-06-08 13:20:11 UTC
*** Bug 159818 has been marked as a duplicate of this bug. ***

Comment 3 David Eisenstein 2005-09-08 06:05:07 UTC
The fix for FC3's bzgrep is not completely correct, from what I can tell.

For details, please see bug 159816 comment #2 and bug 159816 comment #3.

I do not know if this represents a security problem or not.

Note You need to log in before you can comment on or make changes to this bug.