First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 242930
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Erik Wallin <erikw@sizeit.se>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 242930 depends on: Show dependency tree
Bug 242930 blocks:

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


Not eligible to see or edit group visibility for this bug.






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


Description:   Opened: 2008-10-20 19:51 0000
xpdf reads it's settings from an xpdfrc file in the current directory.

The psFile setting is evaluated in a shell and would be executed by the user
running xpdf if a document is printed.

This was discovered when trying to change the settings in /etc/xpdfrc. It
didn't work, so the bug also affects function.

# strace xpdf 2>&1 |fgrep xpdfrc
open("/home/erikw/.xpdfrc", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("xpdfrc", O_RDONLY)                = 3

Steps to reproduce (with the risk of overstating the obvious):

Alyssa P Hacker:
alyssa@mowitz ~ $ echo 'psFile "|lpr                           ;echo echo Your
account has been compromised.>>~/.bashrc; lpr"' > xpdfrc

Ben Bitdiddle:
ben@mowitz ~ $ cd ~alyssa
ben@mowitz alyssa $ xpdf somefile.pdf

<ben prints somefile>

ben@mowitz alyssa $ bash
Your account has been compromised.
<Ben panics>

The spaces after lpr are there to fool Ben. The nasty part of the command is
not visible in the Gui.

------- Comment #1 From Erik Wallin 2008-10-20 20:27:03 0000 -------
Note that if ~/.xpdfrc exists, the xpdfrc file in the current directory is not
read.

I believe the xpdfrc it tries to open from the current directory is supposed to
be the global xpdfrc, but the build process is not setting the path correctly.

Creating a ~/.xpdfrc would be a workaround for this bug.

------- Comment #2 From Erik Wallin 2008-10-21 13:13:47 0000 -------
I looked more into this last night after reporting it. I could not attach more
information until now.

From what I found so far this is a problem in both poppler and xpdf. Solving it
in poppler would solve it in xpdf as well.

The SYSTEM_XPDFRC variable is not set by the configure script in poppler. There
should be a default value, but it seems to be missing.

It looks as if this problem is in the poppler package itself, not the ebuild.

Although it could be patched, the package maintainer should be notified before
publishing anything, since other distributions would also be affected.

------- Comment #3 From Pierre-Yves Rofes 2008-12-12 23:16:24 0000 -------
(In reply to comment #2)
> I looked more into this last night after reporting it. I could not attach more
> information until now.
> 
> From what I found so far this is a problem in both poppler and xpdf. Solving it
> in poppler would solve it in xpdf as well.
> 
> The SYSTEM_XPDFRC variable is not set by the configure script in poppler. There
> should be a default value, but it seems to be missing.
> 
> It looks as if this problem is in the poppler package itself, not the ebuild.
> 
> Although it could be patched, the package maintainer should be notified before
> publishing anything, since other distributions would also be affected.

Hi Erik, thanks for your report and sorry for the delay. Did you get an answer
from upstream about it?

------- Comment #4 From Pierre-Yves Rofes 2009-03-17 21:39:28 0000 -------
Erik, did you get an answer from upstream?

------- Comment #5 From Robert Buchholz 2009-03-21 13:59:31 0000 -------
This is a Gentoo-specific vulnerability in the Xpdf ebuild. We are 
shipping a repackaged version of Xpdf [1] that links against the system 
poppler library. It has the Goo* code and original build system 
removed, and builds the Xpdf binary with a custom Makefile which does 
not set SYSTEM_XPDFRC.

Xpdf's behaviour in config.h then is to assume ".", which leads to the 
unfortunate situation that "xpdfrc" is loaded from the current working 
directory if no other configuration is specified via call arguments or 
present in the user's home directory.

[1]http://gentooexperimental.org/~genstef/dist/xpdf-3.02-poppler-20071121.tar.bz2

------- Comment #6 From Robert Buchholz 2009-03-21 14:02:31 0000 -------
This has been previously reported as bug 200023, but without mentioning the
security impact. The bug also contains an ebuild with the fix (and another
bugfix, I did not check that fix's sanity).

Peter, can you please prepare an ebuild at least fixing the -DSYSTEM_XPDFRC
situation and attach it to this bug? We will do prestable testing here.

------- Comment #7 From Robert Buchholz 2009-03-26 11:39:59 0000 -------
CVE-2009-1144 has been reserved for this Gentoo specifc issue.

------- Comment #8 From Peter Alfredsen 2009-03-29 18:48:42 0000 -------
+*xpdf-3.02-r2 (29 Mar 2009)
+
+  29 Mar 2009; Peter Alfredsen <loki_val@gentoo.org> +xpdf-3.02-r2.ebuild:
+  Bump. Fixes bug 200023. Thanks to KIMURA Masaru / hiyuh
+  <hiyuh.root@gmail.com> for the fix and Joseph <syscon780@gmail.com> for
+  the report.
+

------- Comment #9 From Robert Buchholz 2009-04-02 09:50:17 0000 -------
Arch Security Liaisons, please test and mark stable:
=app-text/xpdf-3.02-r2
Target keywords : "alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"

Note that the security impact of this bump is still considered under embargo,
so please do not reference this stabling as such. We can add the bug reference
to the ChangeLog later.

CC'ing current Liaisons:
   alpha : klausman, armin76
   amd64 : keytoaster, tester
    hppa : jer
     ppc : dertobi123
   ppc64 : corsair
   sparc : fmccor
     x86 : maekke, armin76

------- Comment #10 From Ferris McCormick 2009-04-02 11:50:41 0000 -------
Stable on sparc.

------- Comment #11 From Jeroen Roovers 2009-04-02 17:08:43 0000 -------
Stable for HPPA.

------- Comment #12 From Raúl Porcel 2009-04-02 17:17:26 0000 -------
Adding ranger, removing corsair since he's being retired or is retired already.

------- Comment #13 From Raúl Porcel 2009-04-02 17:21:06 0000 -------
alpha/arm/ia64/sh/x86 stable

------- Comment #14 From Joe Jezak 2009-04-02 18:47:36 0000 -------
Marked ppc/ppc64 stable.

------- Comment #15 From Markus Meier 2009-04-02 21:57:47 0000 -------
amd64 stable (approved by Tester)

------- Comment #16 From Robert Buchholz 2009-04-07 10:05:28 0000 -------
This is now public.

------- Comment #17 From Robert Buchholz 2009-04-07 10:06:25 0000 -------
I added this bug to the ChangeLog for easier reference in the future.

------- Comment #18 From Robert Buchholz 2009-04-07 10:18:39 0000 -------
GLSA 200904-07

------- Comment #19 From Alex Legler 2009-04-10 20:28:43 0000 -------
CVE-2009-1144 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2009-1144):
  Untrusted search path vulnerability in the Gentoo package of Xpdf
  before 3.02-r2 allows local users to gain privileges via a Trojan
  horse xpdfrc file in the current working directory, related to an
  unset SYSTEM_XPDFRC macro in a Gentoo build process that uses the
  poppler library.

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