Bugzilla – Bug 1135806
VUL-1: CVE-2019-12220: SDL_image, SDL2_image: SDL_image triggers an out-of-bounds read in the SDL function SDL_FreePalette_REAL
Last modified: 2020-01-16 13:51:20 UTC
CVE-2019-12220 An issue was discovered in libSDL2.a in Simple DirectMedia Layer (SDL) 2.0.9 when used in conjunction with libSDL2_image.a in SDL2_image 2.0.4. There is an out-of-bounds read in the SDL function SDL_FreePalette_REAL at video/SDL_pixels.c. References: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-12220 http://www.cvedetails.com/cve/CVE-2019-12220/ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12220 https://bugzilla.libsdl.org/show_bug.cgi?id=4627
Created attachment 805646 [details] POC
Created attachment 805647 [details] foo.c
gcc -o foo $foo.c -lSDL2_image valgrind ./foo ==7852== Syscall param read(buf) points to unaddressable byte(s) ==7852== at 0x5485B71: read (in /lib64/libc-2.26.so) ==7852== by 0x54174A1: _IO_file_xsgetn (in /lib64/libc-2.26.so) ==7852== by 0x540BC20: fread (in /lib64/libc-2.26.so) ==7852== by 0x50A107A: ??? (in /usr/lib64/libSDL2-2.0.so.0.8.0) ==7852== by 0x4E42709: IMG_LoadPCX_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.2) ==7852== by 0x4E3E1B5: IMG_LoadTyped_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.2) ==7852== by 0x400722: main ==7852== Address 0x7393b38 is 0 bytes after a block of size 504 alloc'd ==7852== at 0x4C2E01F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==7852== by 0x50D0982: ??? (in /usr/lib64/libSDL2-2.0.so.0.8.0) ==7852== by 0x51041A0: ??? (in /usr/lib64/libSDL2-2.0.so.0.8.0) ==7852== by 0x4E42625: IMG_LoadPCX_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.2) ==7852== by 0x4E3E1B5: IMG_LoadTyped_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.2) ==7852== by 0x400722: main
This is automated batch bugzilla cleanup. The openSUSE 42.3 changed to end-of-life (EOL [1]) status. As such it is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of openSUSE (At this moment openSUSE Leap 15.1, 15.0 and Tumbleweed) please feel free to reopen this bug against that version (!you must update the "Version" component in the bug fields, do not just reopen please), or alternatively create a new ticket. Thank you for reporting this bug and we are sorry it could not be fixed during the lifetime of the release. [1] https://en.opensuse.org/Lifetime
15.0, 15.1 and factory unfixed
Different valgrind output observed with the (new) SDL2-2.0.10 + (new) SDL2_image-2.0.5. ==9759== Argument 'nmemb' of function calloc has a fishy (possibly negative) value: -2815 ==9759== at 0x4838B65: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9759== by 0x4C99161: SDL_calloc_REAL (in /usr/lib64/libSDL2-2.0.so.0.10.0) ==9759== by 0x48774C0: IMG_LoadPCX_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.3) ==9759== by 0x487AB56: IMG_LoadTyped_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.3) ==9759== by 0x109148: main (in poc.c)
Problems involving fread are solved.
This is an autogenerated message for OBS integration: This bug (1135806) was mentioned in https://build.opensuse.org/request/show/725541 15.0 / SDL2_image https://build.opensuse.org/request/show/725542 15.1 / SDL2_image
This is an autogenerated message for OBS integration: This bug (1135806) was mentioned in https://build.opensuse.org/request/show/725636 Factory / SDL2_image https://build.opensuse.org/request/show/725637 15.0 / SDL2_image https://build.opensuse.org/request/show/725638 15.1 / SDL2_image
openSUSE-SU-2019:2070-1: An update that fixes 12 vulnerabilities is now available. Category: security (moderate) Bug References: 1135787,1135789,1135796,1135806,1136101,1140419,1140421,1141844,1143763,1143764,1143766,1143768 CVE References: CVE-2019-12217,CVE-2019-12218,CVE-2019-12220,CVE-2019-12221,CVE-2019-12222,CVE-2019-13616,CVE-2019-5051,CVE-2019-5052,CVE-2019-5057,CVE-2019-5058,CVE-2019-5059,CVE-2019-5060 Sources used: openSUSE Leap 15.1 (src): SDL2_image-2.0.5-lp151.2.5.1 openSUSE Leap 15.0 (src): SDL2_image-2.0.5-lp150.9.1
openSUSE-SU-2019:2108-1: An update that fixes 12 vulnerabilities is now available. Category: security (moderate) Bug References: 1135787,1135789,1135796,1135806,1136101,1140419,1140421,1141844,1143763,1143764,1143766,1143768 CVE References: CVE-2019-12217,CVE-2019-12218,CVE-2019-12220,CVE-2019-12221,CVE-2019-12222,CVE-2019-13616,CVE-2019-5051,CVE-2019-5052,CVE-2019-5057,CVE-2019-5058,CVE-2019-5059,CVE-2019-5060 Sources used: openSUSE Backports SLE-15-SP1 (src): SDL2_image-2.0.5-bp151.4.3.1 openSUSE Backports SLE-15 (src): SDL2_image-2.0.5-bp150.3.6.1
all done. Closing