From dev-return-53355-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Sun Jan 14 14:45:04 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 7A8DF180651 for ; Sun, 14 Jan 2018 14:45:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6A64B160C1D; Sun, 14 Jan 2018 13:45:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B0B06160C43 for ; Sun, 14 Jan 2018 14:45:03 +0100 (CET) Received: (qmail 75029 invoked by uid 500); 14 Jan 2018 13:45:02 -0000 Mailing-List: contact dev-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list dev@pdfbox.apache.org Received: (qmail 75018 invoked by uid 99); 14 Jan 2018 13:45:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jan 2018 13:45:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 53079180710 for ; Sun, 14 Jan 2018 13:45:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -107.911 X-Spam-Level: X-Spam-Status: No, score=-107.911 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id mxqNpT2Zq2iA for ; Sun, 14 Jan 2018 13:45:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id F3A925FAC9 for ; Sun, 14 Jan 2018 13:45:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 79212E05D7 for ; Sun, 14 Jan 2018 13:45:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3519A20D15 for ; Sun, 14 Jan 2018 13:45:00 +0000 (UTC) Date: Sun, 14 Jan 2018 13:45:00 +0000 (UTC) From: =?utf-8?Q?Andreas_Lehmk=C3=BChler_=28JIRA=29?= To: dev@pdfbox.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PDFBOX-4014) Malformed/pathological/malicious input can lead to infinite looping MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PDFBOX-4014?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D163= 25591#comment-16325591 ]=20 Andreas Lehmk=C3=BChler commented on PDFBOX-4014: -------------------------------------------- bq. I added a sanity check that limits the number of decoded symbol instanc= es to the total number of pixels in the image.=20 [~hennejg] Please don't forget to mention the related JIRA-ticket in the co= mmit comment to trigger the git-JIRA-integration bq. Is it possible to include the file along with a README along the lines = of That's sufficient. An ICLA is needed only for substantial additions, a simp= le sample pdf doesn't qualify for that > Malformed/pathological/malicious input can lead to infinite looping > ------------------------------------------------------------------- > > Key: PDFBOX-4014 > URL: https://issues.apache.org/jira/browse/PDFBOX-4014 > Project: PDFBox > Issue Type: Bug > Components: JBIG2 > Affects Versions: 3.0.0 JBIG2 > Reporter: J=C3=B6rg Henne > Assignee: J=C3=B6rg Henne > > [~tilman] writes > {quote} > See this issue: > https://bugs.chromium.org/p/chromium/issues/detail?id=3D450971 > look for "pdfium-loop2.pdf". > I haven't created an issue, because this could be relevant to security. > To reproduce the bug with PDFBox, do this: > PDDocument document =3D PDDocument.load(new=20 > File("pdfium-loop2.pdf")); > new PDFRenderer(document).renderImage(0); > For maven you need > > org.apache.pdfbox > pdfbox > 2.0.8 > > and of course jbig2. > {quote} > An analysis shows that two circumstances contribute to the problem: > # T.88 section E.2.10 specifies that MQ encoded data can be minimized if = trailing data contains "just boring stuff, i.e. 1-bits". Thus, an infinite = sequence of MQ encoded decisions can be encoded in a finite number of bytes= . > # T.88 section 6.4.5 3c specifies that the condition for terminating the = decoding of a text region strip is the occurrence of the OOB symbol as a sy= mbol's S coordinate. > If a JBIG2 stream contains a strip that uses #1 yielding a stream of S co= ordinates that never contain OOB during the decoding phase for #2, an infin= ite loop results, as text region decoding has no other terminating conditio= n. > The result is "just" a denial of service. No risk of buffer overruns etc.= is associated with the issue.=20 > A similar issue exists with symbol dictionary decoding. However in this c= ase decoding will not enter an infinite loop due to an array index out of b= ounds exception that is thrown once more symbols than expected have been de= coded. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org For additional commands, e-mail: dev-help@pdfbox.apache.org