Vulnerabilities > CVE-2015-4020 - Improper Input Validation vulnerability in multiple products
Attack vector
NETWORK Attack complexity
MEDIUM Privileges required
NONE Confidentiality impact
NONE Integrity impact
PARTIAL Availability impact
NONE Summary
RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.4.x before 2.4.8 does not validate the hostname when fetching gems or making API requests, which allows remote attackers to redirect requests to arbitrary domains via a crafted DNS SRV record with a domain that is suffixed with the original domain name, aka a "DNS hijack attack." NOTE: this vulnerability exists because to an incomplete fix for CVE-2015-3900.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Buffer Overflow via Environment Variables This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
- Server Side Include (SSI) Injection An attacker can use Server Side Include (SSI) Injection to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.
- Cross Zone Scripting An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security. In a zone-based model, pages belong to one of a set of zones corresponding to the level of privilege assigned to that page. Pages in an untrusted zone would have a lesser level of access to the system and/or be restricted in the types of executable content it was allowed to invoke. In a cross-zone scripting attack, a page that should be assigned to a less privileged zone is granted the privileges of a more trusted zone. This can be accomplished by exploiting bugs in the browser, exploiting incorrect configuration in the zone controls, through a cross-site scripting attack that causes the attackers' content to be treated as coming from a more trusted page, or by leveraging some piece of system functionality that is accessible from both the trusted and less trusted zone. This attack differs from "Restful Privilege Escalation" in that the latter correlates to the inadequate securing of RESTful access methods (such as HTTP DELETE) on the server, while cross-zone scripting attacks the concept of security zones as implemented by a browser.
- Cross Site Scripting through Log Files An attacker may leverage a system weakness where logs are susceptible to log injection to insert scripts into the system's logs. If these logs are later viewed by an administrator through a thin administrative interface and the log data is not properly HTML encoded before being written to the page, the attackers' scripts stored in the log will be executed in the administrative interface with potentially serious consequences. This attack pattern is really a combination of two other attack patterns: log injection and stored cross site scripting.
- Command Line Execution through SQL Injection An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
Nessus
NASL family Amazon Linux Local Security Checks NASL id ALA_ALAS-2015-547.NASL description RubyGems provides the ability of a domain to direct clients to a separate host that is used to fetch gems and make API calls against. This mechanism is implemented via DNS, specificly a SRV record _rubygems._tcp under the original requested domain. RubyGems did not validate the hostname returned in the SRV record before sending requests to it. (CVE-2015-3900) As discussed upstream, CVE-2015-4020 is due to an incomplete fix for CVE-2015-3900 , which allowed redirection to an arbitrary gem server in any security domain. last seen 2020-06-01 modified 2020-06-02 plugin id 84248 published 2015-06-18 reporter This script is Copyright (C) 2015-2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/84248 title Amazon Linux AMI : ruby20 (ALAS-2015-547) code # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Amazon Linux AMI Security Advisory ALAS-2015-547. # include("compat.inc"); if (description) { script_id(84248); script_version("2.3"); script_cvs_date("Date: 2018/04/18 15:09:35"); script_cve_id("CVE-2015-3900", "CVE-2015-4020"); script_xref(name:"ALAS", value:"2015-547"); script_name(english:"Amazon Linux AMI : ruby20 (ALAS-2015-547)"); script_summary(english:"Checks rpm output for the updated packages"); script_set_attribute( attribute:"synopsis", value:"The remote Amazon Linux AMI host is missing a security update." ); script_set_attribute( attribute:"description", value: "RubyGems provides the ability of a domain to direct clients to a separate host that is used to fetch gems and make API calls against. This mechanism is implemented via DNS, specificly a SRV record _rubygems._tcp under the original requested domain. RubyGems did not validate the hostname returned in the SRV record before sending requests to it. (CVE-2015-3900) As discussed upstream, CVE-2015-4020 is due to an incomplete fix for CVE-2015-3900 , which allowed redirection to an arbitrary gem server in any security domain." ); # https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478 script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?3dfa3e8c" ); script_set_attribute( attribute:"see_also", value:"https://alas.aws.amazon.com/ALAS-2015-547.html" ); script_set_attribute( attribute:"solution", value:"Run 'yum update ruby20' to update your system." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby20"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby20-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby20-devel"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby20-doc"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby20-irb"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby20-libs"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem20-bigdecimal"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem20-io-console"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem20-psych"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygems20"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygems20-devel"); script_set_attribute(attribute:"cpe", value:"cpe:/o:amazon:linux"); script_set_attribute(attribute:"patch_publication_date", value:"2015/06/16"); script_set_attribute(attribute:"plugin_publication_date", value:"2015/06/18"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2015-2018 Tenable Network Security, Inc."); script_family(english:"Amazon Linux Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/AmazonLinux/release", "Host/AmazonLinux/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/AmazonLinux/release"); if (isnull(release) || !strlen(release)) audit(AUDIT_OS_NOT, "Amazon Linux"); os_ver = pregmatch(pattern: "^AL(A|\d)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Amazon Linux"); os_ver = os_ver[1]; if (os_ver != "A") { if (os_ver == 'A') os_ver = 'AMI'; audit(AUDIT_OS_NOT, "Amazon Linux AMI", "Amazon Linux " + os_ver); } if (!get_kb_item("Host/AmazonLinux/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING); flag = 0; if (rpm_check(release:"ALA", reference:"ruby20-2.0.0.645-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby20-debuginfo-2.0.0.645-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby20-devel-2.0.0.645-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby20-doc-2.0.0.645-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby20-irb-2.0.0.645-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby20-libs-2.0.0.645-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem20-bigdecimal-1.2.0-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem20-io-console-0.4.2-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem20-psych-2.0.0-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygems20-2.0.14-1.27.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygems20-devel-2.0.14-1.27.amzn1")) 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, "ruby20 / ruby20-debuginfo / ruby20-devel / ruby20-doc / ruby20-irb / etc"); }
NASL family Amazon Linux Local Security Checks NASL id ALA_ALAS-2015-548.NASL description RubyGems provides the ability of a domain to direct clients to a separate host that is used to fetch gems and make API calls against. This mechanism is implemented via DNS, specificly a SRV record _rubygems._tcp under the original requested domain. RubyGems did not validate the hostname returned in the SRV record before sending requests to it. (CVE-2015-3900) As discussed upstream, CVE-2015-4020 is due to an incomplete fix for CVE-2015-3900 , which allowed redirection to an arbitrary gem server in any security domain. last seen 2020-06-01 modified 2020-06-02 plugin id 84249 published 2015-06-18 reporter This script is Copyright (C) 2015-2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/84249 title Amazon Linux AMI : ruby21 (ALAS-2015-548) code # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Amazon Linux AMI Security Advisory ALAS-2015-548. # include("compat.inc"); if (description) { script_id(84249); script_version("2.3"); script_cvs_date("Date: 2018/04/18 15:09:35"); script_cve_id("CVE-2015-3900", "CVE-2015-4020"); script_xref(name:"ALAS", value:"2015-548"); script_name(english:"Amazon Linux AMI : ruby21 (ALAS-2015-548)"); script_summary(english:"Checks rpm output for the updated packages"); script_set_attribute( attribute:"synopsis", value:"The remote Amazon Linux AMI host is missing a security update." ); script_set_attribute( attribute:"description", value: "RubyGems provides the ability of a domain to direct clients to a separate host that is used to fetch gems and make API calls against. This mechanism is implemented via DNS, specificly a SRV record _rubygems._tcp under the original requested domain. RubyGems did not validate the hostname returned in the SRV record before sending requests to it. (CVE-2015-3900) As discussed upstream, CVE-2015-4020 is due to an incomplete fix for CVE-2015-3900 , which allowed redirection to an arbitrary gem server in any security domain." ); # https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478 script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?3dfa3e8c" ); script_set_attribute( attribute:"see_also", value:"https://alas.aws.amazon.com/ALAS-2015-548.html" ); script_set_attribute( attribute:"solution", value:"Run 'yum update ruby21' to update your system." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby21"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby21-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby21-devel"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby21-doc"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby21-irb"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby21-libs"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem21-bigdecimal"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem21-io-console"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem21-psych"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygems21"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygems21-devel"); script_set_attribute(attribute:"cpe", value:"cpe:/o:amazon:linux"); script_set_attribute(attribute:"patch_publication_date", value:"2015/06/16"); script_set_attribute(attribute:"plugin_publication_date", value:"2015/06/18"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2015-2018 Tenable Network Security, Inc."); script_family(english:"Amazon Linux Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/AmazonLinux/release", "Host/AmazonLinux/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/AmazonLinux/release"); if (isnull(release) || !strlen(release)) audit(AUDIT_OS_NOT, "Amazon Linux"); os_ver = pregmatch(pattern: "^AL(A|\d)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Amazon Linux"); os_ver = os_ver[1]; if (os_ver != "A") { if (os_ver == 'A') os_ver = 'AMI'; audit(AUDIT_OS_NOT, "Amazon Linux AMI", "Amazon Linux " + os_ver); } if (!get_kb_item("Host/AmazonLinux/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING); flag = 0; if (rpm_check(release:"ALA", reference:"ruby21-2.1.6-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby21-debuginfo-2.1.6-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby21-devel-2.1.6-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby21-doc-2.1.6-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby21-irb-2.1.6-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby21-libs-2.1.6-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem21-bigdecimal-1.2.4-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem21-io-console-0.4.3-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem21-psych-2.0.5-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygems21-2.2.3-1.17.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygems21-devel-2.2.3-1.17.amzn1")) 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, "ruby21 / ruby21-debuginfo / ruby21-devel / ruby21-doc / ruby21-irb / etc"); }
NASL family Amazon Linux Local Security Checks NASL id ALA_ALAS-2015-549.NASL description RubyGems provides the ability of a domain to direct clients to a separate host that is used to fetch gems and make API calls against. This mechanism is implemented via DNS, specificly a SRV record _rubygems._tcp under the original requested domain. RubyGems did not validate the hostname returned in the SRV record before sending requests to it. (CVE-2015-3900) As discussed upstream, CVE-2015-4020 is due to an incomplete fix for CVE-2015-3900 , which allowed redirection to an arbitrary gem server in any security domain. last seen 2020-06-01 modified 2020-06-02 plugin id 84250 published 2015-06-18 reporter This script is Copyright (C) 2015-2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/84250 title Amazon Linux AMI : ruby22 (ALAS-2015-549) code # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Amazon Linux AMI Security Advisory ALAS-2015-549. # include("compat.inc"); if (description) { script_id(84250); script_version("2.3"); script_cvs_date("Date: 2018/04/18 15:09:35"); script_cve_id("CVE-2015-3900", "CVE-2015-4020"); script_xref(name:"ALAS", value:"2015-549"); script_name(english:"Amazon Linux AMI : ruby22 (ALAS-2015-549)"); script_summary(english:"Checks rpm output for the updated packages"); script_set_attribute( attribute:"synopsis", value:"The remote Amazon Linux AMI host is missing a security update." ); script_set_attribute( attribute:"description", value: "RubyGems provides the ability of a domain to direct clients to a separate host that is used to fetch gems and make API calls against. This mechanism is implemented via DNS, specificly a SRV record _rubygems._tcp under the original requested domain. RubyGems did not validate the hostname returned in the SRV record before sending requests to it. (CVE-2015-3900) As discussed upstream, CVE-2015-4020 is due to an incomplete fix for CVE-2015-3900 , which allowed redirection to an arbitrary gem server in any security domain." ); # https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478 script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?3dfa3e8c" ); script_set_attribute( attribute:"see_also", value:"https://alas.aws.amazon.com/ALAS-2015-549.html" ); script_set_attribute( attribute:"solution", value:"Run 'yum update ruby22' to update your system." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby22"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby22-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby22-devel"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby22-doc"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby22-irb"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:ruby22-libs"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem22-bigdecimal"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem22-io-console"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygem22-psych"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygems22"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:amazon:linux:rubygems22-devel"); script_set_attribute(attribute:"cpe", value:"cpe:/o:amazon:linux"); script_set_attribute(attribute:"patch_publication_date", value:"2015/06/16"); script_set_attribute(attribute:"plugin_publication_date", value:"2015/06/18"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2015-2018 Tenable Network Security, Inc."); script_family(english:"Amazon Linux Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/AmazonLinux/release", "Host/AmazonLinux/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/AmazonLinux/release"); if (isnull(release) || !strlen(release)) audit(AUDIT_OS_NOT, "Amazon Linux"); os_ver = pregmatch(pattern: "^AL(A|\d)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Amazon Linux"); os_ver = os_ver[1]; if (os_ver != "A") { if (os_ver == 'A') os_ver = 'AMI'; audit(AUDIT_OS_NOT, "Amazon Linux AMI", "Amazon Linux " + os_ver); } if (!get_kb_item("Host/AmazonLinux/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING); flag = 0; if (rpm_check(release:"ALA", reference:"ruby22-2.2.2-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby22-debuginfo-2.2.2-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby22-devel-2.2.2-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby22-doc-2.2.2-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby22-irb-2.2.2-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"ruby22-libs-2.2.2-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem22-bigdecimal-1.2.6-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem22-io-console-0.4.3-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygem22-psych-2.0.8-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygems22-2.4.5-1.6.amzn1")) flag++; if (rpm_check(release:"ALA", reference:"rubygems22-devel-2.4.5-1.6.amzn1")) 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, "ruby22 / ruby22-debuginfo / ruby22-devel / ruby22-doc / ruby22-irb / etc"); }
NASL family CGI abuses NASL id PUPPET_ENTERPRISE_CVE_2015-4100.NASL description According to its self-reported version number, the Puppet Enterprise application running on the remote host is version 3.7.x or 3.8.x prior to 3.8.1. It it, therefore, affected by the following vulnerabilities : - A flaw exists in RubyGems due to a failure to validate hostnames when fetching gems or making API requests. A remote attacker, using a crafted DNS SRV record, can exploit this to redirect requests to arbitrary domains. (CVE-2015-3900) - A flaw exists in RubyGems due to a failure to sanitize DNS responses, which allows a man-in-the-middle attacker to install arbitrary applications. (CVE-2015-4020) - A flaw exists in Puppet Enterprise related to how certificates are managed, under certain vulnerable configurations, which allows a trusted certificate to be used to perform full certificate management. An attacker can exploit this flaw to revoke the certificates of other nodes or to approve their certificate requests. (CVE-2015-4100) Note that the default last seen 2020-06-01 modified 2020-06-02 plugin id 84961 published 2015-07-23 reporter This script is Copyright (C) 2015-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/84961 title Puppet Enterprise 3.7.x < 3.8.1 / 3.8.x < 3.8.1 Multiple Vulnerabilities code # # (C) Tenable Network Security, Inc. # include("compat.inc"); if (description) { script_id(84961); script_version("1.6"); script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/12"); script_cve_id("CVE-2015-3900", "CVE-2015-4020", "CVE-2015-4100"); script_bugtraq_id(75431, 75482); script_name(english:"Puppet Enterprise 3.7.x < 3.8.1 / 3.8.x < 3.8.1 Multiple Vulnerabilities"); script_summary(english:"Checks the Puppet Enterprise version."); script_set_attribute(attribute:"synopsis", value: "A web application on the remote host is affected by multiple vulnerabilities."); script_set_attribute(attribute:"description", value: "According to its self-reported version number, the Puppet Enterprise application running on the remote host is version 3.7.x or 3.8.x prior to 3.8.1. It it, therefore, affected by the following vulnerabilities : - A flaw exists in RubyGems due to a failure to validate hostnames when fetching gems or making API requests. A remote attacker, using a crafted DNS SRV record, can exploit this to redirect requests to arbitrary domains. (CVE-2015-3900) - A flaw exists in RubyGems due to a failure to sanitize DNS responses, which allows a man-in-the-middle attacker to install arbitrary applications. (CVE-2015-4020) - A flaw exists in Puppet Enterprise related to how certificates are managed, under certain vulnerable configurations, which allows a trusted certificate to be used to perform full certificate management. An attacker can exploit this flaw to revoke the certificates of other nodes or to approve their certificate requests. (CVE-2015-4100) Note that the default 'monolithic', 'split', and 'multimaster' installations of Puppet Enterprise are not affected by CVE-2015-4100."); script_set_attribute(attribute:"see_also", value:"https://puppet.com/security/cve/CVE-2015-4100"); script_set_attribute(attribute:"see_also", value:"http://blog.rubygems.org/2015/05/14/CVE-2015-3900.html"); script_set_attribute(attribute:"see_also", value:"https://groups.google.com/forum/#!topic/puppet-announce/mnV70g2PttQ"); script_set_attribute(attribute:"solution", value: "Upgrade to Puppet Enterprise 3.8.1 or later."); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N"); script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C"); script_set_attribute(attribute:"cvss_score_source", value:"CVE-2015-3900"); script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required"); script_set_attribute(attribute:"exploit_available", value:"false"); script_set_attribute(attribute:"vuln_publication_date", value:"2015/05/14"); script_set_attribute(attribute:"patch_publication_date", value:"2015/06/18"); script_set_attribute(attribute:"plugin_publication_date", value:"2015/07/23"); script_set_attribute(attribute:"plugin_type", value:"remote"); script_set_attribute(attribute:"cpe", value:"cpe:/a:puppetlabs:puppet"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"CGI abuses"); script_copyright(english:"This script is Copyright (C) 2015-2020 and is owned by Tenable, Inc. or an Affiliate thereof."); script_dependencies("puppet_rest_detect.nasl"); script_require_keys("puppet/rest_port"); exit(0); } include("audit.inc"); include("global_settings.inc"); include("misc_func.inc"); include("http.inc"); app_name = "Puppet Enterprise"; port = get_kb_item_or_exit('puppet/rest_port'); ver = get_kb_item_or_exit('puppet/' + port + '/version'); if ('Enterprise' >< ver) { # convert something like # 2.7.19 (Puppet Enterprise 2.7.0) # to # 2.7.0 match = eregmatch(string:ver, pattern:"Enterprise ([0-9.]+)\)"); if (isnull(match)) audit(AUDIT_UNKNOWN_WEB_APP_VER, app_name, build_url(port:port)); ver = match[1]; } else audit(AUDIT_WEB_APP_NOT_INST, app_name, port); if ( ver =~ "^3\.7($|[^0-9])" || ver =~ "^3\.8\.0($|[^0-9])" ) { if (report_verbosity > 0) { report = '\n Installed version : Puppet Enterprise ' + ver + '\n Fixed version : Puppet Enterprise 3.8.1\n'; security_warning(port:port, extra:report); } else security_warning(port); } else audit(AUDIT_WEB_APP_NOT_AFFECTED, app_name, build_url(port:port), ver);
References
- http://blog.rubygems.org/2015/06/08/2.2.5-released.html
- http://blog.rubygems.org/2015/06/08/2.4.8-released.html
- http://www.oracle.com/technetwork/topics/security/bulletinoct2015-2511968.html
- http://www.securityfocus.com/bid/75431
- https://github.com/rubygems/rubygems/commit/5c7bfb5
- https://puppet.com/security/cve/CVE-2015-3900
- https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478
- https://www.trustwave.com/Resources/SpiderLabs-Blog/Attacking-Ruby-Gem-Security-with-CVE-2015-3900/