Bug 1704762 (CVE-2019-10131) - CVE-2019-10131 ImageMagick: off-by-one read in formatIPTCfromBuffer function in coders/meta.c
Summary: CVE-2019-10131 ImageMagick: off-by-one read in formatIPTCfromBuffer function ...
Status: NEW
Alias: CVE-2019-10131
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=low,public=20190430,reported=2...
Keywords: Security
Depends On: 1708634 1708635
Blocks: 1704783
TreeView+ depends on / blocked
 
Reported: 2019-04-30 13:06 UTC by Riccardo Schirone
Modified: 2019-05-10 12:39 UTC (History)
5 users (show)

(edit)
An off-by-one read vulnerability was discovered in ImageMagick in the formatIPTCfromBuffer function in coders/meta.c. A local attacker may use this flaw to read beyond the end of the buffer or to crash the program.
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)

Description Riccardo Schirone 2019-04-30 13:06:48 UTC
An off-by-one read vulnerability was discovered in ImageMagick in the formatIPTCfromBuffer() function in coders/meta.c. A local attacker may use this flaw to read beyond the end of the buffer or to crash the program.

Upstream patch:
https://github.com/ImageMagick/ImageMagick/commit/cb1214c124e1bd61f7dd551b94a794864861592e

Comment 1 Riccardo Schirone 2019-04-30 13:28:29 UTC
Acknowledgments:

Name: Riccardo Schirone (Red Hat Product Security)

Comment 2 Riccardo Schirone 2019-04-30 13:31:51 UTC
Valgrind output:

$ valgrind -- convert ./poc /dev/null
==17934== Memcheck, a memory error detector
==17934== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==17934== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==17934== Command: convert ./poc /dev/null
==17934==
==17934== Invalid read of size 1
==17934==    at 0xF8D850D: formatIPTCfromBuffer (meta.c:2084)
==17934==    by 0xF8D850D: format8BIM (meta.c:2227)
==17934==    by 0xF8D8E36: WriteMETAImage (meta.c:2317)
==17934==    by 0x4EC23CE: WriteImage (constitute.c:1229)
==17934==    by 0x4EC2C91: WriteImages (constitute.c:1382)
==17934==    by 0x5320FCA: ConvertImageCommand (convert.c:3051)
==17934==    by 0x5388D2E: MagickCommandGenesis (mogrify.c:161)
==17934==    by 0x400896: ConvertMain (convert.c:81)
==17934==    by 0x400896: main (convert.c:92)
==17934==  Address 0x9048feb is 0 bytes after a block of size 11 alloc'd
==17934==    at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
==17934==    by 0xF8D8357: format8BIM (meta.c:2196)
==17934==    by 0xF8D8E36: WriteMETAImage (meta.c:2317)
==17934==    by 0x4EC23CE: WriteImage (constitute.c:1229)
==17934==    by 0x4EC2C91: WriteImages (constitute.c:1382)
==17934==    by 0x5320FCA: ConvertImageCommand (convert.c:3051)
==17934==    by 0x5388D2E: MagickCommandGenesis (mogrify.c:161)
==17934==    by 0x400896: ConvertMain (convert.c:81)
==17934==    by 0x400896: main (convert.c:92)
==17934==

Comment 3 Riccardo Schirone 2019-04-30 13:32:48 UTC
The buffer is allocated in format8BIM() in coders/meta.c and but the invalid read of 1 byte happens in formatIPTCfromBuffer().

Comment 7 Riccardo Schirone 2019-05-10 12:39:08 UTC
Created ImageMagick tracking bugs for this issue:

Affects: fedora-all [bug 1708634]


Note You need to log in before you can comment on or make changes to this bug.