Vulnerabilities > CVE-2003-0102 - Local Stack Overflow Code Execution vulnerability in File

047910
CVSS 4.6 - MEDIUM
Attack vector
LOCAL
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
local
low complexity
file
netbsd
nessus
exploit available

Summary

Buffer overflow in tryelf() in readelf.c of the file command allows attackers to execute arbitrary code as the user running file, possibly via a large entity size value in an ELF header (elfhdr.e_shentsize).

Exploit-Db

  • descriptionFile 3.x Local Stack Overflow Code Execution Vulnerability (2). CVE-2003-0102. Local exploit for unix platform
    idEDB-ID:22325
    last seen2016-02-02
    modified2003-03-04
    published2003-03-04
    reporterlem0nxx
    sourcehttps://www.exploit-db.com/download/22325/
    titleFile 3.x - Local Stack Overflow Code Execution Vulnerability 2
  • descriptionFile 3.x Local Stack Overflow Code Execution Vulnerability (1). CVE-2003-0102. Local exploit for unix platform
    idEDB-ID:22324
    last seen2016-02-02
    modified2003-03-04
    published2003-03-04
    reporterlem0n
    sourcehttps://www.exploit-db.com/download/22324/
    titleFile 3.x - Local Stack Overflow Code Execution Vulnerability 1

Nessus

  • NASL familySuSE Local Security Checks
    NASL idSUSE_SA_2003_017.NASL
    descriptionThe remote host is missing the patch for the advisory SUSE-SA:2003:017 (file). The file command can be used to determine the type of files. iDEFENSE published a security report about a buffer overflow in the handling-routines for the ELF file-format. In conjunction with other mechanisms like print-filters, cron-jobs, eMail-scanners (like AMaViS) and alike this vulnerability can be used to gain higher privileges or to compromise the system remotely. There is no temporary fix known other then updating the system. Please download the update package for your distribution and verify its integrity by the methods listed in section 3) of this announcement. Then, install the package using the command
    last seen2020-06-01
    modified2020-06-02
    plugin id13787
    published2004-07-25
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/13787
    titleSUSE-SA:2003:017: file
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # This plugin text was extracted from SuSE Security Advisory SUSE-SA:2003:017
    #
    
    
    if ( ! defined_func("bn_random") ) exit(0);
    
    include("compat.inc");
    
    if(description)
    {
     script_id(13787);
     script_bugtraq_id(7008);
     script_bugtraq_id(7009);
     script_version ("1.22");
     
     name["english"] = "SUSE-SA:2003:017: file";
     
     script_name(english:name["english"]);
     
     script_set_attribute(attribute:"synopsis", value:
    "The remote host is missing a vendor-supplied security patch" );
     script_set_attribute(attribute:"description", value:
    "The remote host is missing the patch for the advisory SUSE-SA:2003:017 (file).
    
    
    The file command can be used to determine the type of files.
    iDEFENSE published a security report about a buffer overflow in the
    handling-routines for the ELF file-format.
    In conjunction with other mechanisms like print-filters, cron-jobs,
    eMail-scanners (like AMaViS) and alike this vulnerability can be used
    to gain higher privileges or to compromise the system remotely.
    
    There is no temporary fix known other then updating the system.
    
    Please download the update package for your distribution and verify its
    integrity by the methods listed in section 3) of this announcement.
    Then, install the package using the command 'rpm -Fhv file.rpm' to apply
    the update." );
     script_set_attribute(attribute:"solution", value:
    "http://www.suse.de/security/2003_017_file.html" );
     script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/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_publication_date", value: "2004/07/25");
     script_cvs_date("Date: 2019/10/25 13:36:27");
     script_end_attributes();
    
     
     summary["english"] = "Check for the version of the file package";
     script_cve_id("CVE-2003-0102", "CVE-2003-1092");
     script_summary(english:summary["english"]);
     
     script_category(ACT_GATHER_INFO);
     
     script_copyright(english:"This script is Copyright (C) 2004-2019 Tenable Network Security, Inc.");
     family["english"] = "SuSE Local Security Checks";
     script_family(english:family["english"]);
     
     script_dependencies("ssh_get_info.nasl");
     script_require_keys("Host/SuSE/rpm-list");
     exit(0);
    }
    
    include("rpm.inc");
    if ( rpm_check( reference:"file-3.32-118", release:"SUSE7.1") )
    {
     security_hole(0);
     exit(0);
    }
    if ( rpm_check( reference:"file-3.33-85", release:"SUSE7.3") )
    {
     security_hole(0);
     exit(0);
    }
    if ( rpm_check( reference:"file-3.37-206", release:"SUSE8.0") )
    {
     security_hole(0);
     exit(0);
    }
    if ( rpm_check( reference:"file-3.37-206", release:"SUSE8.1") )
    {
     security_hole(0);
     exit(0);
    }
    if (rpm_exists(rpm:"file-", release:"SUSE7.1")
     || rpm_exists(rpm:"file-", release:"SUSE7.3")
     || rpm_exists(rpm:"file-", release:"SUSE8.0")
     || rpm_exists(rpm:"file-", release:"SUSE8.1") )
    {
     set_kb_item(name:"CVE-2003-0102", value:TRUE);
    }
    
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2003-087.NASL
    descriptionUpdated file packages are available to close a buffer overflow vulnerability. [Updated 12 March 2003] Added packages for Red Hat Enterprise Linux ES and Red Hat Enterprise Linux WS The file command is used to identify a particular file according to the type of data contained by the file. The file utility before version 3.41 contains a buffer overflow vulnerability in the ELF parsing routines. This vulnerability may allow an attacker to create a carefully crafted binary which can cause arbitrary code to run if a victim runs the file command against that binary. On some distributions it may also be possible to trigger this file command vulnerability by encouraging the victim to use the less command on an exploited file name so that it will be processed by the lesspipe.sh script. All users are advised to update to these erratum packages which contain a backported patch to correct this vulnerability. Red Hat would like to thank iDefense for disclosing this issue and zen-parse for discussion of some of the implications.
    last seen2020-06-01
    modified2020-06-02
    plugin id12376
    published2004-07-06
    reporterThis script is Copyright (C) 2004-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/12376
    titleRHEL 2.1 : file (RHSA-2003:087)
    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-2003:087. The text 
    # itself is copyright (C) Red Hat, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(12376);
      script_version ("1.24");
      script_cvs_date("Date: 2019/10/25 13:36:10");
    
      script_cve_id("CVE-2003-0102");
      script_xref(name:"RHSA", value:"2003:087");
    
      script_name(english:"RHEL 2.1 : file (RHSA-2003:087)");
      script_summary(english:"Checks the rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Red Hat host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Updated file packages are available to close a buffer overflow
    vulnerability.
    
    [Updated 12 March 2003] Added packages for Red Hat Enterprise Linux ES
    and Red Hat Enterprise Linux WS
    
    The file command is used to identify a particular file according to
    the type of data contained by the file.
    
    The file utility before version 3.41 contains a buffer overflow
    vulnerability in the ELF parsing routines. This vulnerability may
    allow an attacker to create a carefully crafted binary which can cause
    arbitrary code to run if a victim runs the file command against that
    binary.
    
    On some distributions it may also be possible to trigger this file
    command vulnerability by encouraging the victim to use the less
    command on an exploited file name so that it will be processed by the
    lesspipe.sh script.
    
    All users are advised to update to these erratum packages which
    contain a backported patch to correct this vulnerability.
    
    Red Hat would like to thank iDefense for disclosing this issue and
    zen-parse for discussion of some of the implications."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2003-0102"
      );
      # http://www.idefense.com/advisory/03.04.03.txt
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.accenture.com/us-en/service-idefense-security-intelligence"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/errata/RHSA-2003:087"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected file package.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:P/I:P/A:P");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:file");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:2.1");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2003/03/18");
      script_set_attribute(attribute:"patch_publication_date", value:"2003/03/19");
      script_set_attribute(attribute:"plugin_publication_date", value:"2004/07/06");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2004-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:"^2\.1([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Red Hat 2.1", "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);
    if (cpu !~ "^i[3-6]86$") audit(AUDIT_ARCH_NOT, "i386", cpu);
    
    yum_updateinfo = get_kb_item("Host/RedHat/yum-updateinfo");
    if (!empty_or_null(yum_updateinfo)) 
    {
      rhsa = "RHSA-2003:087";
      yum_report = redhat_generate_yum_updateinfo_report(rhsa:rhsa);
      if (!empty_or_null(yum_report))
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          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:"RHEL2.1", cpu:"i386", reference:"file-3.39-8.7x")) flag++;
    
      if (flag)
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          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, "file");
      }
    }
    
  • NASL familyMandriva Local Security Checks
    NASL idMANDRAKE_MDKSA-2003-030.NASL
    descriptionA memory allocation problem in file was found by Jeff Johnson, and a stack overflow corruption problem was found by David Endler. These problems have been corrected in file version 3.41 and likely affect all previous version. These problems pose a security threat as they can be used to execute arbitrary code by an attacker under the privileges of another user. Note that the attacker must first somehow convince the target user to execute file against a specially crafted file that triggers the buffer overflow in file. Update : The 8.2 and 9.0 packages installed data in a different directory than where they should have been installed, which broke compatability with a small number of programs. These updated packages place those files back in the appropriate location.
    last seen2020-06-01
    modified2020-06-02
    plugin id14014
    published2004-07-31
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/14014
    titleMandrake Linux Security Advisory : file (MDKSA-2003:030-1)
    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-2003:030. 
    # The text itself is copyright (C) Mandriva S.A.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(14014);
      script_version ("1.17");
      script_cvs_date("Date: 2019/08/02 13:32:46");
    
      script_cve_id("CVE-2003-0102");
      script_xref(name:"MDKSA", value:"2003:030-1");
    
      script_name(english:"Mandrake Linux Security Advisory : file (MDKSA-2003:030-1)");
      script_summary(english:"Checks rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Mandrake Linux host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "A memory allocation problem in file was found by Jeff Johnson, and a
    stack overflow corruption problem was found by David Endler. These
    problems have been corrected in file version 3.41 and likely affect
    all previous version. These problems pose a security threat as they
    can be used to execute arbitrary code by an attacker under the
    privileges of another user. Note that the attacker must first somehow
    convince the target user to execute file against a specially crafted
    file that triggers the buffer overflow in file.
    
    Update :
    
    The 8.2 and 9.0 packages installed data in a different directory than
    where they should have been installed, which broke compatability with
    a small number of programs. These updated packages place those files
    back in the appropriate location."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.idefense.com/advisory/03.04.03.txt"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected file package.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:P/I:P/A:P");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:file");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandrakesoft:mandrake_linux:8.2");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandrakesoft:mandrake_linux:9.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2003/04/17");
      script_set_attribute(attribute:"plugin_publication_date", value:"2004/07/31");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2004-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:"MDK8.2", cpu:"i386", reference:"file-3.41-1.2mdk", yank:"mdk")) flag++;
    
    if (rpm_check(release:"MDK9.0", cpu:"i386", reference:"file-3.41-1.2mdk", yank:"mdk")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-260.NASL
    descriptioniDEFENSE discovered a buffer overflow vulnerability in the ELF format parsing of the
    last seen2020-06-01
    modified2020-06-02
    plugin id15097
    published2004-09-29
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/15097
    titleDebian DSA-260-1 : file - buffer overflow
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Debian Security Advisory DSA-260. The text 
    # itself is copyright (C) Software in the Public Interest, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(15097);
      script_version("1.15");
      script_cvs_date("Date: 2019/08/02 13:32:17");
    
      script_cve_id("CVE-2003-0102");
      script_xref(name:"DSA", value:"260");
    
      script_name(english:"Debian DSA-260-1 : file - buffer overflow");
      script_summary(english:"Checks dpkg output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Debian host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "iDEFENSE discovered a buffer overflow vulnerability in the ELF format
    parsing of the 'file' command, one which can be used to execute
    arbitrary code with the privileges of the user running the command.
    The vulnerability can be exploited by crafting a special ELF binary
    which is then input to file. This could be accomplished by leaving the
    binary on the file system and waiting for someone to use file to
    identify it, or by passing it to a service that uses file to classify
    input. (For example, some printer filters run file to determine how to
    process input going to a printer.)
    
    Fixed packages are available in version 3.28-1.potato.1 for Debian 2.2
    (potato) and version 3.37-3.1.woody.1 for Debian 3.0 (woody). We
    recommend you upgrade your file package immediately."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.debian.org/security/2003/dsa-260"
      );
      script_set_attribute(attribute:"solution", value:"Upgrade the affected file package.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:P/I:P/A:P");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:file");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:2.2");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:3.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2003/03/13");
      script_set_attribute(attribute:"plugin_publication_date", value:"2004/09/29");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2004-2019 Tenable Network Security, Inc.");
      script_family(english:"Debian Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("debian_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian");
    if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (deb_check(release:"2.2", prefix:"file", reference:"3.28-1.potato.1")) flag++;
    if (deb_check(release:"3.0", prefix:"file", reference:"3.37-3.1.woody.1")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:deb_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    

Redhat

advisories
  • rhsa
    idRHSA-2003:086
  • rhsa
    idRHSA-2003:087