Menu

#86 global-buffer-overflow in setfigfont at genepic.c:1232

fig2dev
closed
nobody
None
2021-01-06
2020-02-24
Suhwan Song
No

Hi,
I found a global-buffer-overflow in setfigfont at genepic.c:1232

fig2dev Version 3.2.7b
commit ca48ccc90bd3e7801a63cf9a541f292b28ed1260

Please run following command to reproduce it,

fig2dev -L eepic $PoC

ASAN

==36858==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000c8f00c at pc 0x00000066a8d8 bp 0x7ffd1b6ddbc0 sp 0x7ffd1b6ddbb8
READ of size 1 at 0x000000c8f00c thread T0
    #0 0x66a8d7 in setfigfont /home/tmp/mcj-fig2dev/fig2dev/dev/genepic.c:1232:15
    #1 0x66b71b in genepic_text /home/tmp/mcj-fig2dev/fig2dev/dev/genepic.c:1313:5
    #2 0x549d5b in gendev_objects /home/tmp/mcj-fig2dev/fig2dev/fig2dev.c:1007:6
    #3 0x549d5b in main /home/tmp/mcj-fig2dev/fig2dev/fig2dev.c:484
    #4 0x7fabd4b36b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #5 0x41b469 in _start (/home/tmp/fig2dev+0x41b469)

0x000000c8f00c is located 20 bytes to the left of global variable 'texfontnames' defined in 'texfonts.c:55:13' (0xc8f020) of size 48
0x000000c8f00c is located 28 bytes to the right of global variable 'texfontshape' defined in 'texfonts.c:45:13' (0xc8efc0) of size 48
SUMMARY: AddressSanitizer: global-buffer-overflow /home/tmp/mcj-fig2dev/fig2dev/dev/genepic.c:1232:15 in setfigfont
Shadow bytes around the buggy address:
  0x000080189db0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080189dc0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080189dd0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080189de0: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080189df0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 f9 f9
=>0x000080189e00: f9[f9]f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
  0x000080189e10: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080189e20: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080189e30: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080189e40: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080189e50: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
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
==36858==ABORTING
1 Attachments

Discussion

  • tkl

    tkl - 2021-01-06
    • status: open --> closed
     
  • tkl

    tkl - 2021-01-06

    Version 3.2.8 does not show this bug, probably fixed by [9b6a4d].

     

    Related

    Commit: [9b6a4d]


Log in to post a comment.