Ticket #6 (assigned defect)

Opened 2 years ago

Last modified 2 years ago

Invalid read when reading malformed input

Reported by: hanno Owned by: ovasik
Priority: major Milestone:
Component: xmlif Version:
Keywords: Cc:
Blocked By: Blocking:

Description

Attached input (only consisting of two bytes 00 ff) will result in an invalid memory read access. To see it you have to compile xmlif with address sanitizer (CFLAGS="-fsanitize=address").

Found with american fuzzy lop.

Address Sanitizer output:

==20701==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000040eb98 at pc 0x40a5fd bp 0x7fffbe27fb80 sp 0x7fffbe27fb70
READ of size 2 at 0x00000040eb98 thread T0
    #0 0x40a5fc in yylex xmlif/xmlif.c:1417
    #1 0x7f6ff4b6df9f in __libc_start_main (/lib64/libc.so.6+0x1ff9f)
    #2 0x401961 (/mnt/ram/xmlto/xmlif/xmlif+0x401961)

0x00000040eb98 is located 0 bytes to the right of global variable 'yy_transition' from 'xmlif/xmlif.c' (0x40b540) of size 13912
SUMMARY: AddressSanitizer: global-buffer-overflow xmlif/xmlif.c:1417 yylex
Shadow bytes around the buggy address:
  0x000080079d20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x000080079d70: 00 00 00[f9]f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x000080079d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080079dc0: 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
  Contiguous container OOB:fc
  ASan internal:           fe
==20701==ABORTING

Attachments

invalidread.xml (2 bytes) - added by hanno 2 years ago.

Change History

Changed 2 years ago by hanno

comment:1 Changed 2 years ago by ovasik

Confirmed, however I think the issue is probably in flex.

comment:2 Changed 2 years ago by ovasik

  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.