libpodofo: CVE-2017-5852 - Infinite loop in PoDoFo::PdfPage::GetInheritedKeyFromObject

Debian Bug report logs - #854600
libpodofo: CVE-2017-5852 - Infinite loop in PoDoFo::PdfPage::GetInheritedKeyFromObject

version graph

Reported by: Guido Günther <agx@sigxcpu.org>

Date: Sat, 4 Feb 2017 10:51:02 UTC

Severity: important

Tags: fixed-upstream, security, upstream

Fixed in versions 0.9.0-1.1+deb7u1, libpodofo/0.9.5-7

Done: Mattia Rizzolo <mattia@debian.org>

Bug is archived. No further changes may be made.

Forwarded to https://sourceforge.net/p/podofo/mailman/podofo-users/thread/12497325.VLNgGImML2%40blackgate/#msg35640936

Outlook: https://blogs.gentoo.org/ago/2017/02/01/podofo-infinite-loop-in-podofopdfpagegetinheritedkeyfromobject-pdfpage-cpp/

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Mattia Rizzolo <mattia@debian.org>:
Bug#854118; Package libpodofo. (Sat, 04 Feb 2017 10:51:04 GMT) (full text, mbox, link).


Acknowledgement sent to Guido Günther <agx@sigxcpu.org>:
New Bug report received and forwarded. Copy sent to Mattia Rizzolo <mattia@debian.org>. (Sat, 04 Feb 2017 10:51:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Guido Günther <agx@sigxcpu.org>
To: submit@bugs.debian.org
Subject: Multiple issues in libpodofo
Date: Sat, 4 Feb 2017 11:47:04 +0100
Package: libpodofo
Severity: serious
Tags: security

Hi,

the following vulnerabilities were published for libpodofo.

CVE-2015-8981[0]:
Heap overflow in the function ReadXRefSubsection

CVE-2017-5852[1]:
Infinite loop in PoDoFo::PdfPage::GetInheritedKeyFromObject

CVE-2017-5853[2]:
Signed integer overflow in PdfParser.cpp

CVE-2017-5854[3]:
NULL pointer dereference in PdfOutputStream.cpp

CVE-2017-5855[4]:
NULL pointer dereference in PoDoFo::PdfParser::ReadXRefSubsection

If you fix the vulnerabilities please also make sure to include the
CVE (Common Vulnerabilities & Exposures) ids in your changelog entry.

For further information see:

[0] https://security-tracker.debian.org/tracker/CVE-2015-8981
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8981
[1] https://security-tracker.debian.org/tracker/CVE-2017-5852
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5852
[2] https://security-tracker.debian.org/tracker/CVE-2017-5853
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5853
[3] https://security-tracker.debian.org/tracker/CVE-2017-5854
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5854
[4] https://security-tracker.debian.org/tracker/CVE-2017-5855
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5855
Please adjust the affected versions in the BTS as needed.




Set Bug forwarded-to-address to 'https://sourceforge.net/p/podofo/mailman/podofo-users/thread/20170204121312.lq26ge6osbiuwnjo%40mapreri.org/#msg35646469'. Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Sat, 04 Feb 2017 14:06:07 GMT) (full text, mbox, link).


Severity set to 'important' from 'serious' Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Wed, 08 Feb 2017 16:21:10 GMT) (full text, mbox, link).


Added tag(s) upstream. Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Wed, 08 Feb 2017 16:21:11 GMT) (full text, mbox, link).


Bug 854118 cloned as bugs 854599, 854600, 854601, 854602, 854603, 854604, 854605 Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Wed, 08 Feb 2017 16:21:11 GMT) (full text, mbox, link).


Changed Bug title to 'libpodofo: CVE-2017-5852 - Infinite loop in PoDoFo::PdfPage::GetInheritedKeyFromObject' from 'Multiple issues in libpodofo'. Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Wed, 08 Feb 2017 16:21:13 GMT) (full text, mbox, link).


Changed Bug forwarded-to-address to 'https://sourceforge.net/p/podofo/mailman/podofo-users/thread/12497325.VLNgGImML2%40blackgate/#msg35640936' from 'https://sourceforge.net/p/podofo/mailman/podofo-users/thread/20170204121312.lq26ge6osbiuwnjo%40mapreri.org/#msg35646469'. Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Wed, 08 Feb 2017 16:21:21 GMT) (full text, mbox, link).


Outlook recorded from message bug 854600 message Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Wed, 08 Feb 2017 16:21:22 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#854600; Package libpodofo. (Fri, 07 Apr 2017 19:03:06 GMT) (full text, mbox, link).


Message #22 received at 854600@bugs.debian.org (full text, mbox, reply):

From: Mattia Rizzolo <mattia@debian.org>
To: 854600@bugs.debian.org
Subject: #854600: CVE-2017-5852: fixed upstream
Date: Fri, 7 Apr 2017 20:58:52 +0200
[Message part 1 (text/plain, inline)]
Control: tag -1 fixed-upstream

https://sourceforge.net/p/podofo/code/1835

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
[signature.asc (application/pgp-signature, inline)]

Added tag(s) fixed-upstream. Request was from Mattia Rizzolo <mattia@debian.org> to 854600-submit@bugs.debian.org. (Fri, 07 Apr 2017 19:03:06 GMT) (full text, mbox, link).


Marked as fixed in versions 0.9.0-1.1+deb7u1. Request was from Mattia Rizzolo <mattia@debian.org> to control@bugs.debian.org. (Sun, 30 Apr 2017 18:57:11 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#854600; Package libpodofo. (Wed, 03 May 2017 09:24:05 GMT) (full text, mbox, link).


Acknowledgement sent to Mattia Rizzolo <mattia@debian.org>:
Extra info received and forwarded to list. (Wed, 03 May 2017 09:24:05 GMT) (full text, mbox, link).


Message #31 received at 854600@bugs.debian.org (full text, mbox, reply):

From: Mattia Rizzolo <mattia@debian.org>
To: Markus Koschany <apo@debian.org>
Cc: debian-lts@lists.debian.org
Subject: Re: Accepted libpodofo 0.9.0-1.1+deb7u1 (source amd64) into oldstable
Date: Wed, 3 May 2017 11:11:10 +0200
[Message part 1 (text/plain, inline)]
Here is why:

On Sun, Apr 30, Mattia Rizzolo:
> On Sun, Apr 30, 2017 at 01:40:13AM +0200, Markus Koschany wrote:
> > Am 29.04.2017 um 23:50 schrieb Mattia Rizzolo:
> > > Hi Markus.
> > > 
> > > Thank you for the upload!
> > > 
> > > Although, I'd have liked if you sent me a debdiff before uploading it,
> > > if nothing else becase I am planning to do an upload to unstable fixing
> > > a first round a CVEs, and I would have liked to do something similar for
> > > all the suites...
> > 
> > You're welcome. When I saw that nobody worked on libpodofo in Wheezy,
> > even some CVEs got marked as no-dsa, I decided to step up and fix what
> > could be reasonably fixed in time. I forgot that you would have
> > preferred to look over the changes, sorry about that, I will remember
> > that for the next time.
> 
> Anyhow, upstream has no consideration for ABI stability (feels like they
> taking breaking ABI every single new release as a feature…) so every
> cherry pick from upstream has to be checked in this regard (all the
> commits till now are fine, IIRC).

QED.

You LTS upload broke libpodofo ABI.  The symbol
_ZNK6PoDoFo7PdfPage25GetInheritedKeyFromObjectEPKcPKNS_9PdfObjectE@Base
as present in the wheezy version (libpodofo0.9.0_0.9.0-1.1+b1_amd64.deb)
became
_ZNK6PoDoFo7PdfPage25GetInheritedKeyFromObjectEPKcPKNS_9PdfObjectEi@Base
in wheezy-security (libpodofo0.9.0_0.9.0-1.1+deb7u1_amd64.deb).

Now, I do not know what's LTS policy about silent ABI breakage, but I
doubt you are OK with that.


That's in particular caused by
https://anonscm.debian.org/git/collab-maint/libpodofo.git/tree/debian/patches/CVE-2017-5852.patch?h=debian/0.9.0-1.1%2bdeb7u1#n123

-    const PdfObject* GetInheritedKeyFromObject( const char* inKey, const PdfObject* inObject ) const; 
+    const PdfObject* GetInheritedKeyFromObject( const char* inKey, const PdfObject* inObject, int depth = 0 ) const;


ATM, I don't know how to fix that CVE without breaking the ABI.

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
[signature.asc (application/pgp-signature, inline)]

Message sent on to Guido Günther <agx@sigxcpu.org>:
Bug#854600. (Sun, 12 Nov 2017 15:03:09 GMT) (full text, mbox, link).


Message #34 received at 854600-submitter@bugs.debian.org (full text, mbox, reply):

From: Mattia Rizzolo <mattia@debian.org>
To: 854600-submitter@bugs.debian.org
Subject: Bug#854600 in libpodofo marked as pending
Date: Sun, 12 Nov 2017 14:59:08 +0000
Control: tag 854600 pending

Hello,

Bug #854600 in libpodofo reported by you has been fixed in the Git repository. You can
see the commit message below, and you can check the diff of the fix at:

    https://anonscm.debian.org/git/collab-maint/libpodofo.git/commit/?id=ccf111f

(this message was generated automatically based on the git commit message)
---
commit ccf111f1eb65b99780f6010d7791ee2704af7a86
Author: Mattia Rizzolo <mattia@debian.org>
Date:   Sun Nov 12 15:28:43 2017 +0100

    Add upstream patch for CVE-2017-5852
    
    Closes: #854600
    Signed-off-by: Mattia Rizzolo <mattia@debian.org>



Added tag(s) pending. Request was from Mattia Rizzolo <mattia@debian.org> to 854600-submitter@bugs.debian.org. (Sun, 12 Nov 2017 15:03:09 GMT) (full text, mbox, link).


Reply sent to Mattia Rizzolo <mattia@debian.org>:
You have taken responsibility. (Sun, 12 Nov 2017 15:24:04 GMT) (full text, mbox, link).


Notification sent to Guido Günther <agx@sigxcpu.org>:
Bug acknowledged by developer. (Sun, 12 Nov 2017 15:24:04 GMT) (full text, mbox, link).


Message #41 received at 854600-close@bugs.debian.org (full text, mbox, reply):

From: Mattia Rizzolo <mattia@debian.org>
To: 854600-close@bugs.debian.org
Subject: Bug#854600: fixed in libpodofo 0.9.5-7
Date: Sun, 12 Nov 2017 15:20:28 +0000
Source: libpodofo
Source-Version: 0.9.5-7

We believe that the bug you reported is fixed in the latest version of
libpodofo, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 854600@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mattia Rizzolo <mattia@debian.org> (supplier of updated libpodofo package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 12 Nov 2017 15:36:06 +0100
Source: libpodofo
Binary: libpodofo-dev libpodofo-utils libpodofo0.9.5
Architecture: source
Version: 0.9.5-7
Distribution: unstable
Urgency: medium
Maintainer: Mattia Rizzolo <mattia@debian.org>
Changed-By: Mattia Rizzolo <mattia@debian.org>
Description:
 libpodofo-dev - PoDoFo development files
 libpodofo-utils - PoDoFo utilities
 libpodofo0.9.5 - PoDoFo - library to work with the PDF file format
Closes: 854600 860930 861738
Changes:
 libpodofo (0.9.5-7) unstable; urgency=medium
 .
   * Add upstream patches for security issues:
     + CVE-2017-5852 Closes: #854600
     + CVE-2017-7994 Closes: #860930
     + CVE-2017-8787 Closes: #861738
   * debian/control:
     + Bump Standards-Version to 4.1.1:
       - Move from priority extra (deprecated) to optional.
     + Declare that libpodofo can be built without root: R³:no.
Checksums-Sha1:
 583cea79dc889f439569e0c5b580afef4a2a3e03 2158 libpodofo_0.9.5-7.dsc
 ecfbf316c83bc70b2a6de8b5a2b9c3c0fed828a8 17076 libpodofo_0.9.5-7.debian.tar.xz
 7ed86d8d0650640844bafbbe9fcb4beebd13f981 8380 libpodofo_0.9.5-7_amd64.buildinfo
Checksums-Sha256:
 689ae5801f0c7b82ec21a59fdc325e8a13d940c614bd8dba54712a21887049db 2158 libpodofo_0.9.5-7.dsc
 1dde26ea68feeed2e69cda73ba3800d9a40f83b49a00fcff50ffca3f773cd96c 17076 libpodofo_0.9.5-7.debian.tar.xz
 68dd7097b2153a8ebd55866d2ce4fea18965e9957bd7e9fd6fdad1c6fc4f7f35 8380 libpodofo_0.9.5-7_amd64.buildinfo
Files:
 f3fdfe4f86a218e800533f533def1408 2158 libdevel optional libpodofo_0.9.5-7.dsc
 963699ed102d44b6d543eba193f619bf 17076 libdevel optional libpodofo_0.9.5-7.debian.tar.xz
 fa884094c9a4f5614675a1e25977abc0 8380 libdevel optional libpodofo_0.9.5-7_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEi3hoeGwz5cZMTQpICBa54Yx2K60FAloIYXoACgkQCBa54Yx2
K604Qg//c2NDfAuE+OkbipkrgWNKyodI1BPkcrrrt2JnUXGaVK4MVNWZU7xUliED
SLAxRjz15JWLL4d59ZMWWuqWygLk2dNHsBgnuNmTQSA+pUkZTKSRgieBbC/NdFzU
DgjXp1gX75za7h9JzvtvMsbpmMpnqpgrBbIIrCyKB4lM1plr/67TQ1IG2TyilnuJ
rHEcfp0ePWvY5xAgtu+c2c9Nn6WiqZsJbb2zgeD/ZvmMymLfVZelC8q2cZEWSnAi
vnkM9KrWlM8a1t4PFhQqzp86MKAebpGsrp5pqDnJ8U+7zKYP6ZqVR/Lr7f4HlqhC
P7kC7lBUiIrIOhJIVPWKWseejBNKIvV2k+y1vWR7hanZiRICsAaXgSM+TkiTa6B0
LZndIxAk1zLqytmshNt4t3djxfhX375ACUjfz5/vf3HRf0BXFNC3yhrdWoklxY+B
eRKructXQnWnFDO2xKQIUWodORnemBSZTci9eOrpoZvb8iMci+SMC2xPAKwbn/pJ
FnzgLcf0q1aBo4ZpSlBG5JZPeC1ItAFQF6Xz4nuK73WcLrLQVFnJAqBDXwksOCiZ
fGN/9UpXJkknDkNiUjppid0ARjYCwM9/q+5JIbfaJ4rvkHuA+BlYDX1Z5qS8qKvk
YD2gChCmuhwsEyZLC0A7isjt4T9orEQpeRX0X/25SnsdnJHuc3c=
=XbaS
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 16 Dec 2017 07:24:54 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Jun 19 17:29:37 2019; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.