Bug 852368 - (CVE-2013-6402) VUL-0: CVE-2013-6402: hplip: arbitrary file creation/overwrite (via hardcoded file name /tmp/hp-pkservice.log)
(CVE-2013-6402)
VUL-0: CVE-2013-6402: hplip: arbitrary file creation/overwrite (via hardcoded...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P2 - High : Normal
: ---
Assigned To: Security Team bot
Security Team bot
maint:running:54850:moderate maint:ru...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-26 13:09 UTC by Sebastian Krahmer
Modified: 2019-05-01 16:07 UTC (History)
8 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Krahmer 2013-11-26 13:09:32 UTC
hplip once again creates logfiles in /tmp, which allows
local users to create/overwrite arbitrary files.


Thats here in base/pkit.py

    class BackendService(PolicyKitService):
        INTERFACE_NAME = 'com.hp.hplip'
        SERVICE_NAME   = 'com.hp.hplip'
        LOGFILE_NAME   = '/tmp/hp-pkservice.log'
[...]

Best fix would be for hplip to use the standard syslog facility,
relying on syslogd, rather than creating logfiles in /tmp.
Comment 1 Johannes Meixner 2013-11-26 15:05:44 UTC
Sebastian Krahmer,
do you get a new CVE number for this new issue?

For the log:
This was the previous issue regarding /tmp files:
bnc#808355 - VUL-1: CVE-2013-0200: hplip*: local file overwrite via /tmp files
Comment 2 Sebastian Krahmer 2013-11-26 15:14:16 UTC
I think we will. Either via upstream or vis oss-sec. I'll just mail
upstream about this, so they can fix.
Comment 3 Sebastian Krahmer 2013-11-27 12:08:39 UTC
Public, as via

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725876
Comment 4 Marcus Meissner 2013-12-02 12:47:11 UTC
ping?
Comment 5 Sebastian Krahmer 2013-12-09 10:27:08 UTC
Was reported upstream by me, we are waiting for them.
Comment 7 Sebastian Krahmer 2014-01-06 09:02:44 UTC
Seems to got CVE-2013-6402 meanwhile.

Reported on Date: Thu, 5 Dec 2013 to HP developers, taking
our sec-team members and maintainer in Cc.

As there are a lot of queued hplip issues, I dont know
how to handle it. I agree with Johannes that we cannot make
hplip updates every week.

Check https://bugzilla.novell.com/show_bug.cgi?id=853405
Comment 8 Florian Hubold 2014-01-06 09:46:15 UTC
(In reply to comment #7)
> 
> Check https://bugzilla.novell.com/show_bug.cgi?id=853405

Well, that's pretty easy to fix, do as Fedora or as we (Mageia) did and remove all of the upgrader, binary and .py files as it should never be run when using distro packages.

But I get your point about the overall hplip situation, totally comprehensible.


FWIW, here's a fix in the meantime for this CVE:
https://bugs.mageia.org/attachment.cgi?id=4714&action=diff

But just did a quick scan for similiar issues (grep -Ri for logfile and log_file) and at least this shows up:

./prnt/hpijs/foomatic-rip-hplip:my $logfile = "/tmp/foomatic-rip";
Comment 9 Johannes Meixner 2014-01-07 13:57:10 UTC
I added the HPLIP upstream developer Amarnath Chitumalla
to the CC list of this bug to keep HPLIP upstream directly informed.

Florian Hubold,
FYI regarding "foomatic-rip-hplip" in your comment#8:
Fortunately we (i.e. openSUSE) do no longer distribute this file
since some time because - guess what! - one more security issue
(inherited from foomatic-rip), see our hplip RPM changelog file at
https://build.opensuse.org/package/view_file/Printing/hplip/hplip.changes?expand=1
that reads in particular:
--------------------------------------------------------------------
Fri Aug 12 10:36:13 CEST 2011 - jsmeix@suse.de
...
- Because foomatic-rip-hplip has CVE-2011-2697 (bnc#698451)
  plus a leftover in CVE-2004-0801 (bnc#59233)
  foomatic-rip-hplip is no longer installed and foomatic-rip
  from the foomatic-filters RPM is used instead and the
  "cupsFilter" entries in the PPDs are changed accordingly.
  To be backward compatible with PPDs in /etc/cups/ppd/
  for existing print queues a compatibility link
  /usr/lib/cups/filter/foomatic-rip-hplip
  which points to foomatic-rip is installed.
--------------------------------------------------------------------
Comment 10 Sebastian Krahmer 2014-01-13 14:38:06 UTC
Johannes, I would vote for a solution like in comment#8:

"move all of the upgrader, binary and .py files as it should never be run when using distro packages."

So we can get rid of code that violates our policy anyways,
like autoupdating by dling a tarball etc.
Comment 11 Florian Hubold 2014-01-13 22:08:11 UTC
(In reply to comment #10)
> Johannes, I would vote for a solution like in comment#8:
> 
> "move all of the upgrader, binary and .py files as it should never be run when
> using distro packages."
> 
> So we can get rid of code that violates our policy anyways,
> like autoupdating by dling a tarball etc.

FWIW you missed two letters - but you can also move the files to /dev/null :p

That's what we do:

http://svnweb.mageia.org/packages/cauldron/hplip/current/SPECS/hplip.spec?view=markup

460 	# remove all upgrade-dialog files, also related to CVE-2013-6427
461 	# previously we only removed the upgrade binary, but missed some upgrade dialog files
462 	rm -f %{buildroot}%{_datadir}/hplip/upgrade*
463 	rm -f %{buildroot}%{_bindir}/hp-upgrade
Comment 12 Johannes Meixner 2014-01-14 09:52:34 UTC
Florian Hubold,
isn't your above comment#11 actually meant for bnc#853405
because that one is about hp-upgrade?

Sebastian Krahmer,
regarding the issue in this bug here I also think a patch as in
https://bugs.mageia.org/attachment.cgi?id=4714&action=diff
would be the right solution here.
I will do it when time permits, compare
https://bugzilla.novell.com/show_bug.cgi?id=853405#c5
https://bugzilla.novell.com/show_bug.cgi?id=853405#c17

From my point of view for me it is currently more important
to get the currently somewhat broken printing stuff
in openSUSE:Factory working again.

From my point of view I would like to care first and foremost
about to keep the base printing stuff working in general.

But when management decides, I could leave the base printing stuff
somewhat broken in openSUSE:Factory and work first and foremost
on this HPLIP security issue.
Comment 13 Johannes Meixner 2014-01-14 09:54:42 UTC
Or should I work first and foremost on bnc#858462?
Comment 14 Johannes Meixner 2014-01-14 09:56:52 UTC
Or is bnc#857372 of topmost importance?
Comment 15 Johannes Meixner 2014-01-14 11:35:14 UTC
I am working on bnc#857372 now (also P3 but I think CUPS is more
important than HPLIP so that this bug here must wait).
Comment 16 Johannes Meixner 2014-01-14 15:20:47 UTC
I am working on this one now (together with bnc#853405).
Comment 17 Johannes Meixner 2014-01-15 11:16:40 UTC
Submitted as maintenancerequest 213968

The issue is now fixed.

I re-assign it to the Bugzilla default assignee for further processing.
Comment 18 Bernhard Wiedemann 2014-01-15 12:00:10 UTC
This is an autogenerated message for OBS integration:
This bug (852368) was mentioned in
https://build.opensuse.org/request/show/213968 13.1+12.2+12.3 / hplip
Comment 29 Swamp Workflow Management 2014-01-24 20:04:49 UTC
openSUSE-SU-2014:0127-1: An update that fixes two vulnerabilities is now available.

Category: security (moderate)
Bug References: 852368,853405
CVE References: CVE-2013-6402,CVE-2013-6427
Sources used:
openSUSE 13.1 (src):    hplip-3.13.10-4.2
openSUSE 12.3 (src):    hplip-3.12.11-2.9.2
openSUSE 12.2 (src):    hplip-3.12.4-3.10.1
Comment 30 Swamp Workflow Management 2014-01-28 14:05:00 UTC
openSUSE-SU-2014:0146-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 852368
CVE References: CVE-2013-6402
Sources used:
openSUSE 11.4 (src):    hplip-3.11.5-1.19.1
Comment 32 Swamp Workflow Management 2014-02-03 16:56:11 UTC
Update released for: hplip, hplip-debuginfo, hplip-debugsource, hplip-hpijs
Products:
SLE-DEBUGINFO 11-SP2 (i386, ia64, ppc64, s390x, x86_64)
SLE-DESKTOP 11-SP2 (i386, x86_64)
SLE-SERVER 11-SP2 (i386, ia64, ppc64, s390x, x86_64)
SLES4VMWARE 11-SP2 (i386, x86_64)
Comment 33 Swamp Workflow Management 2014-02-03 20:04:52 UTC
SUSE-SU-2014:0188-1: An update that solves three vulnerabilities and has one errata is now available.

Category: security (moderate)
Bug References: 808355,835827,836937,852368
CVE References: CVE-2013-0200,CVE-2013-4325,CVE-2013-6402
Sources used:
SUSE Linux Enterprise Server 11 SP2 for VMware (src):    hplip-3.11.10-0.6.11.1
SUSE Linux Enterprise Server 11 SP2 (src):    hplip-3.11.10-0.6.11.1
SUSE Linux Enterprise Desktop 11 SP2 (src):    hplip-3.11.10-0.6.11.1
Comment 34 Swamp Workflow Management 2014-02-06 20:05:02 UTC
SUSE-SU-2014:0188-2: An update that solves three vulnerabilities and has one errata is now available.

Category: security (moderate)
Bug References: 808355,835827,836937,852368
CVE References: CVE-2013-0200,CVE-2013-4325,CVE-2013-6402
Sources used:
SUSE Linux Enterprise Server 11 SP3 for VMware (src):    hplip-3.11.10-0.6.11.1
SUSE Linux Enterprise Server 11 SP3 (src):    hplip-3.11.10-0.6.11.1
SUSE Linux Enterprise Desktop 11 SP3 (src):    hplip-3.11.10-0.6.11.1
Comment 35 Marcus Meissner 2014-02-13 15:28:24 UTC
polkit not in sle10, so this code is not active there I think
Comment 36 SMASH SMASH 2014-02-20 09:20:14 UTC
Affected packages:

SLE-11-SP3: hplip
SLE-10-SP3-TERADATA: hplip
SLE-11-SP2: hplip