Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASan: heap-buffer-overflow nfdump/bin/nfdump.c:564 in process_data #173

Closed
fgeek opened this issue Aug 3, 2019 · 1 comment

Comments

@fgeek
Copy link

commented Aug 3, 2019

Tested commit: 0b45172
Credits: Henri Salo
Tools: american fuzzy lop 2.53b, afl-utils
001-nfcapd.txt (86b6885763b50ab23831637e693e7c7412e16f3c)

$ ./bin/nfdump -r 001-nfcapd.txt
Date first seen          Duration Proto      Src IP Addr:Port          Dst IP Addr:Port   Packets    Bytes Flows
=================================================================
==18543==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fe4638ff7f8 at pc 0x5623901e9f3a bp 0x7ffd5462d440 sp 0x7ffd5462d438
READ of size 8 at 0x7fe4638ff7f8 thread T0
    #0 0x5623901e9f39 in process_data /home/hsalo/src/nfdump/bin/nfdump.c:564
    #1 0x5623901e9f39 in main /home/hsalo/src/nfdump/bin/nfdump.c:1213
    #2 0x7fe4661e509a in __libc_start_main ../csu/libc-start.c:308
    #3 0x5623901eb499 in _start (/home/hsalo/builds/nfdump/0b45172134d354081d80212cb33e224a46c48298/bin/nfdump+0x1a499)

0x7fe4638ff7f8 is located 0 bytes to the right of 524280-byte region [0x7fe46387f800,0x7fe4638ff7f8)
allocated by thread T0 here:
    #0 0x7fe4665ec518 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7fe4664ae7fa in InitExporterList /home/hsalo/src/nfdump/bin/exporter.c:87

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/hsalo/src/nfdump/bin/nfdump.c:564 in process_data
Shadow bytes around the buggy address:
  0x0ffd0c717ea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd0c717eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd0c717ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd0c717ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ffd0c717ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ffd0c717ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00[fa]
  0x0ffd0c717f00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ffd0c717f10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ffd0c717f20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ffd0c717f30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ffd0c717f40: 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
==18543==ABORTING
$ hexdump -C 001-nfcapd.txt 
00000000  0c a5 01 00 00 30 30 30  30 30 30 30 30 30 30 30  |.....00000000000|
00000010  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
*
00000110  30 30 30 30 30 30 30 30  30 00 00 00 02 00 30 30  |000000000.....00|
00000120  02 00 0c 00 30 30 00 00  00 00 30 30 0a 00 30 00  |....00....00..0.|
00000130  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
00000140  30 30 30 30 30 30 30 30  ff ff 30 30 30 30 30 30  |00000000..000000|
00000150
phaag pushed a commit that referenced this issue Aug 5, 2019
@phaag

This comment has been minimized.

Copy link
Owner

commented Aug 5, 2019

Fixed in 7bd6d5b.
Thanks for reporting.

@phaag phaag closed this Aug 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.