Lucene search

K
nessusThis script is Copyright (C) 2012-2021 and is owned by Tenable, Inc. or an Affiliate thereof.SL_20120618_PYTHON_ON_SL5_X.NASL
HistoryAug 01, 2012 - 12:00 a.m.

Scientific Linux Security Update : python on SL5.x i386/x86_64 (20120618)

2012-08-0100:00:00
This script is Copyright (C) 2012-2021 and is owned by Tenable, Inc. or an Affiliate thereof.
www.tenable.com
8

Python is an interpreted, interactive, object-oriented programming language.

A denial of service flaw was found in the implementation of associative arrays (dictionaries) in Python. An attacker able to supply a large number of inputs to a Python application (such as HTTP POST request parameters sent to a web application) that are used as keys when inserting data into an array could trigger multiple hash function collisions, making array operations take an excessive amount of CPU time. To mitigate this issue, randomization has been added to the hash function to reduce the chance of an attacker successfully causing intentional collisions. (CVE-2012-1150)

Note: The hash randomization is not enabled by default as it may break applications that incorrectly depend on dictionary ordering. To enable the protection, the new β€˜PYTHONHASHSEED’ environment variable or the Python interpreter’s β€˜-R’ command line option can be used. Refer to the python(1) manual page for details.

The previous expat erratum must be installed with this update, which adds hash randomization to the Expat library used by the Python pyexpat module.

A flaw was found in the way the Python SimpleHTTPServer module generated directory listings. An attacker able to upload a file with a specially crafted name to a server could possibly perform a cross-site scripting (XSS) attack against victims visiting a listing page generated by SimpleHTTPServer, for a directory containing the crafted file (if the victims were using certain web browsers). (CVE-2011-4940)

A race condition was found in the way the Python distutils module set file permissions during the creation of the .pypirc file. If a local user had access to the home directory of another user who is running distutils, they could use this flaw to gain access to that user’s .pypirc file, which can contain usernames and passwords for code repositories. (CVE-2011-4944)

All Python users should upgrade to these updated packages, which contain backported patches to correct these issues.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#
# The descriptive text is (C) Scientific Linux.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(61332);
  script_version("1.8");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/01/14");

  script_cve_id("CVE-2011-4940", "CVE-2011-4944", "CVE-2012-1150");

  script_name(english:"Scientific Linux Security Update : python on SL5.x i386/x86_64 (20120618)");
  script_summary(english:"Checks rpm output for the updated packages");

  script_set_attribute(
    attribute:"synopsis", 
    value:
"The remote Scientific Linux host is missing one or more security
updates."
  );
  script_set_attribute(
    attribute:"description", 
    value:
"Python is an interpreted, interactive, object-oriented programming
language.

A denial of service flaw was found in the implementation of
associative arrays (dictionaries) in Python. An attacker able to
supply a large number of inputs to a Python application (such as HTTP
POST request parameters sent to a web application) that are used as
keys when inserting data into an array could trigger multiple hash
function collisions, making array operations take an excessive amount
of CPU time. To mitigate this issue, randomization has been added to
the hash function to reduce the chance of an attacker successfully
causing intentional collisions. (CVE-2012-1150)

Note: The hash randomization is not enabled by default as it may break
applications that incorrectly depend on dictionary ordering. To enable
the protection, the new 'PYTHONHASHSEED' environment variable or the
Python interpreter's '-R' command line option can be used. Refer to
the python(1) manual page for details.

The previous expat erratum must be installed with this update, which
adds hash randomization to the Expat library used by the Python
pyexpat module.

A flaw was found in the way the Python SimpleHTTPServer module
generated directory listings. An attacker able to upload a file with a
specially crafted name to a server could possibly perform a cross-site
scripting (XSS) attack against victims visiting a listing page
generated by SimpleHTTPServer, for a directory containing the crafted
file (if the victims were using certain web browsers). (CVE-2011-4940)

A race condition was found in the way the Python distutils module set
file permissions during the creation of the .pypirc file. If a local
user had access to the home directory of another user who is running
distutils, they could use this flaw to gain access to that user's
.pypirc file, which can contain usernames and passwords for code
repositories. (CVE-2011-4944)

All Python users should upgrade to these updated packages, which
contain backported patches to correct these issues."
  );
  # https://listserv.fnal.gov/scripts/wa.exe?A2=ind1206&L=scientific-linux-errata&T=0&P=1963
  script_set_attribute(
    attribute:"see_also",
    value:"http://www.nessus.org/u?5f8268e6"
  );
  script_set_attribute(attribute:"solution", value:"Update the affected packages.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:python");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:python-debuginfo");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:python-devel");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:python-libs");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:python-tools");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fermilab:scientific_linux:tkinter");
  script_set_attribute(attribute:"cpe", value:"x-cpe:/o:fermilab:scientific_linux");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/06/27");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/06/18");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/08/01");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_copyright(english:"This script is Copyright (C) 2012-2021 and is owned by Tenable, Inc. or an Affiliate thereof.");
  script_family(english:"Scientific Linux Local Security Checks");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/RedHat/release", "Host/RedHat/rpm-list");

  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) || "Scientific Linux " >!< release) audit(AUDIT_HOST_NOT, "running Scientific Linux");
os_ver = pregmatch(pattern: "Scientific Linux.*release ([0-9]+(\.[0-9]+)?)", string:release);
if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Scientific Linux");
os_ver = os_ver[1];
if (! preg(pattern:"^5([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Scientific Linux 5.x", "Scientific Linux " + 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 (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Scientific Linux", cpu);


flag = 0;
if (rpm_check(release:"SL5", reference:"python-2.4.3-46.el5_8.2")) flag++;
if (rpm_check(release:"SL5", reference:"python-debuginfo-2.4.3-46.el5_8.2")) flag++;
if (rpm_check(release:"SL5", reference:"python-devel-2.4.3-46.el5_8.2")) flag++;
if (rpm_check(release:"SL5", reference:"python-libs-2.4.3-46.el5_8.2")) flag++;
if (rpm_check(release:"SL5", reference:"python-tools-2.4.3-46.el5_8.2")) flag++;
if (rpm_check(release:"SL5", reference:"tkinter-2.4.3-46.el5_8.2")) flag++;


if (flag)
{
  security_report_v4(
    port       : 0,
    severity   : SECURITY_WARNING,
    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, "python / python-debuginfo / python-devel / python-libs / etc");
}
VendorProductVersionCPE
fermilabscientific_linuxpythonp-cpe:/a:fermilab:scientific_linux:python
fermilabscientific_linuxpython-debuginfop-cpe:/a:fermilab:scientific_linux:python-debuginfo
fermilabscientific_linuxpython-develp-cpe:/a:fermilab:scientific_linux:python-devel
fermilabscientific_linuxpython-libsp-cpe:/a:fermilab:scientific_linux:python-libs
fermilabscientific_linuxpython-toolsp-cpe:/a:fermilab:scientific_linux:python-tools
fermilabscientific_linuxtkinterp-cpe:/a:fermilab:scientific_linux:tkinter
fermilabscientific_linuxx-cpe:/o:fermilab:scientific_linux