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

formatIPTCfromBuffer memory leak #1118

Closed
3 tasks done
schumilo opened this issue May 1, 2018 · 2 comments
Closed
3 tasks done

formatIPTCfromBuffer memory leak #1118

schumilo opened this issue May 1, 2018 · 2 comments
Labels

Comments

@schumilo
Copy link

schumilo commented May 1, 2018

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of ImageMagick
  • I have searched open and closed issues to ensure it has not already been reported

Description

Memory leak in formatIPTCfromBuffer.
ASAN Report:

=================================================================
==14089==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 14249 byte(s) in 1 object(s) allocated from:
    #0 0x4b9228 in __interceptor_malloc (/home/sergej/ImageMagick/.libs/lt-magick+0x4b9228)
    #1 0x7fb99ce84cdd in formatIPTCfromBuffer /home/sergej/ImageMagick/coders/meta.c:2081
    #2 0x7fb99ce84cdd in format8BIM /home/sergej/ImageMagick/coders/meta.c:2242

SUMMARY: AddressSanitizer: 14249 byte(s) leaked in 1 allocation(s).

Found with a modified version of the kAFL fuzzer (https://github.com/RUB-SysSec/kAFL).

Credits: Sergej Schumilo, Cornelius Aschermann (Ruhr-Universität Bochum)

Steps to Reproduce

memleak_2.zip

# Using an ASAN build of ImageMagick
ASAN_OPTIONS=allow_addr2line=true ./magick_asan memleak_2 /dev/null 

System Configuration

  • ImageMagick version: ImageMagick 7.0.7-29 Q16 x86_64 2018-04-30
  • Environment (Operating system, version and so on): Ubuntu 16.04.4 LTS
  • Additional information:
@urban-warrior
Copy link
Member

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

urban-warrior pushed a commit to ImageMagick/ImageMagick6 that referenced this issue May 1, 2018
@dlemstra dlemstra added the bug label May 3, 2018
@dlemstra dlemstra closed this as completed May 3, 2018
@nohmask
Copy link

nohmask commented Sep 11, 2018

This was assigned CVE-2018-16750.

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

No branches or pull requests

4 participants