Bug 1136101 - (CVE-2019-12222) VUL-1: CVE-2019-12222: SDL2_image, SDL_image: out-of-bounds read triggered by SDL_image in the function SDL_InvalidateMap at video/SDL_pixels.c
(CVE-2019-12222)
VUL-1: CVE-2019-12222: SDL2_image, SDL_image: out-of-bounds read triggered by...
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Security
Leap 15.0
Other Other
: P4 - Low : Minor (vote)
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/233341/
CVSSv2:NVD:CVE-2019-12222:4.3:(AV:N/A...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-05-23 15:14 UTC by Alexandros Toptsoglou
Modified: 2020-01-16 13:51 UTC (History)
1 user (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
POC (24.55 KB, image/x-pcx)
2019-05-23 15:15 UTC, Alexandros Toptsoglou
Details
loadtiff (289 bytes, text/x-csrc)
2019-05-23 15:16 UTC, Alexandros Toptsoglou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandros Toptsoglou 2019-05-23 15:14:41 UTC
CVE-2019-12222

An issue was discovered in libSDL2.a in Simple DirectMedia Layer (SDL) 2.0.9.
There is an out-of-bounds read in the function SDL_InvalidateMap at
video/SDL_pixels.c.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-12222
http://www.cvedetails.com/cve/CVE-2019-12222/
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12222
https://bugzilla.libsdl.org/show_bug.cgi?id=4621
Comment 1 Alexandros Toptsoglou 2019-05-23 15:15:52 UTC
Created attachment 805863 [details]
POC
Comment 2 Alexandros Toptsoglou 2019-05-23 15:16:48 UTC
Created attachment 805864 [details]
loadtiff
Comment 3 Alexandros Toptsoglou 2019-05-23 15:18:45 UTC
Reproduce: 

gcc -o loadtif $loadtiff -lSDL2_image -I/usr/include/SDL2 -lSDL2

valgrind ./loadtif a 

==10275== Command: ./loadtif a
==10275== 
==10275== Invalid write of size 1
==10275==    at 0x4C3570E: mempcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==10275==    by 0x54174F7: _IO_file_xsgetn (in /lib64/libc-2.26.so)
==10275==    by 0x540BC20: fread (in /lib64/libc-2.26.so)
==10275==    by 0x50A107A: fread (stdio2.h:294)
==10275==    by 0x50A107A: stdio_read (SDL_rwops.c:385)
==10275==    by 0x4E42709: IMG_LoadPCX_RW (IMG_pcx.c:158)
==10275==    by 0x4E3E1B5: IMG_LoadTyped_RW (IMG.c:195)
==10275==    by 0x400722: main (in /home/alex/SDL/loadtif)
==10275==  Address 0x739497f is 2,959 bytes inside an unallocated block of size 4,186,608 in arena "client"
Comment 4 Tomáš Chvátal 2019-07-11 11:42:35 UTC
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
Comment 5 Marcus Meissner 2019-07-12 06:43:44 UTC
15.0,15.1 and factory unfixed
Comment 6 Jan Engelhardt 2019-08-23 10:22:21 UTC
With SDL2-2.0.10 and SDL2_image-2.0.5, the invalid-write-of-size-1 is gone, but a different valgrind mention is visible

==9827== Argument 'nmemb' of function calloc has a fishy (possibly negative) value: -25344
==9827==    at 0x4838B65: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==9827==    by 0x491C161: SDL_calloc_REAL (in /usr/lib64/libSDL2-2.0.so.0.10.0)
==9827==    by 0x48774C0: IMG_LoadPCX_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.3)
==9827==    by 0x487AB56: IMG_LoadTyped_RW (in /usr/lib64/libSDL2_image-2.0.so.0.2.3)
==9827==    by 0x109190: main (in /home/jengelh/obs/zu/games/SDL2_image/loadtif)

This is likely one of the other CVEs. The issue with stdio_read is gone.
Comment 7 Swamp Workflow Management 2019-08-23 11:00:22 UTC
This is an autogenerated message for OBS integration:
This bug (1136101) 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
Comment 8 Swamp Workflow Management 2019-08-23 15:50:21 UTC
This is an autogenerated message for OBS integration:
This bug (1136101) 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
Comment 9 Swamp Workflow Management 2019-09-05 13:13:32 UTC
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
Comment 10 Swamp Workflow Management 2019-09-10 19:12:48 UTC
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
Comment 11 Alexandros Toptsoglou 2020-01-16 13:51:04 UTC
all done. Closing