Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 117843 - media-gfx/imagemagick New format string vulnerability in SetImageInfo() (CVE-2006-0082)
Summary: media-gfx/imagemagick New format string vulnerability in SetImageInfo() (CVE-...
Status: RESOLVED DUPLICATE of bug 83542
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-04 22:46 UTC by Sune Kloppenborg Jeppesen (RETIRED)
Modified: 2006-01-05 00:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-01-04 22:46:55 UTC
Snipped from Debian bug. Full details and patch in URL.

Specially crafted file names cause programs using ImageMagick to crash
due to a format string vulnerability. It might be possible to execute
arbitrary code due to this bug.

I've discovered the vulnerability while investigating the upstream fix
for #297990 (CAN-2005-0397). It turns out that this fix is buggy and
doesn't plug the security hole. Originally, the format string
vulnerability could be demonstrated with

convert foo.jpg foo%n.jpg       # (or several %n until overflow happens)

Now all we need is one additional, valid, numeric format string, eg.

convert foo.jpg foo%d%n.jpg     # (or several %n until overflow happens)

The new code just checks for the presence of any of %%, %d, %o, or %x.
If one if them is found, it passes the rest of the string as a format
string to an sprintf()-style function just like in the CAN-2005-0397
vulnerability. It all happens in SetImageInfo() that is usually called
on the target filename in write operations, eg. the target filename of a
'convert'.
Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-01-04 22:48:14 UTC
Karol please advise, patch as necessary and note what other packages might be affected.
Comment 2 Thierry Carrez (RETIRED) gentoo-dev 2006-01-05 00:44:57 UTC

*** This bug has been marked as a duplicate of 83542 ***