Vulnerabilities > CVE-2004-0941 - Remote Buffer overflow vulnerability in GD Graphics Library

047910
CVSS 10.0 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
low complexity
gd-graphics-library
trustix
critical
nessus

Summary

Multiple buffer overflows in the gd graphics library (libgd) 2.0.21 and earlier may allow remote attackers to execute arbitrary code via malformed image files that trigger the overflows due to improper calls to the gdMalloc function, a different set of vulnerabilities than CVE-2004-0990.

Nessus

  • NASL familyMandriva Local Security Checks
    NASL idMANDRAKE_MDKSA-2006-122.NASL
    descriptionMultiple buffer overflows in the gd graphics library (libgd) 2.0.21 and earlier may allow remote attackers to execute arbitrary code via malformed image files that trigger the overflows due to improper calls to the gdMalloc function. One instance in gd_io_dp.c does not appear to be corrected in the embedded copy of GD used in php to build the php-gd package. (CVE-2004-0941) Integer overflows were reported in the GD Graphics Library (libgd) 2.0.28, and possibly other versions. These overflows allow remote attackers to cause a denial of service and possibly execute arbitrary code via PNG image files with large image rows values that lead to a heap-based buffer overflow in the gdImageCreateFromPngCtx() function. PHP, as packaged in Mandriva Linux, contains an embedded copy of the GD library, used to build the php-gd package. (CVE-2004-0990) The c-client library 2000, 2001, or 2004 for PHP 3.x, 4.x, and 5.x, when used in applications that accept user-controlled input for the mailbox argument to the imap_open function, allow remote attackers to obtain access to an IMAP stream data structure and conduct unauthorized IMAP actions. (CVE-2006-1017) Integer overflow in the wordwrap function in string.c in might allow context-dependent attackers to execute arbitrary code via certain long arguments that cause a small buffer to be allocated, which triggers a heap-based buffer overflow in a memcpy function call, a different vulnerability than CVE-2002-1396. (CVE-2006-1990) The previous update for this issue did not resolve the issue on 64bit platforms. The cURL library (libcurl) in PHP 4.4.2 and 5.1.4 allows attackers to bypass safe mode and read files via a file:// request containing nul characters. (CVE-2006-2563) Buffer consumption vulnerability in the tempnam function in PHP 5.1.4 and 4.x before 4.4.3 allows local users to bypass restrictions and create PHP files with fixed names in other directories via a pathname argument longer than MAXPATHLEN, which prevents a unique string from being appended to the filename. (CVE-2006-2660) The LZW decoding in the gdImageCreateFromGifPtr function in the Thomas Boutell graphics draw (GD) library (aka libgd) 2.0.33 allows remote attackers to cause a denial of service (CPU consumption) via malformed GIF data that causes an infinite loop. PHP, as packaged in Mandriva Linux, contains an embedded copy of the GD library, used to build the php-gd package. (CVE-2006-2906) The error_log function in PHP allows local users to bypass safe mode and open_basedir restrictions via a
    last seen2020-06-01
    modified2020-06-02
    plugin id22053
    published2006-07-17
    reporterThis script is Copyright (C) 2006-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/22053
    titleMandrake Linux Security Advisory : php (MDKSA-2006:122)
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Mandrake Linux Security Advisory MDKSA-2006:122. 
    # The text itself is copyright (C) Mandriva S.A.
    #
    
    if (NASL_LEVEL < 3000) exit(0);
    
    include("compat.inc");
    
    if (description)
    {
      script_id(22053);
      script_version ("1.18");
      script_cvs_date("Date: 2019/08/02 13:32:48");
    
      script_cve_id("CVE-2004-0941", "CVE-2004-0990", "CVE-2006-1017", "CVE-2006-1990", "CVE-2006-1991", "CVE-2006-2563", "CVE-2006-2660", "CVE-2006-2906", "CVE-2006-3011", "CVE-2006-3016", "CVE-2006-3017", "CVE-2006-3018", "CVE-2006-4482", "CVE-2006-4483", "CVE-2006-4486");
      script_bugtraq_id(11523);
      script_xref(name:"MDKSA", value:"2006:122");
    
      script_name(english:"Mandrake Linux Security Advisory : php (MDKSA-2006:122)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Mandrake Linux host is missing one or more security
    updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Multiple buffer overflows in the gd graphics library (libgd) 2.0.21
    and earlier may allow remote attackers to execute arbitrary code via
    malformed image files that trigger the overflows due to improper calls
    to the gdMalloc function. One instance in gd_io_dp.c does not appear
    to be corrected in the embedded copy of GD used in php to build the
    php-gd package. (CVE-2004-0941)
    
    Integer overflows were reported in the GD Graphics Library (libgd)
    2.0.28, and possibly other versions. These overflows allow remote
    attackers to cause a denial of service and possibly execute arbitrary
    code via PNG image files with large image rows values that lead to a
    heap-based buffer overflow in the gdImageCreateFromPngCtx() function.
    PHP, as packaged in Mandriva Linux, contains an embedded copy of the
    GD library, used to build the php-gd package. (CVE-2004-0990)
    
    The c-client library 2000, 2001, or 2004 for PHP 3.x, 4.x, and 5.x,
    when used in applications that accept user-controlled input for the
    mailbox argument to the imap_open function, allow remote attackers to
    obtain access to an IMAP stream data structure and conduct
    unauthorized IMAP actions. (CVE-2006-1017)
    
    Integer overflow in the wordwrap function in string.c in might allow
    context-dependent attackers to execute arbitrary code via certain long
    arguments that cause a small buffer to be allocated, which triggers a
    heap-based buffer overflow in a memcpy function call, a different
    vulnerability than CVE-2002-1396. (CVE-2006-1990) The previous update
    for this issue did not resolve the issue on 64bit platforms.
    
    The cURL library (libcurl) in PHP 4.4.2 and 5.1.4 allows attackers to
    bypass safe mode and read files via a file:// request containing nul
    characters. (CVE-2006-2563)
    
    Buffer consumption vulnerability in the tempnam function in PHP 5.1.4
    and 4.x before 4.4.3 allows local users to bypass restrictions and
    create PHP files with fixed names in other directories via a pathname
    argument longer than MAXPATHLEN, which prevents a unique string from
    being appended to the filename. (CVE-2006-2660)
    
    The LZW decoding in the gdImageCreateFromGifPtr function in the Thomas
    Boutell graphics draw (GD) library (aka libgd) 2.0.33 allows remote
    attackers to cause a denial of service (CPU consumption) via malformed
    GIF data that causes an infinite loop. PHP, as packaged in Mandriva
    Linux, contains an embedded copy of the GD library, used to build the
    php-gd package. (CVE-2006-2906)
    
    The error_log function in PHP allows local users to bypass safe mode
    and open_basedir restrictions via a 'php://' or other scheme in the
    third argument, which disables safe mode. (CVE-2006-3011)
    
    An unspecified vulnerability in session.c in PHP before 5.1.3 has
    unknown impact and attack vectors, related to 'certain characters in
    session names', including special characters that are frequently
    associated with CRLF injection, SQL injection, and cross-site
    scripting (XSS) vulnerabilities. NOTE: while the nature of the
    vulnerability is unspecified, it is likely that this is related to a
    violation of an expectation by PHP applications that the session name
    is alphanumeric, as implied in the PHP manual for session_name().
    (CVE-2006-3016)
    
    An unspecified vulnerability in PHP before 5.1.3 can prevent a
    variable from being unset even when the unset function is called,
    which might cause the variable's value to be used in security-relevant
    operations. (CVE-2006-3017)
    
    An unspecified vulnerability in the session extension functionality in
    PHP before 5.1.3 has unkown impact and attack vectors related to heap
    corruption. (CVE-2006-3018)
    
    Multiple heap-based buffer overflows in the (1) str_repeat and (2)
    wordwrap functions in ext/standard/string.c in PHP before 5.1.5, when
    used on a 64-bit system, have unspecified impact and attack vectors, a
    different vulnerability than CVE-2006-1990. (CVE-2006-4482)
    
    The cURL extension files (1) ext/curl/interface.c and (2)
    ext/curl/streams.c in PHP before 5.1.5 permit the
    CURLOPT_FOLLOWLOCATION option when open_basedir or safe_mode is
    enabled, which allows attackers to perform unauthorized actions,
    possibly related to the realpath cache. (CVE-2006-4483)
    
    Unspecified vulnerability in PHP before 5.1.6, when running on a
    64-bit system, has unknown impact and attack vectors related to the
    memory_limit restriction. (CVE-2006-4486)
    
    The GD related issues (CVE-2004-0941, CVE-2004-0990, CVE-2006-2906)
    affect only Corporate 3 and Mandrake Network Firewall 2.
    
    The php-curl issues (CVE-2006-2563, CVE-2006-4483) affect only
    Mandriva 2006.0.
    
    Updated packages have been patched to address all these issues. Once
    these packages have been installed, you will need to restart Apache
    (service httpd restart) in order for the changes to take effect."
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:ND/RL:OF/RC:ND");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
      script_cwe_id(119);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:lib64php5_common5");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:lib64php_common432");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:libphp5_common5");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:libphp_common432");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-cgi");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-cli");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-curl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-fcgi");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-imap");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php432-devel");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandriva:linux:2006");
      script_set_attribute(attribute:"cpe", value:"x-cpe:/o:mandrakesoft:mandrake_linux:le2005");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2006/07/13");
      script_set_attribute(attribute:"plugin_publication_date", value:"2006/07/17");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2006-2019 Tenable Network Security, Inc.");
      script_family(english:"Mandriva Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/Mandrake/release", "Host/Mandrake/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Mandrake/release")) audit(AUDIT_OS_NOT, "Mandriva / Mandake Linux");
    if (!get_kb_item("Host/Mandrake/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu !~ "^(amd64|i[3-6]86|x86_64)$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Mandriva / Mandrake Linux", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"MDK10.2", cpu:"x86_64", reference:"lib64php_common432-4.3.10-7.14.102mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK10.2", cpu:"i386", reference:"libphp_common432-4.3.10-7.14.102mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK10.2", reference:"php-cgi-4.3.10-7.14.102mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK10.2", reference:"php-cli-4.3.10-7.14.102mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK10.2", reference:"php-imap-4.3.10-6.3.102mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK10.2", reference:"php432-devel-4.3.10-7.14.102mdk", yank:"mdk")) flag++;
    
    if (rpm_check(release:"MDK2006.0", cpu:"x86_64", reference:"lib64php5_common5-5.0.4-9.12.20060mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK2006.0", cpu:"i386", reference:"libphp5_common5-5.0.4-9.12.20060mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK2006.0", reference:"php-cgi-5.0.4-9.12.20060mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK2006.0", reference:"php-cli-5.0.4-9.12.20060mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK2006.0", reference:"php-curl-5.0.4-1.3.20060mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK2006.0", reference:"php-devel-5.0.4-9.12.20060mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK2006.0", reference:"php-fcgi-5.0.4-9.12.20060mdk", yank:"mdk")) flag++;
    if (rpm_check(release:"MDK2006.0", reference:"php-imap-5.0.4-2.3.20060mdk", yank:"mdk")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get());
      else security_hole(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2006-0194.NASL
    descriptionUpdated gd packages that fix several buffer overflow flaws are now available. This update has been rated as having moderate security impact by the Red Hat Security Response Team. The gd package contains a graphics library used for the dynamic creation of images such as PNG and JPEG. Several buffer overflow flaws were found in the way gd allocates memory. An attacker could create a carefully crafted image that could execute arbitrary code if opened by a victim using a program linked against the gd library. The Common Vulnerabilities and Exposures project (cve.mitre.org) assigned the name CVE-2004-0941 to these issues. Users of gd should upgrade to these updated packages, which contain a backported patch and is not vulnerable to these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id20856
    published2006-02-05
    reporterThis script is Copyright (C) 2006-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/20856
    titleRHEL 4 : gd (RHSA-2006:0194)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Red Hat Security Advisory RHSA-2006:0194. The text 
    # itself is copyright (C) Red Hat, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(20856);
      script_version ("1.22");
      script_cvs_date("Date: 2019/10/25 13:36:11");
    
      script_cve_id("CVE-2004-0941");
      script_xref(name:"RHSA", value:"2006:0194");
    
      script_name(english:"RHEL 4 : gd (RHSA-2006:0194)");
      script_summary(english:"Checks the rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Red Hat host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Updated gd packages that fix several buffer overflow flaws are now
    available.
    
    This update has been rated as having moderate security impact by the
    Red Hat Security Response Team.
    
    The gd package contains a graphics library used for the dynamic
    creation of images such as PNG and JPEG.
    
    Several buffer overflow flaws were found in the way gd allocates
    memory. An attacker could create a carefully crafted image that could
    execute arbitrary code if opened by a victim using a program linked
    against the gd library. The Common Vulnerabilities and Exposures
    project (cve.mitre.org) assigned the name CVE-2004-0941 to these
    issues.
    
    Users of gd should upgrade to these updated packages, which contain a
    backported patch and is not vulnerable to these issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2004-0941"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/errata/RHSA-2006:0194"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected gd, gd-devel and / or gd-progs packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:gd");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:gd-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:gd-progs");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:4");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2005/02/09");
      script_set_attribute(attribute:"patch_publication_date", value:"2006/02/01");
      script_set_attribute(attribute:"plugin_publication_date", value:"2006/02/05");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2006-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Red Hat Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Red Hat" >!< release) audit(AUDIT_OS_NOT, "Red Hat");
    os_ver = pregmatch(pattern: "Red Hat Enterprise Linux.*release ([0-9]+(\.[0-9]+)?)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Red Hat");
    os_ver = os_ver[1];
    if (! preg(pattern:"^4([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Red Hat 4.x", "Red Hat " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) 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$" && "s390" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Red Hat", cpu);
    
    yum_updateinfo = get_kb_item("Host/RedHat/yum-updateinfo");
    if (!empty_or_null(yum_updateinfo)) 
    {
      rhsa = "RHSA-2006:0194";
      yum_report = redhat_generate_yum_updateinfo_report(rhsa:rhsa);
      if (!empty_or_null(yum_report))
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_HOLE,
          extra      : yum_report 
        );
        exit(0);
      }
      else
      {
        audit_message = "affected by Red Hat security advisory " + rhsa;
        audit(AUDIT_OS_NOT, audit_message);
      }
    }
    else
    {
      flag = 0;
      if (rpm_check(release:"RHEL4", reference:"gd-2.0.28-4.4E.1")) flag++;
      if (rpm_check(release:"RHEL4", reference:"gd-devel-2.0.28-4.4E.1")) flag++;
      if (rpm_check(release:"RHEL4", reference:"gd-progs-2.0.28-4.4E.1")) flag++;
    
      if (flag)
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_HOLE,
          extra      : rpm_report_get() + redhat_report_package_caveat()
        );
        exit(0);
      }
      else
      {
        tested = pkg_tests_get();
        if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
        else audit(AUDIT_PACKAGE_NOT_INSTALLED, "gd / gd-devel / gd-progs");
      }
    }
    
  • NASL familyCentOS Local Security Checks
    NASL idCENTOS_RHSA-2004-638.NASL
    descriptionUpdated gd packages that fix security issues with overflow in various memory allocation calls are now available. [Updated 24 May 2005] Multilib packages have been added to this advisory The gd packages contain a graphics library used for the dynamic creation of images such as PNG and JPEG. Several buffer overflows were reported in various memory allocation calls. An attacker could create a carefully crafted image file in such a way that it could cause ImageMagick to execute arbitrary code when processing the image. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0990 to these issues. While researching the fixes to these overflows, additional buffer overflows were discovered in calls to gdMalloc. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0941 to these issues. Users of gd should upgrade to these updated packages, which contain a backported security patch, and are not vulnerable to these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id21793
    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/21793
    titleCentOS 3 : gd (CESA-2004:638)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Red Hat Security Advisory RHSA-2004:638 and 
    # CentOS Errata and Security Advisory 2004:638 respectively.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(21793);
      script_version("1.18");
      script_cvs_date("Date: 2019/10/25 13:36:02");
    
      script_cve_id("CVE-2004-0941", "CVE-2004-0990");
      script_bugtraq_id(11523);
      script_xref(name:"RHSA", value:"2004:638");
    
      script_name(english:"CentOS 3 : gd (CESA-2004:638)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote CentOS host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Updated gd packages that fix security issues with overflow in various
    memory allocation calls are now available.
    
    [Updated 24 May 2005] Multilib packages have been added to this
    advisory
    
    The gd packages contain a graphics library used for the dynamic
    creation of images such as PNG and JPEG.
    
    Several buffer overflows were reported in various memory allocation
    calls. An attacker could create a carefully crafted image file in such
    a way that it could cause ImageMagick to execute arbitrary code when
    processing the image. The Common Vulnerabilities and Exposures project
    (cve.mitre.org) has assigned the name CVE-2004-0990 to these issues.
    
    While researching the fixes to these overflows, additional buffer
    overflows were discovered in calls to gdMalloc. The Common
    Vulnerabilities and Exposures project (cve.mitre.org) has assigned the
    name CVE-2004-0941 to these issues.
    
    Users of gd should upgrade to these updated packages, which contain a
    backported security patch, and are not vulnerable to these issues."
      );
      # https://lists.centos.org/pipermail/centos-announce/2005-May/011767.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?19f59d09"
      );
      # https://lists.centos.org/pipermail/centos-announce/2005-May/011768.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?7c87e301"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected gd packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:POC/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:centos:centos:gd");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:gd-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:centos:centos:gd-progs");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:centos:centos:3");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2005/02/09");
      script_set_attribute(attribute:"patch_publication_date", value:"2005/05/27");
      script_set_attribute(attribute:"plugin_publication_date", value:"2006/07/03");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2006-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"CentOS Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/CentOS/release", "Host/CentOS/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/CentOS/release");
    if (isnull(release) || "CentOS" >!< release) audit(AUDIT_OS_NOT, "CentOS");
    os_ver = pregmatch(pattern: "CentOS(?: Linux)? release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "CentOS");
    os_ver = os_ver[1];
    if (! preg(pattern:"^3([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "CentOS 3.x", "CentOS " + os_ver);
    
    if (!get_kb_item("Host/CentOS/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && "ia64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "CentOS", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"CentOS-3", cpu:"i386", reference:"gd-1.8.4-12.3.1")) flag++;
    if (rpm_check(release:"CentOS-3", cpu:"x86_64", reference:"gd-1.8.4-12.3.1")) flag++;
    if (rpm_check(release:"CentOS-3", cpu:"i386", reference:"gd-devel-1.8.4-12.3.1")) flag++;
    if (rpm_check(release:"CentOS-3", cpu:"x86_64", reference:"gd-devel-1.8.4-12.3.1")) flag++;
    if (rpm_check(release:"CentOS-3", cpu:"i386", reference:"gd-progs-1.8.4-12.3.1")) flag++;
    if (rpm_check(release:"CentOS-3", cpu:"x86_64", reference:"gd-progs-1.8.4-12.3.1")) flag++;
    
    
    if (flag)
    {
      security_report_v4(
        port       : 0,
        severity   : SECURITY_HOLE,
        extra      : rpm_report_get()
      );
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "gd / gd-devel / gd-progs");
    }
    
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-601.NASL
    descriptionMore potential integer overflows have been found in the GD graphics library which weren
    last seen2020-06-01
    modified2020-06-02
    plugin id15844
    published2004-11-30
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/15844
    titleDebian DSA-601-1 : libgd - integer overflow
  • NASL familyMandriva Local Security Checks
    NASL idMANDRAKE_MDKSA-2006-114.NASL
    descriptionMultiple buffer overflows in the gd graphics library (libgd) 2.0.21 and earlier may allow remote attackers to execute arbitrary code via malformed image files that trigger the overflows due to improper calls to the gdMalloc function. (CVE-2004-0941) Integer overflows were reported in the GD Graphics Library (libgd) 2.0.28, and possibly other versions. These overflows allow remote attackers to cause a denial of service and possibly execute arbitrary code via PNG image files with large image rows values that lead to a heap-based buffer overflow in the gdImageCreateFromPngCtx() function. Libwmf contains an embedded copy of the GD library code. (CVE-2004-0990) Update : The previous update incorrectly attributed the advisory text to CVE-2004-0941, while it should have been CVE-2004-0990. Additional review of the code found fixes for CVE-2004-0941 were missing and have also been included in this update.
    last seen2020-06-01
    modified2020-06-02
    plugin id21776
    published2006-06-29
    reporterThis script is Copyright (C) 2006-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/21776
    titleMandrake Linux Security Advisory : libwmf (MDKSA-2006:114-1)
  • NASL familySlackware Local Security Checks
    NASL idSLACKWARE_SSA_2018-120-01.NASL
    descriptionNew libwmf packages are available for Slackware 13.0, 13.1, 13.37, 14.0, 14.1, 14.2, and -current to fix security issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id109432
    published2018-05-01
    reporterThis script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/109432
    titleSlackware 13.0 / 13.1 / 13.37 / 14.0 / 14.1 / 14.2 / current : libwmf (SSA:2018-120-01)
  • NASL familyMandriva Local Security Checks
    NASL idMANDRAKE_MDKSA-2004-132.NASL
    descriptionInteger overflows were reported in the GD Graphics Library (libgd) 2.0.28, and possibly other versions. These overflows allow remote attackers to cause a denial of service and possibly execute arbitrary code via PNG image files with large image rows values that lead to a heap-based buffer overflow in the gdImageCreateFromPngCtx() function. The updated packages have been patched to prevent these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id15737
    published2004-11-17
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/15737
    titleMandrake Linux Security Advisory : gd (MDKSA-2004:132)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2004-412.NASL
    descriptionSeveral buffer overflows were reported in various memory allocation calls. An attacker could create a carefully crafted image file in such a way that it could cause ImageMagick to execute arbitrary code when processing the image. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0990 to these issues. Whilst researching the fixes to these overflows, additional buffer overflows were discovered in calls to gdMalloc. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0941 to these issues. Users of gd should upgrade to these updated packages, which contain a backported security patch, and are not vulnerable to these issues. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id15733
    published2004-11-17
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/15733
    titleFedora Core 3 : gd-2.0.28-1.30.1 (2004-412)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2004-411.NASL
    descriptionSeveral buffer overflows were reported in various memory allocation calls. An attacker could create a carefully crafted image file in such a way that it could cause ImageMagick to execute arbitrary code when processing the image. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0990 to these issues. Whilst researching the fixes to these overflows, additional buffer overflows were discovered in calls to gdMalloc. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0941 to these issues. Users of gd should upgrade to these updated packages, which contain a backported security patch, and are not vulnerable to these issues. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id15732
    published2004-11-17
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/15732
    titleFedora Core 2 : gd-2.0.21-5.20.1 (2004-411)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-602.NASL
    descriptionMore potential integer overflows have been found in the GD graphics library which weren
    last seen2020-06-01
    modified2020-06-02
    plugin id15845
    published2004-11-30
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/15845
    titleDebian DSA-602-1 : libgd2 - integer overflow
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_CA139C7F2A8C11E5A4A5002590263BF5.NASL
    descriptionMitre reports : Multiple buffer overflows in the gd graphics library (libgd) 2.0.21 and earlier may allow remote attackers to execute arbitrary code via malformed image files that trigger the overflows due to improper calls to the gdMalloc function, a different set of vulnerabilities than CVE-2004-0990. Buffer overflow in the gdImageStringFTEx function in gdft.c in GD Graphics Library 2.0.33 and earlier allows remote attackers to cause a denial of service (application crash) and possibly execute arbitrary code via a crafted string with a JIS encoded font. The gdPngReadData function in libgd 2.0.34 allows user-assisted attackers to cause a denial of service (CPU consumption) via a crafted PNG image with truncated data, which causes an infinite loop in the png_read_info function in libpng. Integer overflow in gdImageCreateTrueColor function in the GD Graphics Library (libgd) before 2.0.35 allows user-assisted remote attackers to have unspecified attack vectors and impact. The gdImageCreateXbm function in the GD Graphics Library (libgd) before 2.0.35 allows user-assisted remote attackers to cause a denial of service (crash) via unspecified vectors involving a gdImageCreate failure. The (a) imagearc and (b) imagefilledarc functions in GD Graphics Library (libgd) before 2.0.35 allow attackers to cause a denial of service (CPU consumption) via a large (1) start or (2) end angle degree value. The _gdGetColors function in gd_gd.c in PHP 5.2.11 and 5.3.x before 5.3.1, and the GD Graphics Library 2.x, does not properly verify a certain colorsTotal structure member, which might allow remote attackers to conduct buffer overflow or buffer over-read attacks via a crafted GD file, a different vulnerability than CVE-2009-3293. NOTE: some of these details are obtained from third party information. Heap-based buffer overflow in libwmf 0.2.8.4 allows remote attackers to cause a denial of service (crash) or possibly execute arbitrary code via a crafted BMP image. meta.h in libwmf 0.2.8.4 allows remote attackers to cause a denial of service (out-of-bounds read) via a crafted WMF file. Use-after-free vulnerability in libwmf 0.2.8.4 allows remote attackers to cause a denial of service (crash) via a crafted WMF file to the (1) wmf2gd or (2) wmf2eps command. Heap-based buffer overflow in the DecodeImage function in libwmf 0.2.8.4 allows remote attackers to cause a denial of service (crash) or possibly execute arbitrary code via a crafted
    last seen2020-06-01
    modified2020-06-02
    plugin id84782
    published2015-07-16
    reporterThis script is Copyright (C) 2015-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/84782
    titleFreeBSD : libwmf -- multiple vulnerabilities (ca139c7f-2a8c-11e5-a4a5-002590263bf5)
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-25-1.NASL
    descriptionCAN-2004-0990 described several more buffer overflows which had been discovered in libgd2
    last seen2020-06-01
    modified2020-06-02
    plugin id20640
    published2006-01-15
    reporterUbuntu Security Notice (C) 2004-2019 Canonical, Inc. / NASL script (C) 2006-2016 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/20640
    titleUbuntu 4.10 : libgd2 vulnerability (USN-25-1)
  • NASL familyCentOS Local Security Checks
    NASL idCENTOS_RHSA-2006-0194.NASL
    descriptionUpdated gd packages that fix several buffer overflow flaws are now available. This update has been rated as having moderate security impact by the Red Hat Security Response Team. The gd package contains a graphics library used for the dynamic creation of images such as PNG and JPEG. Several buffer overflow flaws were found in the way gd allocates memory. An attacker could create a carefully crafted image that could execute arbitrary code if opened by a victim using a program linked against the gd library. The Common Vulnerabilities and Exposures project (cve.mitre.org) assigned the name CVE-2004-0941 to these issues. Users of gd should upgrade to these updated packages, which contain a backported patch and is not vulnerable to these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id21982
    published2006-07-05
    reporterThis script is Copyright (C) 2006-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/21982
    titleCentOS 4 : gd (CESA-2006:0194)
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-33-1.NASL
    descriptionCAN-2004-0990 described several buffer overflows which had been discovered in libgd
    last seen2020-06-01
    modified2020-06-02
    plugin id20649
    published2006-01-15
    reporterUbuntu Security Notice (C) 2004-2019 Canonical, Inc. / NASL script (C) 2006-2016 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/20649
    titleUbuntu 4.10 : libgd vulnerabilities (USN-33-1)
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2004-638.NASL
    descriptionUpdated gd packages that fix security issues with overflow in various memory allocation calls are now available. [Updated 24 May 2005] Multilib packages have been added to this advisory The gd packages contain a graphics library used for the dynamic creation of images such as PNG and JPEG. Several buffer overflows were reported in various memory allocation calls. An attacker could create a carefully crafted image file in such a way that it could cause ImageMagick to execute arbitrary code when processing the image. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0990 to these issues. While researching the fixes to these overflows, additional buffer overflows were discovered in calls to gdMalloc. The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2004-0941 to these issues. Users of gd should upgrade to these updated packages, which contain a backported security patch, and are not vulnerable to these issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id15995
    published2004-12-17
    reporterThis script is Copyright (C) 2004-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/15995
    titleRHEL 2.1 / 3 : gd (RHSA-2004:638)
  • NASL familyMandriva Local Security Checks
    NASL idMANDRAKE_MDKSA-2006-113.NASL
    descriptionInteger overflows were reported in the GD Graphics Library (libgd) 2.0.28, and possibly other versions. These overflows allow remote attackers to cause a denial of service and possibly execute arbitrary code via PNG image files with large image rows values that lead to a heap-based buffer overflow in the gdImageCreateFromPngCtx() function. Tetex contains an embedded copy of the GD library code. (CVE-2004-0990) The LZW decoding in the gdImageCreateFromGifPtr function in the Thomas Boutell graphics draw (GD) library (aka libgd) 2.0.33 allows remote attackers to cause a denial of service (CPU consumption) via malformed GIF data that causes an infinite loop. Tetex contains an embedded copy of the GD library code. (CVE-2006-2906) Updated packages have been patched to address both issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id21770
    published2006-06-28
    reporterThis script is Copyright (C) 2006-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/21770
    titleMandrake Linux Security Advisory : tetex (MDKSA-2006:113)

Oval

  • accepted2013-04-29T04:12:04.751-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
    descriptionMultiple buffer overflows in the gd graphics library (libgd) 2.0.21 and earlier may allow remote attackers to execute arbitrary code via malformed image files that trigger the overflows due to improper calls to the gdMalloc function, a different set of vulnerabilities than CVE-2004-0990.
    familyunix
    idoval:org.mitre.oval:def:11176
    statusaccepted
    submitted2010-07-09T03:56:16-04:00
    titleMultiple buffer overflows in the gd graphics library (libgd) 2.0.21 and earlier may allow remote attackers to execute arbitrary code via malformed image files that trigger the overflows due to improper calls to the gdMalloc function, a different set of vulnerabilities than CVE-2004-0990.
    version26
  • accepted2005-08-18T07:37:00.000-04:00
    classvulnerability
    contributors
    nameJay Beale
    organizationBastille Linux
    descriptionMultiple buffer overflows in the gd graphics library (libgd) 2.0.21 and earlier may allow remote attackers to execute arbitrary code via malformed image files that trigger the overflows due to improper calls to the gdMalloc function, a different set of vulnerabilities than CVE-2004-0990.
    familyunix
    idoval:org.mitre.oval:def:1195
    statusaccepted
    submitted2005-06-27T12:00:00.000-04:00
    titleMultiple Buffer Overflows in libgd
    version2

Redhat

advisories
  • bugzilla
    id175413
    titleCVE-2004-0941 gd: additional overflows
    oval
    OR
    • commentRed Hat Enterprise Linux must be installed
      ovaloval:com.redhat.rhba:tst:20070304026
    • AND
      • commentRed Hat Enterprise Linux 4 is installed
        ovaloval:com.redhat.rhba:tst:20070304025
      • OR
        • AND
          • commentgd-progs is earlier than 0:2.0.28-4.4E.1
            ovaloval:com.redhat.rhsa:tst:20060194001
          • commentgd-progs is signed with Red Hat master key
            ovaloval:com.redhat.rhsa:tst:20060194002
        • AND
          • commentgd-devel is earlier than 0:2.0.28-4.4E.1
            ovaloval:com.redhat.rhsa:tst:20060194003
          • commentgd-devel is signed with Red Hat master key
            ovaloval:com.redhat.rhsa:tst:20060194004
        • AND
          • commentgd is earlier than 0:2.0.28-4.4E.1
            ovaloval:com.redhat.rhsa:tst:20060194005
          • commentgd is signed with Red Hat master key
            ovaloval:com.redhat.rhsa:tst:20060194006
    rhsa
    idRHSA-2006:0194
    released2006-02-01
    severityModerate
    titleRHSA-2006:0194: gd security update (Moderate)
  • rhsa
    idRHSA-2004:638
rpms
  • gd-0:1.8.4-12.3.1
  • gd-debuginfo-0:1.8.4-12.3.1
  • gd-devel-0:1.8.4-12.3.1
  • gd-progs-0:1.8.4-12.3.1
  • gd-0:2.0.28-4.4E.1
  • gd-debuginfo-0:2.0.28-4.4E.1
  • gd-devel-0:2.0.28-4.4E.1
  • gd-progs-0:2.0.28-4.4E.1

Statements

contributorMark J Cox
lastmodified2007-03-14
organizationRed Hat
statementRed Hat Enterprise Linux 5 is not vulnerable to this issue as it contains a backported patch.