Bug 1583005 (CVE-2018-11504) - CVE-2018-11504 discount: Heap-based buffer-overflow in markdown.c:islist() allows for denial of service
Summary: CVE-2018-11504 discount: Heap-based buffer-overflow in markdown.c:islist() al...
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2018-11504
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: 1583006 1583007 1583008
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-28 04:27 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:46 UTC
Embargoed:


Attachments (Terms of Use)

Description Sam Fowler 2018-05-28 04:27:59 UTC
DISCOUNT through version 2.2.3a is vulnerable to a Heap-based buffer-overflow in in the markdown.c:islist() 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:30:09 UTC
Created discount tracking bugs for this issue:

Affects: epel-7 [bug 1583008]
Affects: fedora-all [bug 1583007]

Comment 3 Sam Fowler 2018-05-28 04:39:45 UTC
Reproduced on F27:

sh-4.4# rpm -q discount
discount-2.2.2-4.fc27.x86_64
sh-4.4# discount-mkd2html issue3_testcase 
=================================================================
==76==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000031 at pc 0x7f1ad5e6c2ca bp 0x7ffc68bb1ed0 sp 0x7ffc68bb1ec0
READ of size 1 at 0x602000000031 thread T0
    #0 0x7f1ad5e6c2c9  (/lib64/libmarkdown.so.2+0xd2c9)
    #1 0x7f1ad5e6d596  (/lib64/libmarkdown.so.2+0xe596)
    #2 0x7f1ad5e70e6b in mkd_compile (/lib64/libmarkdown.so.2+0x11e6b)
    #3 0x40127f  (/usr/bin/discount-mkd2html+0x40127f)
    #4 0x7f1ad5ac9f29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #5 0x401799  (/usr/bin/discount-mkd2html+0x401799)

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

SUMMARY: AddressSanitizer: heap-buffer-overflow (/lib64/libmarkdown.so.2+0xd2c9) 
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 00 07 fa fa[01]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
==76==ABORTING


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