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

buffer overflow with corrupted ico #34

Closed
frokaikan opened this issue Jul 9, 2018 · 5 comments
Closed

buffer overflow with corrupted ico #34

frokaikan opened this issue Jul 9, 2018 · 5 comments

Comments

@frokaikan
Copy link

I found a heap-buffer-overflow when cat an image:
img.zip

=================================================================
==30486==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x619000000e82 at pc 0x0000005349b5 bp 0x7ffe3a703e70 sp 0x7ffe3a703e68
WRITE of size 1 at 0x619000000e82 thread T0
#0 0x5349b4 in stbi__bmp_load_cont /opt/catimg/src/stb_image.h:4748:25
#1 0x52a06f in stbi__ico_load /opt/catimg/src/stb_image.h:4867:15
#2 0x518fcf in stbi__xload_main /opt/catimg/src/sh_image.c:72:26
#3 0x51a553 in stbi_xload /opt/catimg/src/sh_image.c:92:18
#4 0x51b0c7 in img_load_from_file /opt/catimg/src/sh_image.c:188:30
#5 0x513847 in main /opt/catimg/src/catimg.c:115:9
#6 0x7fd91b062b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#7 0x41b029 in _start (/opt/catimg/asan/bin/catimg+0x41b029)

0x619000000e82 is located 2 bytes to the right of 1024-byte region [0x619000000a80,0x619000000e80)
allocated by thread T0 here:
#0 0x4daee0 in malloc (/opt/catimg/asan/bin/catimg+0x4daee0)
#1 0x533785 in stbi__bmp_load_cont /opt/catimg/src/stb_image.h:4684:22
#2 0x52a06f in stbi__ico_load /opt/catimg/src/stb_image.h:4867:15
#3 0xff00000000000003 ()

SUMMARY: AddressSanitizer: heap-buffer-overflow /opt/catimg/src/stb_image.h:4748:25 in stbi__bmp_load_cont
Shadow bytes around the buggy address:
0x0c327fff8180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff8190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff81a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff81b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c327fff81c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c327fff81d0:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff81e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff81f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8210: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8220: 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
==30486==ABORTING

@carnil
Copy link

carnil commented Jul 13, 2018

This issue was assigned CVE-2018-13794

@posva
Copy link
Owner

posva commented Jul 13, 2018

@carnil What does that even mean?

@posva posva changed the title buffer overflow while cating buffer overflow with corrupted ico Jul 13, 2018
@carnil
Copy link

carnil commented Jul 14, 2018 via email

@ignatenkobrain
Copy link

ping @posva, this is vulnerability which should be fixed asap (i.e. it is not enhancement but rather security bug).

@posva
Copy link
Owner

posva commented Sep 2, 2018

Feel free to submit a pr as the label shows :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants