[pcre-dev] [Bug 1992] New: PCRE2 10.23-RC1 - Heap out of bou…

Startseite
Nachricht löschen
Autor: admin
Datum:  
To: pcre-dev
Betreff: [pcre-dev] [Bug 1992] New: PCRE2 10.23-RC1 - Heap out of bounds read in pcre2_substitute_8()
https://bugs.exim.org/show_bug.cgi?id=1992

            Bug ID: 1992
           Summary: PCRE2 10.23-RC1 - Heap out of bounds read in
                    pcre2_substitute_8()
           Product: PCRE
           Version: N/A
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: fumfi.255@???
                CC: pcre-dev@???


Created attachment 956
--> https://bugs.exim.org/attachment.cgi?id=956&action=edit
POC to trigger heap out of bounds read (pcre2test)

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

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

ASAN output:

==1253==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x629000009200
at pc 0x0000004a1e97 bp 0x7ffe333151b0 sp 0x7ffe33314960
READ of size 7 at 0x629000009200 thread T0
    #0 0x4a1e96 in __asan_memcpy
/home/development/llvm/3.9.0/final/llvm.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:413:3
    #1 0x7fde4a618adf in pcre2_substitute_8
XYZ/pcre/src/pcre2_substitute.c:292:1
    #2 0x4f3b1f in process_data XYZ/pcre/src/pcre2test.c:6409:3
    #3 0x4f3b1f in main XYZ/pcre/src/pcre2test.c:7788
    #4 0x7fde4944482f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #5 0x41aad8 in _start (/usr/local/bin/pcre2test+0x41aad8)


0x629000009200 is located 0 bytes to the right of 16384-byte region
[0x629000005200,0x629000009200)
allocated by thread T0 here:
    #0 0x4b969e in realloc
/home/development/llvm/3.9.0/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:77:3
    #1 0x4eb7c7 in process_data XYZ/pcre/src/pcre2test.c:5790:24
    #2 0x4eb7c7 in main XYZ/pcre/src/pcre2test.c:7788
    #3 0x7fde4944482f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)


SUMMARY: AddressSanitizer: heap-buffer-overflow
/home/development/llvm/3.9.0/final/llvm.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:413:3
in __asan_memcpy
Shadow bytes around the buggy address:
  0x0c527fff91f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff9200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff9210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff9220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff9230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c527fff9240:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff9250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff9260: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff9270: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff9280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff9290: 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
==1253==ABORTING


Regards,
Kamil Frankowicz

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