First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 77408
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Sune Kloppenborg Jeppesen <jaervosz@gentoo.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
CAN-2004-1184.patch CAN-2004-1184.patch patch Sune Kloppenborg Jeppesen 2005-01-10 13:15 0000 4.53 KB Details | Diff
CAN-2004-1185.patch CAN-2004-1185.patch patch Sune Kloppenborg Jeppesen 2005-01-10 13:16 0000 1.46 KB Details | Diff
CAN-2004-1186.patch CAN-2004-1186.patch patch Sune Kloppenborg Jeppesen 2005-01-10 13:17 0000 1.74 KB Details | Diff
enscript-1.6.3-security.patch enscript-1.6.3-security.patch patch Thierry Carrez (RETIRED) 2005-01-15 12:56 0000 5.90 KB Details | Diff
enscript-1.6.3-r2.ebuild enscript-1.6.3-r2.ebuild text/plain solar 2005-01-15 13:27 0000 925 bytes Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 77408 depends on: Show dependency tree
Show dependency graph
Bug 77408 blocks:

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-01-10 13:09 0000
Erik Sj

------- Comment #1 From Sune Kloppenborg Jeppesen 2005-01-10 13:09:58 0000 -------
Erik Sjölund has discovered several security relevant problems in
enscript, a program to converts ASCII text to Postscript and other
formats.  The Common Vulnerabilities and Exposures project identifies
the following vulnerabilities:

CAN-2004-1184

    Unsanitised input can caues the execution of arbitrary commands
    via EPSF pipe support.  This has been disabled, also upstream.

CAN-2004-1185

    Due to missing sanitising of filenames it is possible that a
    specially crafted filename can cause arbitrary commands to be
    executed.

CAN-2004-1186

    Multiple buffer overflows can cause the program to crash.

------- Comment #2 From Sune Kloppenborg Jeppesen 2005-01-10 13:15:57 0000 -------
Created an attachment (id=48126) [edit]
CAN-2004-1184.patch

------- Comment #3 From Sune Kloppenborg Jeppesen 2005-01-10 13:16:40 0000 -------
Created an attachment (id=48127) [edit]
CAN-2004-1185.patch

------- Comment #4 From Sune Kloppenborg Jeppesen 2005-01-10 13:17:11 0000 -------
Created an attachment (id=48128) [edit]
CAN-2004-1186.patch

------- Comment #5 From Thierry Carrez (RETIRED) 2005-01-15 12:56:41 0000 -------
Created an attachment (id=48574) [edit]
enscript.patch

Compound patch without Debian-specific things in.

------- Comment #6 From Thierry Carrez (RETIRED) 2005-01-15 12:59:30 0000 -------
This has no maintainers.
I cleaned the patch and checked it, looks ok. We should apply it and attach ebuild here so that we can call arch testing on it. Solar, would you do this ?

------- Comment #7 From solar 2005-01-15 13:24:11 0000 -------
(From update of attachment 48574 [edit])
rename patch

------- Comment #8 From solar 2005-01-15 13:27:38 0000 -------
Created an attachment (id=48577) [edit]
enscript-1.6.3-r2.ebuild

requested ebuild. compile testing on x86

------- Comment #9 From Sune Kloppenborg Jeppesen 2005-01-21 06:17:23 0000 -------
Solar please commit, open bug and call arches.

------- Comment #10 From solar 2005-01-21 06:33:11 0000 -------
enscript-1.6.3-r2.ebuild (attachment #8574 [edit] and attachment #48577 [edit]) added to the
tree.

KEYWORDS="~x86 ~ppc ~sparc ~amd64 ~alpha ~mips ~ppc64"

Arch maintainers please test and mark stable (gpg sign your Manifest's please)

q/a: this package lacks a proper metadata.xml 
Note: mips never had any version marked as stable.

------- Comment #11 From Sune Kloppenborg Jeppesen 2005-01-21 09:05:28 0000 -------
Back to ebuild status, patch needs to be redone. Sorry for the trouble.

Note to solar:

>        /* Read more data. */
> -      is->data_in_buf = fread (is->buf, 1, sizeof (is->buf), is->fp);
> +      memset (is->buf, 0, sizeof (is->buf));
> +      is->data_in_buf = fread (is->buf, 1, sizeof (is->buf)-1, is->fp);

------- Comment #12 From Sune Kloppenborg Jeppesen 2005-01-22 06:52:38 0000 -------
Koon please check the patch and call arches. 1.6.3-r2 has the fix already.

------- Comment #13 From solar 2005-01-22 08:09:27 0000 -------
The comments on the upstream thread are unclear to me. The very end of
the existing patch contains those lines already.

Looking at deb http://www.debian.org/security/2005/dsa-654
in src/util.c the deb patches don't even seem to touch the function int is_getc (InputStream *is)
http://security.debian.org/pool/updates/main/e/enscript/enscript_1.6.3-1.3.diff.gz
debs patch other bug fixes and enhancements but it also includes
<paper.h> in main.c and thus fails to compile when I swap it out for our
existing patch.

------- Comment #14 From Thierry Carrez (RETIRED) 2005-01-23 11:09:23 0000 -------
Martin Schulze seems to think we require this additional patch :

--- enscript-1.6.3/src/util.c.old       2005-01-23 20:06:54.046729208 +0100
+++ enscript-1.6.3/src/util.c   2005-01-23 20:07:34.396193016 +0100
@@ -1998,7 +1998,7 @@
   if (is->bufpos >= is->data_in_buf)
     {
       /* At the EOF? */
-      if (is->nreads > 0 && is->data_in_buf < sizeof (is->buf))
+      if (is->nreads > 0 && is->data_in_buf < (sizeof (is->buf)-1))
        /* Yes. */
        return EOF;

The idea is that we must use "sizeof (is->buf)" at both locations or "sizeof (is->buf)-1" at both locations.

------- Comment #15 From Thierry Carrez (RETIRED) 2005-01-25 05:05:18 0000 -------
OK, here is the story :

Debian committed the same patch we have first, but it broke things. You can see the original patch at http://security.debian.org/pool/updates/main/e/enscript/enscript_1.6.3-1.2.diff.gz

They identified the problem as coming from this part of the patch :

@@ -1996,7 +2003,8 @@
      return EOF;
       /* Read more data. */
-      is->data_in_buf = fread (is->buf, 1, sizeof (is->buf), is->fp);
+      memset (is->buf, 0, sizeof (is->buf));
+      is->data_in_buf = fread (is->buf, 1, sizeof (is->buf)-1, is->fp);
       is->bufpos = 0;
       is->nreads++;

The problem is that the use of sizeof must to be consistent with the logic a few lines above. So two solutions :

Solution (1): Drop this part of our patch
This is the solution Debian chose, and that's why it doesn't show up in their patch. "diff enscript_1.6.3-1.2.diff enscript_1.6.3-1.3.diff" proves this.

Solution (2): Change the logic a few lines above
This is the solution we could use, by applying the extra patch at comment #13.

I am not sure what is best, but leaving it the way it is is clearly broken.

------- Comment #16 From Sune Kloppenborg Jeppesen 2005-01-27 04:18:48 0000 -------
Solar please advise.

------- Comment #17 From solar 2005-01-27 07:54:54 0000 -------
I'm opting for solution #1
testing now then will commit as -r3 while planning to remove -r2

------- Comment #18 From solar 2005-01-27 07:59:24 0000 -------
Updated InCVS

enscript-1.6.3-r3.ebuild
KEYWORDS="~x86 ~ppc ~sparc ~amd64 ~alpha ~mips ~ppc64"

------- Comment #19 From Thierry Carrez (RETIRED) 2005-01-27 08:17:52 0000 -------
Arches, please test and mark enscript-1.6.3-r3 stable

------- Comment #20 From Markus Rothe 2005-01-27 10:58:30 0000 -------
stable on ppc64

------- Comment #21 From Jason Wever (RETIRED) 2005-01-27 18:08:04 0000 -------
sparc'd

------- Comment #22 From Danny van Dyk (RETIRED) 2005-01-28 13:12:10 0000 -------
stable on amd64.

------- Comment #23 From Michael Hanselmann (hansmi) (RETIRED) 2005-01-28 13:42:02 0000 -------
Stable on ppc.

------- Comment #24 From Bryan Østergaard (RETIRED) 2005-01-30 11:26:13 0000 -------
Stable on alpha.

------- Comment #25 From Lance Albertson 2005-02-01 08:12:11 0000 -------
btw, installed the patched version on x86, seems to be working well. Feel free
to bump. (Busy at work or I would)

------- Comment #26 From solar 2005-02-01 08:58:23 0000 -------
stable on x86.. Only ~mips remains before older ebuilds can be flushed

------- Comment #27 From Thierry Carrez (RETIRED) 2005-02-01 09:05:23 0000 -------
GLSA drafted

------- Comment #28 From Thierry Carrez (RETIRED) 2005-02-02 05:09:04 0000 -------
GLSA 200502-03

First Last Prev Next    No search results available      Search page      Enter new bug