heap overflow

Bug #1920616 reported by XiaoyuHe
256
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jhead (Ubuntu)
New
Undecided
Unassigned

Bug Description

# enviroment
ubuntu 18.04
./jhead poc

# version
3.04

# asan out
=================================================================
==32044==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000003a at pc 0x564a9d17124e bp 0x7ffcf488d2b0 sp 0x7ffcf488d2a0
READ of size 2 at 0x60200000003a thread T0
    #0 0x564a9d17124d in Get16u exif.c:321
    #1 0x564a9d17124d in process_EXIF exif.c:1022
    #2 0x564a9d15c382 in ReadJpegSections jpgfile.c:287
    #3 0x564a9d15d90e in ReadJpegSections jpgfile.c:126
    #4 0x564a9d15d90e in ReadJpegFile jpgfile.c:379
    #5 0x564a9d15366c in ProcessFile jhead.c:905
    #6 0x564a9d14eb2e in main jhead.c:1756
    #7 0x7f2a436ebbf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
    #8 0x564a9d151279 in _start (/home/fuzz/jhead-3.04/jhead+0x12279)

0x60200000003b is located 0 bytes to the right of 11-byte region [0x602000000030,0x60200000003b)
allocated by thread T0 here:
    #0 0x7f2a43f37b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x564a9d15ad6b in ReadJpegSections jpgfile.c:173

SUMMARY: AddressSanitizer: heap-buffer-overflow exif.c:321 in Get16u
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 fd fd fa fa 00[03]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
==32044==ABORTING

Revision history for this message
XiaoyuHe (hello0011) wrote :
tags: added: community-security
XiaoyuHe (hello0011)
information type: Private Security → Public Security
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.