Vulnerabilities > CVE-2005-1275 - Remote Buffer Overflow vulnerability in ImageMagick PNM Image Decoding

047910
CVSS 5.0 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
NONE
Integrity impact
NONE
Availability impact
PARTIAL
network
low complexity
graphicsmagick
imagemagick
nessus
exploit available

Summary

Heap-based buffer overflow in the ReadPNMImage function in pnm.c for ImageMagick 6.2.1 and earlier allows remote attackers to cause a denial of service (application crash) via a PNM file with a small colors value.

Exploit-Db

descriptionImageMagick 6.x PNM Image Decoding Remote Buffer Overflow Vulnerability. CVE-2005-1275. Dos exploit for linux platform
idEDB-ID:25527
last seen2016-02-03
modified2005-04-25
published2005-04-25
reporterDamian Put
sourcehttps://www.exploit-db.com/download/25527/
titleImageMagick 6.x PNM Image Decoding Remote Buffer Overflow Vulnerability

Nessus

  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_CD286CC5B76211D9BFB7000C6EC775D9.NASL
    descriptionDamian Put reports about ImageMagick : Remote exploitation of a heap overflow vulnerability could allow execution of arbitrary code or course denial of service. A heap overflow exists in ReadPNMImage() function, that is used to decode a PNM image files.
    last seen2020-06-01
    modified2020-06-02
    plugin id19125
    published2005-07-13
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/19125
    titleFreeBSD : ImageMagick -- ReadPNMImage() heap overflow vulnerability (cd286cc5-b762-11d9-bfb7-000c6ec775d9)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from the FreeBSD VuXML database :
    #
    # Copyright 2003-2018 Jacques Vidrine and contributors
    #
    # Redistribution and use in source (VuXML) and 'compiled' forms (SGML,
    # HTML, PDF, PostScript, RTF and so forth) with or without modification,
    # are permitted provided that the following conditions are met:
    # 1. Redistributions of source code (VuXML) must retain the above
    #    copyright notice, this list of conditions and the following
    #    disclaimer as the first lines of this file unmodified.
    # 2. Redistributions in compiled form (transformed to other DTDs,
    #    published online in any format, converted to PDF, PostScript,
    #    RTF and other formats) must reproduce the above copyright
    #    notice, this list of conditions and the following disclaimer
    #    in the documentation and/or other materials provided with the
    #    distribution.
    # 
    # THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
    # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
    # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
    # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
    # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
    # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
    # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(19125);
      script_version("1.25");
      script_cvs_date("Date: 2019/08/02 13:32:37");
    
      script_cve_id("CVE-2005-1275");
      script_bugtraq_id(13351);
    
      script_name(english:"FreeBSD : ImageMagick -- ReadPNMImage() heap overflow vulnerability (cd286cc5-b762-11d9-bfb7-000c6ec775d9)");
      script_summary(english:"Checks for updated packages in pkg_info output");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote FreeBSD host is missing one or more security-related
    updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Damian Put reports about ImageMagick :
    
    Remote exploitation of a heap overflow vulnerability could allow
    execution of arbitrary code or course denial of service.
    
    A heap overflow exists in ReadPNMImage() function, that is used to
    decode a PNM image files."
      );
      # http://marc.theaimsgroup.com/?l=bugtraq&m=111445767107869
      script_set_attribute(
        attribute:"see_also",
        value:"https://marc.info/?l=bugtraq&m=111445767107869"
      );
      # https://vuxml.freebsd.org/freebsd/cd286cc5-b762-11d9-bfb7-000c6ec775d9.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?2612f0af"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:ImageMagick");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:ImageMagick-nox11");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2005/04/25");
      script_set_attribute(attribute:"patch_publication_date", value:"2005/04/27");
      script_set_attribute(attribute:"plugin_publication_date", value:"2005/07/13");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"FreeBSD Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/FreeBSD/release", "Host/FreeBSD/pkg_info");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("freebsd_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/FreeBSD/release")) audit(AUDIT_OS_NOT, "FreeBSD");
    if (!get_kb_item("Host/FreeBSD/pkg_info")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    
    if (pkg_test(save_report:TRUE, pkg:"ImageMagick<6.2.2")) flag++;
    if (pkg_test(save_report:TRUE, pkg:"ImageMagick-nox11<6.2.2")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:pkg_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-132-1.NASL
    descriptionDamian Put discovered a buffer overflow in the PNM image decoder. Processing a specially crafted PNM file with a small
    last seen2020-06-01
    modified2020-06-02
    plugin id20523
    published2006-01-15
    reporterUbuntu Security Notice (C) 2005-2019 Canonical, Inc. / NASL script (C) 2006-2016 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/20523
    titleUbuntu 4.10 / 5.04 : imagemagick vulnerabilities (USN-132-1)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Ubuntu Security Notice USN-132-1. The text 
    # itself is copyright (C) Canonical, Inc. See 
    # <http://www.ubuntu.com/usn/>. Ubuntu(R) is a registered 
    # trademark of Canonical, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(20523);
      script_version("1.13");
      script_cvs_date("Date: 2019/08/02 13:33:00");
    
      script_cve_id("CVE-2005-1275");
      script_xref(name:"USN", value:"132-1");
    
      script_name(english:"Ubuntu 4.10 / 5.04 : imagemagick vulnerabilities (USN-132-1)");
      script_summary(english:"Checks dpkg output for updated packages.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Ubuntu host is missing one or more security-related
    patches."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Damian Put discovered a buffer overflow in the PNM image decoder.
    Processing a specially crafted PNM file with a small 'colors' value
    resulted in a crash of the application that used the ImageMagick
    library. (CAN-2005-1275)
    
    Another Denial of Service vulnerability was found in the XWD decoder.
    Specially crafted invalid color masks resulted in an infinite loop
    which caused the application using the ImageMagick library to stop
    working and use all available CPU resources.
    (http://bugs.gentoo.org/show_bug.cgi?id=90423)
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Ubuntu security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:imagemagick");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libmagick++6");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libmagick++6-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libmagick6");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libmagick6-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:perlmagick");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:4.10");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:5.04");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2005/05/23");
      script_set_attribute(attribute:"plugin_publication_date", value:"2006/01/15");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"Ubuntu Security Notice (C) 2005-2019 Canonical, Inc. / NASL script (C) 2006-2016 Tenable Network Security, Inc.");
      script_family(english:"Ubuntu Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/cpu", "Host/Ubuntu", "Host/Ubuntu/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("ubuntu.inc");
    include("misc_func.inc");
    
    if ( ! get_kb_item("Host/local_checks_enabled") ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/Ubuntu/release");
    if ( isnull(release) ) audit(AUDIT_OS_NOT, "Ubuntu");
    release = chomp(release);
    if (! ereg(pattern:"^(4\.10|5\.04)$", string:release)) audit(AUDIT_OS_NOT, "Ubuntu 4.10 / 5.04", "Ubuntu " + release);
    if ( ! get_kb_item("Host/Debian/dpkg-l") ) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Ubuntu", cpu);
    
    flag = 0;
    
    if (ubuntu_check(osver:"4.10", pkgname:"imagemagick", pkgver:"6.0.2.5-1ubuntu1.5")) flag++;
    if (ubuntu_check(osver:"4.10", pkgname:"libmagick++6", pkgver:"6.0.2.5-1ubuntu1.5")) flag++;
    if (ubuntu_check(osver:"4.10", pkgname:"libmagick++6-dev", pkgver:"6.0.2.5-1ubuntu1.5")) flag++;
    if (ubuntu_check(osver:"4.10", pkgname:"libmagick6", pkgver:"6.0.2.5-1ubuntu1.5")) flag++;
    if (ubuntu_check(osver:"4.10", pkgname:"libmagick6-dev", pkgver:"6.0.2.5-1ubuntu1.5")) flag++;
    if (ubuntu_check(osver:"4.10", pkgname:"perlmagick", pkgver:"6.0.2.5-1ubuntu1.5")) flag++;
    if (ubuntu_check(osver:"5.04", pkgname:"imagemagick", pkgver:"6.0.6.2-2.1ubuntu1.1")) flag++;
    if (ubuntu_check(osver:"5.04", pkgname:"libmagick++6", pkgver:"6.0.6.2-2.1ubuntu1.1")) flag++;
    if (ubuntu_check(osver:"5.04", pkgname:"libmagick++6-dev", pkgver:"6.0.6.2-2.1ubuntu1.1")) flag++;
    if (ubuntu_check(osver:"5.04", pkgname:"libmagick6", pkgver:"6.0.6.2-2.1ubuntu1.1")) flag++;
    if (ubuntu_check(osver:"5.04", pkgname:"libmagick6-dev", pkgver:"6.0.6.2-2.1ubuntu1.1")) flag++;
    if (ubuntu_check(osver:"5.04", pkgname:"perlmagick", pkgver:"6.0.6.2-2.1ubuntu1.1")) flag++;
    
    if (flag)
    {
      security_report_v4(
        port       : 0,
        severity   : SECURITY_WARNING,
        extra      : ubuntu_report_get()
      );
      exit(0);
    }
    else
    {
      tested = ubuntu_pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "imagemagick / libmagick++6 / libmagick++6-dev / libmagick6 / etc");
    }
    
  • NASL familyMandriva Local Security Checks
    NASL idMANDRAKE_MDKSA-2005-107.NASL
    descriptionA heap-based buffer overflow was found in the way that ImageMagick parses PNM files. If an attacker can trick a victim into opening a specially crafted PNM file, the attacker could execute arbitrary code on the victim
    last seen2020-06-01
    modified2020-06-02
    plugin id18584
    published2005-06-28
    reporterThis script is Copyright (C) 2005-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/18584
    titleMandrake Linux Security Advisory : ImageMagick (MDKSA-2005:107)
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2005-413.NASL
    descriptionUpdated ImageMagick packages that fix a buffer overflow issue are now available. This update has been rated as having important security impact by the Red Hat Security Response Team. ImageMagick(TM) is an image display and manipulation tool for the X Window System which can read and write multiple image formats. A heap based buffer overflow bug was found in the way ImageMagick parses PNM files. An attacker could execute arbitrary code on a victim
    last seen2020-06-01
    modified2020-06-02
    plugin id18385
    published2005-05-28
    reporterThis script is Copyright (C) 2005-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/18385
    titleRHEL 3 / 4 : ImageMagick (RHSA-2005:413)
  • NASL familyCentOS Local Security Checks
    NASL idCENTOS_RHSA-2005-413.NASL
    descriptionUpdated ImageMagick packages that fix a buffer overflow issue are now available. This update has been rated as having important security impact by the Red Hat Security Response Team. ImageMagick(TM) is an image display and manipulation tool for the X Window System which can read and write multiple image formats. A heap based buffer overflow bug was found in the way ImageMagick parses PNM files. An attacker could execute arbitrary code on a victim
    last seen2020-06-01
    modified2020-06-02
    plugin id21821
    published2006-07-03
    reporterThis script is Copyright (C) 2006-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/21821
    titleCentOS 3 / 4 : ImageMagick (CESA-2005:413)

Oval

  • accepted2013-04-29T04:00:09.944-04:00
    classvulnerability
    contributors
    • nameAharon Chernin
      organizationSCAP.com, LLC
    • nameDragos Prisaca
      organizationG2, Inc.
    definition_extensions
    • commentThe operating system installed on the system is Red Hat Enterprise Linux 3
      ovaloval:org.mitre.oval:def:11782
    • commentCentOS Linux 3.x
      ovaloval:org.mitre.oval:def:16651
    • commentThe operating system installed on the system is Red Hat Enterprise Linux 4
      ovaloval:org.mitre.oval:def:11831
    • commentCentOS Linux 4.x
      ovaloval:org.mitre.oval:def:16636
    • commentOracle Linux 4.x
      ovaloval:org.mitre.oval:def:15990
    descriptionHeap-based buffer overflow in the ReadPNMImage function in pnm.c for ImageMagick 6.2.1 and earlier allows remote attackers to cause a denial of service (application crash) via a PNM file with a small colors value.
    familyunix
    idoval:org.mitre.oval:def:10003
    statusaccepted
    submitted2010-07-09T03:56:16-04:00
    titleHeap-based buffer overflow in the ReadPNMImage function in pnm.c for ImageMagick 6.2.1 and earlier allows remote attackers to cause a denial of service (application crash) via a PNM file with a small colors value.
    version26
  • accepted2005-08-18T07:37:00.000-04:00
    classvulnerability
    contributors
    nameJay Beale
    organizationBastille Linux
    descriptionHeap-based buffer overflow in the ReadPNMImage function in pnm.c for ImageMagick 6.2.1 and earlier allows remote attackers to cause a denial of service (application crash) via a PNM file with a small colors value.
    familyunix
    idoval:org.mitre.oval:def:711
    statusaccepted
    submitted2005-06-28T12:00:00.000-04:00
    titleImageMagick Buffer Overflow in ReadPNMImage()
    version4

Redhat

advisories
rhsa
idRHSA-2005:413
rpms
  • ImageMagick-0:5.5.6-14
  • ImageMagick-0:6.0.7.1-11
  • ImageMagick-c++-0:5.5.6-14
  • ImageMagick-c++-0:6.0.7.1-11
  • ImageMagick-c++-devel-0:5.5.6-14
  • ImageMagick-c++-devel-0:6.0.7.1-11
  • ImageMagick-debuginfo-0:5.5.6-14
  • ImageMagick-debuginfo-0:6.0.7.1-11
  • ImageMagick-devel-0:5.5.6-14
  • ImageMagick-devel-0:6.0.7.1-11
  • ImageMagick-perl-0:5.5.6-14
  • ImageMagick-perl-0:6.0.7.1-11