Bug 1547783 (CVE-2018-6797) - CVE-2018-6797 perl: heap write overflow in regcomp.c
Summary: CVE-2018-6797 perl: heap write overflow in regcomp.c
Status: CLOSED ERRATA
Alias: CVE-2018-6797
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=moderate,public=20180414,repor...
Keywords: Security
Depends On: 1561100 1561101 1561102 1567778 1567800
Blocks: 1547784
TreeView+ depends on / blocked
 
Reported: 2018-02-21 23:03 UTC by Laura Pardo
Modified: 2019-06-11 11:13 UTC (History)
17 users (show)

(edit)
A heap buffer write overflow, with control over the bytes written, was found in the way regular expressions employing Unicode rules are compiled. An attacker, with the ability to provide a specially crafted regular expression, could crash the perl interpreter, or possibly execute arbitrary code.
Clone Of:
(edit)
Last Closed: 2019-06-08 03:40:48 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1192 None None None 2018-04-23 06:50 UTC

Description Laura Pardo 2018-02-21 23:03:07 UTC
A flaw was found in Perl 5. A heap write overflow in regcomp.c file might be exploited when a perl program allows user input of patterns.  A crafted regular expression can cause the heap buffer overflow, with control over the bytes written.

Comment 1 Petr Pisar 2018-02-26 09:11:20 UTC
Reproducer:

$ perl -e 'qr/0b\N{U+41}\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF\xDF/i'
realloc(): invalid next size
Aborted (core dumped)

Comment 3 Petr Pisar 2018-03-26 10:38:51 UTC
(In reply to Petr Pisar from comment #2)
> Perl 5 Porters published the fix for Perl 5.26.1 at:
> 
> <https://perl5.git.perl.org/perl.git/commit/
> 8e6f44c90c7fa1f63c19a44c45482b09a407e15b>
> <https://perl5.git.perl.org/perl.git/commit/
> fa889a389ebb8e63782a3697775aa42c63a8f0cd>
> <https://perl5.git.perl.org/perl.git/commit/
> 8b80ce67ff257aaa36e47eaf4194d27a51595524>
> <https://perl5.git.perl.org/perl.git/commit/
> ae187cb6c87b079045274f298fdcf426e4a6404b>
> 
> and in Perl-5.26.2-RC1 and 5.24.4-RC1 tar balls.

Sorry. These four patches were for CVE-2018-6798.

Perl 5 Porters published the CVE-2018-6797 fix for Perl 5.26.1 at https://perl5.git.perl.org/perl.git/commit/abe1e6c568b96bcb382dfa4f61c56d1ab001ea51 and in Perl-5.26.2-RC1 and 5.24.4-RC1 tar balls.

Comment 7 Cedric Buissart 🐶 2018-04-16 08:07:13 UTC
Created perl tracking bugs for this issue:

Affects: fedora-all [bug 1567778]

Comment 9 Cedric Buissart 🐶 2018-04-16 11:26:57 UTC
Statement:

Versions of the perl interpreter older than 5.18 are not vulnerable. As a result, the versions of perl as shipped in Red Hat Enterprise Linux version 7, 6 and 5 are not affected by this vulnerability.

Comment 10 Cedric Buissart 🐶 2018-04-16 11:27:07 UTC
External References:

https://rt.perl.org/Public/Bug/Display.html?id=132227

Comment 14 Cedric Buissart 🐶 2018-04-18 14:32:31 UTC
Acknowledgments:

Name: Perl 5 Porters
Upstream: Brian Carpenter

Comment 15 errata-xmlrpc 2018-04-23 06:50:46 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS

Via RHSA-2018:1192 https://access.redhat.com/errata/RHSA-2018:1192


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