Bug 1583001 (CVE-2018-11503) - CVE-2018-11503 discount: Heap-based buffer-overflow in markdown.c:isfootnote() allows for denial of service
Summary: CVE-2018-11503 discount: Heap-based buffer-overflow in markdown.c:isfootnote(...
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2018-11503
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1583002 1583003 1583004
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-28 04:25 UTC by Sam Fowler
Modified: 2019-09-29 14:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-10 10:26:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Sam Fowler 2018-05-28 04:25:34 UTC
DISCOUNT through version 2.2.3a is vulnerable to a Heap-based buffer-overflow in in the markdown.c:isfootnote() function. An attacker could exploit this to cause a denial of service.


Upstream issue:

https://github.com/Orc/discount/issues/189#issuecomment-392247798

Comment 1 Sam Fowler 2018-05-28 04:26:13 UTC
Created discount tracking bugs for this issue:

Affects: epel-7 [bug 1583002]
Affects: fedora-all [bug 1583003]

Comment 3 Sam Fowler 2018-05-28 04:38:31 UTC
Reproduced on F27:

# rpm -q discount
discount-2.2.2-4.fc27.x86_64
sh-4.4# discount-mkd2html issue2_testcase
=================================================================
==73==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000012 at pc 0x7f02f778fc42 bp 0x7ffc8afeb700 sp 0x7ffc8afeb6f0
READ of size 1 at 0x602000000012 thread T0
    #0 0x7f02f778fc41 in mkd_compile (/lib64/libmarkdown.so.2+0x14c41)
    #1 0x40127f  (/usr/bin/discount-mkd2html+0x40127f)
    #2 0x7f02f73e5f29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #3 0x401799  (/usr/bin/discount-mkd2html+0x401799)

0x602000000012 is located 1 bytes to the right of 1-byte region [0x602000000010,0x602000000011)
allocated by thread T0 here:
    #0 0x7f02f7a8f850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7f02f778fb18 in mkd_compile (/lib64/libmarkdown.so.2+0x14b18)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/lib64/libmarkdown.so.2+0x14c41) in mkd_compile
Shadow bytes around the buggy address:
  0x0c047fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c047fff8000: fa fa[01]fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8050: 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
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  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
==73==ABORTING


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