#609 new
Ahcheong Lee

heap-buffer-overflow in nasm-pp.c:1829

Reported by Ahcheong Lee | April 29th, 2021 @ 04:07 PM

I report a heap-buffer-overflow detected by address sanitizer.
I found this test input by fuzz testing.

The stack traces are as follows:
==22744==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60b000000206 at pc 0x000000347e99 bp 0x7fffffffda70 sp 0x7fff ffffd210
WRITE of size 49 at 0x60b000000206 thread T0
#0 0x347e98 in strcat (/home/cheong/afl++/subjects_friend/yasm/yasm.san+0x347e98) #1 0x418b21 in inc_fopen /home/cheong/subjects/yasm-1.3.0/modules/preprocs/nasm/nasm-pp.c:1829:9 #2 0x418b21 in do_directive /home/cheong/subjects/yasm-1.3.0/modules/preprocs/nasm/nasm-pp.c:2731:23 #3 0x40c646 in pp_getline /home/cheong/subjects/yasm-1.3.0/modules/preprocs/nasm/nasm-pp.c:5075:13 #4 0x4289a2 in nasm_preproc_get_line /home/cheong/subjects/yasm-1.3.0/modules/preprocs/nasm/nasm-preproc.c:195:12 #5 0x42ec0d in nasm_parser_parse /home/cheong/subjects/yasm-1.3.0/modules/parsers/nasm/nasm-parse.c:219:13 #6 0x44a2c7 in nasm_do_parse /home/cheong/subjects/yasm-1.3.0/modules/parsers/nasm/nasm-parser.c:66:5 #7 0x44a2c7 in nasm_parser_do_parse /home/cheong/subjects/yasm-1.3.0/modules/parsers/nasm/nasm-parser.c:83:5 #8 0x48458f in do_assemble /home/cheong/subjects/yasm-1.3.0/frontends/yasm/yasm.c:519:5 #9 0x48458f in main /home/cheong/subjects/yasm-1.3.0/frontends/yasm/yasm.c:749:12 #10 0x7ffff6e22bf6 in __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310 #11 0x2e2cc9 in start (/home/cheong/afl++/subjectsfriend/yasm/yasm.san+0x2e2cc9)

You can reproduce the bug by executing

I tested the subject on yasm-1.3.0.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket