[pcre-dev] [Bug 2108] New: Heap out of bounds read in match(…

Top Page
Delete this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2108] New: Heap out of bounds read in match()
https://bugs.exim.org/show_bug.cgi?id=2108

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


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

Affected:
- PCRE2 version 10.23 (SVN rev: 760)

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

ASAN:

==25520==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x6290000051ff at pc 0x7f6d8f592b5b bp 0x7fffcec66470 sp 0x7fffcec66468
READ of size 1 at 0x6290000051ff thread T0
    #0 0x7f6d8f592b5a in match XYZ/pcre/src/pcre2_match.c:1968:13
    #1 0x7f6d8f5326e4 in pcre2_match_8 XYZ/pcre/src/pcre2_match.c:6644:8
    #2 0x4fb54c in process_data XYZ/pcre/src/pcre2test.c:6808:9
    #3 0x4ea545 in main XYZ/pcre/src/pcre2test.c:8045:12
    #4 0x7f6d8e3c882f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #5 0x41acd8 in _start (/usr/local/bin/pcre2test+0x41acd8)


0x6290000051ff is located 1 bytes to the left of 16384-byte region
[0x629000005200,0x629000009200)
allocated by thread T0 here:
    #0 0x4b989e in realloc
/home/llvm/clang-3.9/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:77:3
    #1 0x4f7627 in process_data XYZ/pcre/src/pcre2test.c:5972:24
    #2 0x4ea545 in main XYZ/pcre/src/pcre2test.c:8045:12
    #3 0x7f6d8e3c882f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)


SUMMARY: AddressSanitizer: heap-buffer-overflow
XYZ/pcre/src/pcre2_match.c:1968:13 in match
Shadow bytes around the buggy address:
  0x0c527fff89e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff89f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff8a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff8a10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c527fff8a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c527fff8a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa[fa]
  0x0c527fff8a40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff8a50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff8a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff8a70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c527fff8a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
==25520==ABORTING


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