<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 11: Heap-based Buffer Overflow in the get_line() function</title><link href="https://sourceforge.net/p/mcpp/bugs/11/" rel="alternate"/><link href="https://sourceforge.net/p/mcpp/bugs/11/feed.atom" rel="self"/><id>https://sourceforge.net/p/mcpp/bugs/11/</id><updated>2024-03-26T16:21:32.989000Z</updated><subtitle>Recent changes to 11: Heap-based Buffer Overflow in the get_line() function</subtitle><entry><title>#11 Heap-based Buffer Overflow in the get_line() function</title><link href="https://sourceforge.net/p/mcpp/bugs/11/?limit=25#fcbd" rel="alternate"/><published>2024-03-26T16:21:32.989000Z</published><updated>2024-03-26T16:21:32.989000Z</updated><author><name>John Brandwood</name><uri>https://sourceforge.net/u/jbrandwood/</uri></author><id>https://sourceforge.netd39b77b77ce226df702c65b48ac429b7714df4bb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;For anyone looking at this thread currently ... this was fixed back in 2019 by the Debian maintainers with 04-gniibe-fix-12.patch&lt;/p&gt;
&lt;p&gt;I have applied a slightly modified version of that patch here ...&lt;br/&gt;
&lt;a href="https://github.com/jbrandwood/mcpp/commit/1d56f3287b20bb3876be1a0cc132e06dada5256b" rel="nofollow"&gt;https://github.com/jbrandwood/mcpp/commit/1d56f3287b20bb3876be1a0cc132e06dada5256b&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#11 Heap-based Buffer Overflow in the get_line() function</title><link href="https://sourceforge.net/p/mcpp/bugs/11/?limit=25#b61f" rel="alternate"/><published>2019-06-19T11:01:20.235000Z</published><updated>2019-06-19T11:01:20.235000Z</updated><author><name>Frederic Cambus</name><uri>https://sourceforge.net/u/fcambus/</uri></author><id>https://sourceforge.netbc858ca9d96be0d831626f94f70a7bb85609a896</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Attached the wrong file, here is the reproducer.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Heap-based Buffer Overflow in the get_line() function</title><link href="https://sourceforge.net/p/mcpp/bugs/11/" rel="alternate"/><published>2019-06-19T10:57:35.733000Z</published><updated>2019-06-19T10:57:35.733000Z</updated><author><name>Frederic Cambus</name><uri>https://sourceforge.net/u/fcambus/</uri></author><id>https://sourceforge.net90c7411712ef64b1efe0b35d2dfdb1ba4b6c2535</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;While fuzzing mcpp with American Fuzzy Lop, I found a Heap-based&lt;br/&gt;
Buffer Overflow in the get_line() function, in support.c L1957.&lt;/p&gt;
&lt;p&gt;Attaching a reproducer, issue can be reproduced by running:&lt;/p&gt;
&lt;p&gt;mcpp test-get_line&lt;/p&gt;
&lt;p&gt;Regards,&lt;br/&gt;
Frederic Cambus.&lt;/p&gt;
&lt;p&gt;=================================================================&lt;br/&gt;
==13894==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6310000007ff at pc 0x00000055e553 bp 0x7ffd9dfabbd0 sp 0x7ffd9dfabbc8&lt;br/&gt;
READ of size 1 at 0x6310000007ff thread T0&lt;br/&gt;
    #0 0x55e552 in get_line /home/fcambus/mcpp-2.7.2/src/support.c:1957:13&lt;br/&gt;
    #1 0x558ba2 in parse_line /home/fcambus/mcpp-2.7.2/src/support.c:1657:15&lt;br/&gt;
    #2 0x550214 in get_ch /home/fcambus/mcpp-2.7.2/src/support.c:1580:13&lt;br/&gt;
    #3 0x513c1b in mcpp_main /home/fcambus/mcpp-2.7.2/src/main.c:626:17&lt;br/&gt;
    #4 0x513396 in main /home/fcambus/mcpp-2.7.2/src/main.c:421:5&lt;br/&gt;
    #5 0x7fee45cfdb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310&lt;br/&gt;
    #6 0x41a149 in _start (/home/fcambus/tmp-mcpp/mcpp+0x41a149)&lt;/p&gt;
&lt;p&gt;0x6310000007ff is located 1 bytes to the left of 65536-byte region [0x631000000800,0x631000010800)&lt;br/&gt;
allocated by thread T0 here:&lt;br/&gt;
    #0 0x4da000 in malloc (/home/fcambus/tmp-mcpp/mcpp+0x4da000)&lt;br/&gt;
    #1 0x556ae4 in xmalloc /home/fcambus/mcpp-2.7.2/src/support.c:2336:28&lt;br/&gt;
    #2 0x55b52b in get_file /home/fcambus/mcpp-2.7.2/src/support.c:2281:20&lt;br/&gt;
    #3 0x56bb31 in add_file /home/fcambus/mcpp-2.7.2/src/system.c:3540:12&lt;br/&gt;
    #4 0x51318a in main /home/fcambus/mcpp-2.7.2/src/main.c:412:5&lt;br/&gt;
    #5 0x7fee45cfdb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310&lt;/p&gt;
&lt;p&gt;SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fcambus/mcpp-2.7.2/src/support.c:1957:13 in get_line&lt;br/&gt;
Shadow bytes around the buggy address:&lt;br/&gt;
  0x0c627fff80a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;br/&gt;
  0x0c627fff80b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;br/&gt;
  0x0c627fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;br/&gt;
  0x0c627fff80d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;br/&gt;
  0x0c627fff80e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;br/&gt;
=&amp;gt;0x0c627fff80f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;span&gt;[fa]&lt;/span&gt;&lt;br/&gt;
  0x0c627fff8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;br/&gt;
  0x0c627fff8110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;br/&gt;
  0x0c627fff8120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;br/&gt;
  0x0c627fff8130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;br/&gt;
  0x0c627fff8140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;br/&gt;
Shadow byte legend (one shadow byte represents 8 application bytes):&lt;br/&gt;
  Addressable:           00&lt;br/&gt;
  Partially addressable: 01 02 03 04 05 06 07 &lt;br/&gt;
  Heap left redzone:       fa&lt;br/&gt;
  Freed heap region:       fd&lt;br/&gt;
  Stack left redzone:      f1&lt;br/&gt;
  Stack mid redzone:       f2&lt;br/&gt;
  Stack right redzone:     f3&lt;br/&gt;
  Stack after return:      f5&lt;br/&gt;
  Stack use after scope:   f8&lt;br/&gt;
  Global redzone:          f9&lt;br/&gt;
  Global init order:       f6&lt;br/&gt;
  Poisoned by user:        f7&lt;br/&gt;
  Container overflow:      fc&lt;br/&gt;
  Array cookie:            ac&lt;br/&gt;
  Intra object redzone:    bb&lt;br/&gt;
  ASan internal:           fe&lt;br/&gt;
  Left alloca redzone:     ca&lt;br/&gt;
  Right alloca redzone:    cb&lt;br/&gt;
==13894==ABORTING&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>