[pcre-dev] [Bug 1904] New: PCRE2 10.23-RC1 - Heap Buffer Ove…

Top Page
Delete this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1904] New: PCRE2 10.23-RC1 - Heap Buffer Overflow
https://bugs.exim.org/show_bug.cgi?id=1904

            Bug ID: 1904
           Summary: PCRE2 10.23-RC1 - Heap Buffer Overflow
           Product: PCRE
           Version: N/A
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: fumfi.255@???
                CC: pcre-dev@???


Created attachment 933
--> https://bugs.exim.org/attachment.cgi?id=933&action=edit
POC to trigger heap overflow (pcre2test)

PCRE2 library is prone to a vulnerability which leads to Heap Overflow.

Affected:
- PCRE2 version 10.23-RC1 2016-08-01 (SVN revision: 573)

To reproduce the problem (pcre2test):
pcre2test heap_overflow2_573 /dev/null

ASAN output:

==32003==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x611000009fe7 at pc 0x7f2cf460968d bp 0x7ffc3cf954f0 sp 0x7ffc3cf954e8
WRITE of size 1 at 0x611000009fe7 thread T0
    #0 0x7f2cf460968c in compile_branch XYZ/pcre/src/pcre2_compile.c:7239:13
    #1 0x7f2cf460968c in compile_regex XYZ/pcre/src/pcre2_compile.c:7422
    #2 0x7f2cf45f7f62 in pcre2_compile_8 XYZ/pcre/src/pcre2_compile.c:9297:7
    #3 0x4edf58 in process_pattern XYZ/pcre/src/pcre2test.c:5033:1
    #4 0x4edf58 in main XYZ/pcre/src/pcre2test.c:7739
    #5 0x7f2cf34eb82f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #6 0x41a828 in _start (/usr/local/bin/pcre2test+0x41a828)


0x611000009fe7 is located 0 bytes to the right of 231-byte region
[0x611000009f00,0x611000009fe7)
allocated by thread T0 here:
    #0 0x4b903c in __interceptor_malloc
/home/development/llvm/3.9.0/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64:3
    #1 0x4f048e in my_malloc XYZ/pcre/src/pcre2test.c:2380:15
    #2 0x7f2cf45f7716 in pcre2_compile_8 XYZ/pcre/src/pcre2_compile.c:9230:3
    #3 0x4edf58 in process_pattern XYZ/pcre/src/pcre2test.c:5033:1
    #4 0x4edf58 in main XYZ/pcre/src/pcre2test.c:7739
    #5 0x7f2cf34eb82f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)


SUMMARY: AddressSanitizer: heap-buffer-overflow
XYZ/pcre/src/pcre2_compile.c:7239:13 in compile_branch
Shadow bytes around the buggy address:
  0x0c227fff93a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff93b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff93c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff93d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff93e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c227fff93f0: 00 00 00 00 00 00 00 00 00 00 00 00[07]fa fa fa
  0x0c227fff9400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff9410: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff9420: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff9430: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff9440: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==32003==ABORTING


Regards,
Kamil Frankowicz

--
You are receiving this mail because:
You are on the CC list for the bug.