Vulnerabilities > CVE-2008-5984 - Remote Command Execution vulnerability in DIA 0.96.1

047910
CVSS 6.9 - MEDIUM
Attack vector
LOCAL
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
local
dia
nessus

Summary

Untrusted search path vulnerability in the Python plugin in Dia 0.96.1, and possibly other versions, allows local users to execute arbitrary code via a Trojan horse Python file in the current working directory, related to a vulnerability in the PySys_SetArgv function (CVE-2008-5983).

Vulnerable Configurations

Part Description Count
Application
Dia
1

Nessus

  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2009-046.NASL
    descriptionPython has a variable called sys.path that contains all paths where Python loads modules by using import scripting procedure. A wrong handling of that variable enables local attackers to execute arbitrary code via Python scripting in the current dia working directory (CVE-2008-5984). This update provides fix for that vulnerability. Update : Packages for 2008.0 are provided for Corporate Desktop 2008.0 customers
    last seen2020-06-01
    modified2020-06-02
    plugin id43074
    published2009-12-09
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/43074
    titleMandriva Linux Security Advisory : dia (MDVSA-2009:046-1)
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Mandriva Linux Security Advisory MDVSA-2009:046. 
    # The text itself is copyright (C) Mandriva S.A.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(43074);
      script_version("1.17");
      script_cvs_date("Date: 2019/08/02 13:32:51");
    
      script_cve_id("CVE-2008-5984");
      script_bugtraq_id(33448);
      script_xref(name:"MDVSA", value:"2009:046-1");
    
      script_name(english:"Mandriva Linux Security Advisory : dia (MDVSA-2009:046-1)");
      script_summary(english:"Checks rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Mandriva Linux host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Python has a variable called sys.path that contains all paths where
    Python loads modules by using import scripting procedure. A wrong
    handling of that variable enables local attackers to execute arbitrary
    code via Python scripting in the current dia working directory
    (CVE-2008-5984).
    
    This update provides fix for that vulnerability.
    
    Update :
    
    Packages for 2008.0 are provided for Corporate Desktop 2008.0
    customers"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected dia package.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:ND");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:dia");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandriva:linux:2008.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2009/12/08");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/12/09");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      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:"MDK2008.0", reference:"dia-0.96.1-2.1mdv2008.0", yank:"mdv")) 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 familyFedora Local Security Checks
    NASL idFEDORA_2009-1057.NASL
    descriptionFilter out untrusted python modules search path to remove the possibility to run arbitrary code on the user
    last seen2020-06-01
    modified2020-06-02
    plugin id35466
    published2009-01-27
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/35466
    titleFedora 9 : dia-0.96.1-7.fc9 (2009-1057)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Fedora Security Advisory 2009-1057.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(35466);
      script_version ("1.15");
      script_cvs_date("Date: 2019/08/02 13:32:28");
    
      script_cve_id("CVE-2008-5984");
      script_bugtraq_id(33448);
      script_xref(name:"FEDORA", value:"2009-1057");
    
      script_name(english:"Fedora 9 : dia-0.96.1-7.fc9 (2009-1057)");
      script_summary(english:"Checks rpm output for the updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Fedora host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Filter out untrusted python modules search path to remove the
    possibility to run arbitrary code on the user's system if there is a
    python file in dia's working directory named the same as one that
    dia's python scripts try to import.
    
    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."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=481551"
      );
      # https://lists.fedoraproject.org/pipermail/package-announce/2009-January/019506.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?a2a158ed"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected dia package.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:ND");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:dia");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:9");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2009/01/27");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/01/27");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Fedora Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/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/RedHat/release");
    if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora");
    os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora");
    os_ver = os_ver[1];
    if (! ereg(pattern:"^9([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 9.x", "Fedora " + 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$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Fedora", cpu);
    
    flag = 0;
    if (rpm_check(release:"FC9", reference:"dia-0.96.1-7.fc9")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "dia");
    }
    
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_25EB365CFD1111DD8424C213DE35965D.NASL
    descriptionSecurity Focus reports : An attacker could exploit this issue by enticing an unsuspecting victim to execute the vulnerable application in a directory containing a malicious Python file. A successful exploit will allow arbitrary Python commands to run within the privileges of the currently logged-in user.
    last seen2020-06-01
    modified2020-06-02
    plugin id35701
    published2009-02-18
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/35701
    titleFreeBSD : dia -- remote command execution vulnerability (25eb365c-fd11-11dd-8424-c213de35965d)
    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(35701);
      script_version("1.18");
      script_cvs_date("Date: 2019/08/02 13:32:39");
    
      script_cve_id("CVE-2008-5984");
      script_bugtraq_id(33448);
      script_xref(name:"Secunia", value:"33672");
    
      script_name(english:"FreeBSD : dia -- remote command execution vulnerability (25eb365c-fd11-11dd-8424-c213de35965d)");
      script_summary(english:"Checks for updated package in pkg_info output");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote FreeBSD host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Security Focus reports :
    
    An attacker could exploit this issue by enticing an unsuspecting
    victim to execute the vulnerable application in a directory containing
    a malicious Python file. A successful exploit will allow arbitrary
    Python commands to run within the privileges of the currently
    logged-in user."
      );
      # https://vuxml.freebsd.org/freebsd/25eb365c-fd11-11dd-8424-c213de35965d.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?2bcd95aa"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected package.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:ND");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:dia");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2009/01/26");
      script_set_attribute(attribute:"patch_publication_date", value:"2009/02/17");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/02/18");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-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:"dia<0.96.1_6,1")) 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 familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2011-0027.NASL
    descriptionUpdated python packages that fix multiple security issues, several bugs, and add two enhancements are now available for Red Hat Enterprise Linux 5. The Red Hat Security Response Team has rated this update as having low security impact. Common Vulnerability Scoring System (CVSS) base scores, which give detailed severity ratings, are available for each vulnerability from the CVE links in the References section. Python is an interpreted, interactive, object-oriented programming language. It was found that many applications embedding the Python interpreter did not specify a valid full path to the script or application when calling the PySys_SetArgv API function, which could result in the addition of the current working directory to the module search path (sys.path). A local attacker able to trick a victim into running such an application in an attacker-controlled directory could use this flaw to execute code with the victim
    last seen2020-06-01
    modified2020-06-02
    plugin id51524
    published2011-01-14
    reporterThis script is Copyright (C) 2011-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/51524
    titleRHEL 5 : python (RHSA-2011:0027)
    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-2011:0027. The text 
    # itself is copyright (C) Red Hat, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(51524);
      script_version ("1.17");
      script_cvs_date("Date: 2019/10/25 13:36:15");
    
      script_cve_id("CVE-2008-5983", "CVE-2008-5984", "CVE-2008-5985", "CVE-2008-5986", "CVE-2008-5987", "CVE-2009-0314", "CVE-2009-0315", "CVE-2009-0316", "CVE-2009-0317", "CVE-2009-4134", "CVE-2010-1449", "CVE-2010-1450", "CVE-2010-1634", "CVE-2010-2089");
      script_bugtraq_id(40361, 40363, 40365, 40370, 40862, 40863);
      script_xref(name:"RHSA", value:"2011:0027");
    
      script_name(english:"RHEL 5 : python (RHSA-2011:0027)");
      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 python packages that fix multiple security issues, several
    bugs, and add two enhancements are now available for Red Hat
    Enterprise Linux 5.
    
    The Red Hat Security Response Team has rated this update as having low
    security impact. Common Vulnerability Scoring System (CVSS) base
    scores, which give detailed severity ratings, are available for each
    vulnerability from the CVE links in the References section.
    
    Python is an interpreted, interactive, object-oriented programming
    language.
    
    It was found that many applications embedding the Python interpreter
    did not specify a valid full path to the script or application when
    calling the PySys_SetArgv API function, which could result in the
    addition of the current working directory to the module search path
    (sys.path). A local attacker able to trick a victim into running such
    an application in an attacker-controlled directory could use this flaw
    to execute code with the victim's privileges. This update adds the
    PySys_SetArgvEx API. Developers can modify their applications to use
    this new API, which sets sys.argv without modifying sys.path.
    (CVE-2008-5983)
    
    Multiple flaws were found in the Python rgbimg module. If an
    application written in Python was using the rgbimg module and loaded a
    specially crafted SGI image file, it could cause the application to
    crash or, possibly, execute arbitrary code with the privileges of the
    user running the application. (CVE-2009-4134, CVE-2010-1449,
    CVE-2010-1450)
    
    Multiple flaws were found in the Python audioop module. Supplying
    certain inputs could cause the audioop module to crash or, possibly,
    execute arbitrary code. (CVE-2010-1634, CVE-2010-2089)
    
    This update also fixes the following bugs :
    
    * When starting a child process from the subprocess module in Python
    2.4, the parent process could leak file descriptors if an error
    occurred. This update resolves the issue. (BZ#609017)
    
    * Prior to Python 2.7, programs that used 'ulimit -n' to enable
    communication with large numbers of subprocesses could still monitor
    only 1024 file descriptors at a time, which caused an exception :
    
    ValueError: filedescriptor out of range in select()
    
    This was due to the subprocess module using the 'select' system call.
    The module now uses the 'poll' system call, removing this limitation.
    (BZ#609020)
    
    * Prior to Python 2.5, the tarfile module failed to unpack tar files
    if the path was longer than 100 characters. This update backports the
    tarfile module from Python 2.5 and the issue no longer occurs.
    (BZ#263401)
    
    * The email module incorrectly implemented the logic for obtaining
    attachment file names: the get_filename() fallback for using the
    deprecated 'name' parameter of the 'Content-Type' header erroneously
    used the 'Content-Disposition' header. This update backports a fix
    from Python 2.6, which resolves this issue. (BZ#644147)
    
    * Prior to version 2.5, Python's optimized memory allocator never
    released memory back to the system. The memory usage of a long-running
    Python process would resemble a 'high-water mark'. This update
    backports a fix from Python 2.5a1, which frees unused arenas, and adds
    a non-standard sys._debugmallocstats() function, which prints
    diagnostic information to stderr. Finally, when running under
    Valgrind, the optimized allocator is deactivated, to allow more
    convenient debugging of Python memory usage issues. (BZ#569093)
    
    * The urllib and urllib2 modules ignored the no_proxy variable, which
    could lead to programs such as 'yum' erroneously accessing a proxy
    server for URLs covered by a 'no_proxy' exclusion. This update
    backports fixes of urllib and urllib2, which respect the 'no_proxy'
    variable, which fixes these issues. (BZ#549372)
    
    As well, this update adds the following enhancements :
    
    * This update introduces a new python-libs package, subsuming the
    majority of the content of the core python package. This makes both
    32-bit and 64-bit Python libraries available on PowerPC systems.
    (BZ#625372)
    
    * The python-libs.i386 package is now available for 64-bit Itanium
    with the 32-bit Itanium compatibility mode. (BZ#644761)
    
    All Python users are advised to upgrade to these updated packages,
    which contain backported patches to correct these issues and add these
    enhancements."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2008-5983"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2009-4134"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2010-1449"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2010-1450"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2010-1634"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2010-2089"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/errata/RHSA-2011:0027"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      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:"exploit_framework_core", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:python");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:python-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:python-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:python-tools");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:tkinter");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:5");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2009/01/27");
      script_set_attribute(attribute:"patch_publication_date", value:"2011/01/13");
      script_set_attribute(attribute:"plugin_publication_date", value:"2011/01/14");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2011-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:"^5([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Red Hat 5.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-2011:0027";
      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:"RHEL5", cpu:"i386", reference:"python-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"s390x", reference:"python-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"x86_64", reference:"python-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", reference:"python-devel-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"i386", reference:"python-libs-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"s390x", reference:"python-libs-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"x86_64", reference:"python-libs-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"i386", reference:"python-tools-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"s390x", reference:"python-tools-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"x86_64", reference:"python-tools-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"i386", reference:"tkinter-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"s390x", reference:"tkinter-2.4.3-43.el5")) flag++;
      if (rpm_check(release:"RHEL5", cpu:"x86_64", reference:"tkinter-2.4.3-43.el5")) 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, "python / python-devel / python-libs / python-tools / tkinter");
      }
    }
    
  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2009-040.NASL
    descriptionPython has a variable called sys.path that contains all paths where Python loads modules by using import scripting procedure. A wrong handling of that variable enables local attackers to execute arbitrary code via Python scripting in the current dia working directory (CVE-2008-5984). This update provides fix for that vulnerability.
    last seen2020-06-01
    modified2020-06-02
    plugin id37600
    published2009-04-23
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/37600
    titleMandriva Linux Security Advisory : dia (MDVSA-2009:040)
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Mandriva Linux Security Advisory MDVSA-2009:040. 
    # The text itself is copyright (C) Mandriva S.A.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(37600);
      script_version ("1.17");
      script_cvs_date("Date: 2019/08/02 13:32:51");
    
      script_cve_id("CVE-2008-5984");
      script_bugtraq_id(33448);
      script_xref(name:"MDVSA", value:"2009:040");
    
      script_name(english:"Mandriva Linux Security Advisory : dia (MDVSA-2009:040)");
      script_summary(english:"Checks rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Mandriva Linux host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Python has a variable called sys.path that contains all paths where
    Python loads modules by using import scripting procedure. A wrong
    handling of that variable enables local attackers to execute arbitrary
    code via Python scripting in the current dia working directory
    (CVE-2008-5984).
    
    This update provides fix for that vulnerability."
      );
      script_set_attribute(attribute:"solution", value:"Update the affected dia package.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:M/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:ND");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:dia");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandriva:linux:2008.1");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandriva:linux:2009.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2009/02/16");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/04/23");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      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:"MDK2008.1", reference:"dia-0.96.1-3.1mdv2008.1", yank:"mdv")) flag++;
    
    if (rpm_check(release:"MDK2009.0", reference:"dia-0.96.1-4.1mdv2009.0", yank:"mdv")) 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");
    

Seebug

bulletinFamilyexploit
descriptionBUGTRAQ ID: 33448 CVE(CAN) ID: CVE-2008-5984 Dia是开放源码的流程图软件。 Dia的Python插件使用了不可信任的搜索路径,在调用PySys_SetArgv时Python向sys.path附加了空字符串。如果dia工作目录中的python文件名称与python脚本试图导入的文件名相同的话,就会导致在用户系统中执行任意代码。 GNOME Dia 0.96.1 厂商补丁: GNOME ----- 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载: <a href=http://www.mandriva.com/en/download/ target=_blank rel=external nofollow>http://www.mandriva.com/en/download/</a>
idSSV:4793
last seen2017-11-19
modified2009-02-19
published2009-02-19
reporterRoot
titleDia Python插件使用不安全搜索路径漏洞