Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2019-19785: ATasm: 6502 cross-assembler / Bugs

ATasm 1.06 has a stack-based buffer overflow in the to_comma() function in asm.c via a crafted .m65 file.

CVE
#c++#buffer_overflow
  • Summary
  • Files
  • Reviews
  • Support
  • Wiki
  • Tickets ▾
    • Bugs
    • Feature Requests
  • News
  • Code
  • Discussion

Menu ▾ ▴

#8 Stack-based buffer overflow in the to_comma() function

Status: closed

Owner: nobody

Labels: None

Priority: 5

Updated: 2021-03-20

Created: 2019-12-13

Private: No

Hi,

While fuzzing ATasm 1.08 with Honggfuzz, I found a stack-based buffer overflow in the to_comma() function, in asm.c.

Attaching a reproducer, issue can be reproduced by running:

================================================================= ==15033==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffec9190ef0 at pc 0x0000004ce38e bp 0x7ffec9190e30 sp 0x7ffec9190e28 WRITE of size 1 at 0x7ffec9190ef0 thread T0 #0 0x4ce38d in to_comma /home/fcambus/atasm/src/asm.c:1126:11 #1 0x4ce38d in do_xbyte /home/fcambus/atasm/src/asm.c:1346:9 #2 0x4cfe17 in proc_sym /home/fcambus/atasm/src/asm.c:1553:7 #3 0x4d5556 in do_cmd /home/fcambus/atasm/src/asm.c:1941:5 #4 0x4d5b46 in assemble /home/fcambus/atasm/src/asm.c:1980:9 #5 0x4d8082 in main /home/fcambus/atasm/src/asm.c:2392:3 #6 0x7f32f46441e2 in __libc_start_main /build/glibc-4WA41p/glibc-2.30/csu/…/csu/libc-start.c:308:16 #7 0x41b3fd in _start (/home/fcambus/atasm/atasm+0x41b3fd)

Address 0x7ffec9190ef0 is located in stack of thread T0 at offset 176 in frame #0 0x4cc7af in do_xbyte /home/fcambus/atasm/src/asm.c:1299

This frame has 2 object(s): [32, 64) ‘buf.i’ (line 736) [96, 176) ‘buf’ (line 1301) <== Memory access at offset 176 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow /home/fcambus/atasm/src/asm.c:1126:11 in to_comma Shadow bytes around the buggy address: 0x10005922a180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005922a190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005922a1a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005922a1b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005922a1c0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f8 f8 f8 f8 =>0x10005922a1d0: f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00[f3]f3 0x10005922a1e0: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 0x10005922a1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005922a200: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f8 f8 f8 f8 0x10005922a210: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10005922a220: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 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 Shadow gap: cc ==15033==ABORTING

1 Attachments

Discussion

Log in to post a comment.

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907