Bug 1287695 (CVE-2015-8393) - CVE-2015-8393 pcre: pcregrep -q is not always quiet (8.38/28)
Summary: CVE-2015-8393 pcre: pcregrep -q is not always quiet (8.38/28)
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2015-8393
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1287697 1287698 1287699 1287700
Blocks: 1287727
TreeView+ depends on / blocked
 
Reported: 2015-12-02 14:05 UTC by Adam Mariš
Modified: 2019-10-10 10:36 UTC (History)
17 users (show)

Fixed In Version: pcre 8.38
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-18 13:58:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Adam Mariš 2015-12-02 14:05:21 UTC
It was discovered that pcregrep in PCRE before 8.38 mishandles the -q option for binary files or when used with -c or -l options, incorrectly writing output to stdout, which might allow remote attackers to obtain sensitive information via a crafted file.

Comment 1 Adam Mariš 2015-12-02 14:06:08 UTC
Created pcre tracking bugs for this issue:

Affects: fedora-all [bug 1287697]

Comment 2 Adam Mariš 2015-12-02 14:06:16 UTC
Created glib2 tracking bugs for this issue:

Affects: fedora-all [bug 1287699]

Comment 3 Adam Mariš 2015-12-02 14:06:25 UTC
Created mingw-pcre tracking bugs for this issue:

Affects: fedora-all [bug 1287698]
Affects: epel-7 [bug 1287700]

Comment 4 Adam Mariš 2015-12-02 15:24:39 UTC
Corresponds to item 28 in http://vcs.pcre.org/pcre/code/trunk/ChangeLog?view=markup

Comment 5 Petr Pisar 2015-12-02 16:11:26 UTC
Fixed in upstream with:

commit 8dda766e48f3bd16df6d8af870e9df4551b6216d
Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date:   Wed Aug 5 17:43:19 2015 +0000

    Make pcregrep -q override -l and -c for compatibility with other greps.
    
    
    git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1586 2f5784b3-3f2a-0410-8824-
cb99058d5e15

Comment 6 Fedora Update System 2016-01-04 19:55:05 UTC
pcre-8.38-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Tomas Hoger 2016-02-18 13:47:03 UTC
(In reply to Petr Pisar from comment #5)
> Fixed in upstream with:
> 
> commit 8dda766e48f3bd16df6d8af870e9df4551b6216d
> Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
> Date:   Wed Aug 5 17:43:19 2015 +0000
> 
> Make pcregrep -q override -l and -c for compatibility with other greps.

Upstream commit link:

http://vcs.pcre.org/pcre?view=revision&revision=1586

Comment 8 Tomas Hoger 2016-02-18 13:58:23 UTC
Upstream fix corrects two problems:

- When pcregrep is run with both -q (--quiet) and one of -c (--count) and -l (--files-with-matches) it still generates output unlike other grep implementations.  As these options are conflicting, this may be considered bug, but not a security issue.

- When pcregrep is rung with -q and the file being grepped is binary, it prints a message as: "Binary file filname matches".  Reportedly, this is an information leak issue (where leaked information is the name of file being grepped).  Leak can only happen in very specific circumstances, and I don't think this is really worth calling security given the minimal impact.

This second problem was only introduced in version 8.31, when pcregrep got support for binary files:

http://vcs.pcre.org/pcre?view=revision&revision=947

This bug also does not affect various packages that embed PCRE library, as it's not in the library itself, but in the pcregrep tool.


Note You need to log in before you can comment on or make changes to this bug.