Vulnerabilities > CVE-2019-12303 - Injection vulnerability in Suse Rancher

047910
CVSS 8.8 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
LOW
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
low complexity
suse
CWE-74
nessus

Summary

In Rancher 2 through 2.2.3, Project owners can inject additional fluentd configuration to read files or execute arbitrary commands inside the fluentd container.

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 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.
  • Subverting Environment Variable Values
    The attacker directly or indirectly modifies environment variables used by or controlling the target software. The attacker's goal is to cause the target software to deviate from its expected operation in a manner that benefits the attacker.

Nessus

  • NASL familyMisc.
    NASL idRANCHER_CVE-2019-12303.NASL
    descriptionIn Rancher 2 through 2.2.3, Project owners can inject additional fluentd configuration to read files or execute arbitrary commands inside the fluentd container. Note that Nessus has not tested for this issue but has instead relied only on the application
    last seen2020-06-01
    modified2020-06-02
    plugin id128057
    published2019-08-22
    reporterThis script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/128057
    titleRancher 2.0.x < 2.0.15 / 2.1.x < 2.1.10 / 2.2.x < 2.2.4 Command Injection Vulnerability
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(128057);
      script_version("1.2");
      script_cvs_date("Date: 2019/10/17 14:31:04");
    
      script_cve_id("CVE-2019-12303");
    
      script_name(english:"Rancher 2.0.x < 2.0.15 / 2.1.x < 2.1.10 / 2.2.x < 2.2.4 Command Injection Vulnerability");
      script_summary(english:"Checks version of Rancher.");
    
      script_set_attribute(attribute:"synopsis", value:
    "A Docker container of Rancher installed on the remote host is missing a security patch.");
      script_set_attribute(attribute:"description", value:
    "In Rancher 2 through 2.2.3, Project owners can inject additional fluentd configuration to read files or execute 
    arbitrary commands inside the fluentd container.
    
    Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version 
    number.");
      # https://forums.rancher.com/t/rancher-release-v2-2-4-addresses-rancher-cve-2019-12274-and-cve-2019-12303/14466
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?76c65d4b");
      # https://github.com/rancher/rancher/releases/tag/v2.2.4
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?972b6c60");
      # https://github.com/rancher/rancher/releases/tag/v2.1.10
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?48cf906b");
      # https://github.com/rancher/rancher/releases/tag/v2.0.15
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?3693a71b");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to version 2.0.15 / 2.1.10 / 2.2.4 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2019-12303");
    
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2019/06/05");
      script_set_attribute(attribute:"patch_publication_date", value:"2019/06/05");
      script_set_attribute(attribute:"plugin_publication_date", value:"2019/08/22");
    
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_set_attribute(attribute:"plugin_type", value:"combined");
      script_set_attribute(attribute:"cpe", value:"x-cpe:/a:rancher_labs:rancher");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("rancher_local_detection.nbin", "rancher_web_ui_detect.nbin");
      script_require_keys("installed_sw/Rancher", "Settings/ParanoidReport");
    
      exit(0);
    }
    
    include('vcf.inc');
    include('vcf_extras.inc');
    
    app = 'Rancher';
    
    get_install_count(app_name:app, exit_if_zero:TRUE);
    app_info = vcf::combined_get_app_info(app:app);
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    constraints = [
      {'min_version'   : '2.0.0',  'fixed_version' : '2.0.15'},
      {'min_version'   : '2.1.0',  'fixed_version' : '2.1.10'},
      {'min_version'   : '2.2.0',  'fixed_version' : '2.2.4'}
    ];
    
    vcf::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_WARNING);
    
  • NASL familyMisc.
    NASL idRANCHER_CVE-2019-12274.NASL
    descriptionIn Rancher 1 and 2 through 2.2.3, unprivileged users (if allowed to deploy nodes) can gain admin access to the Rancher management plane because node driver options intentionally allow posting certain data to the cloud. The problem is that a user could choose to post a sensitive file such as /root/.kube/config or /var/lib/rancher/management-state/cred/kubeconfig-system.yaml. Note that Nessus has not tested for this issue but has instead relied only on the application
    last seen2020-06-01
    modified2020-06-02
    plugin id128056
    published2019-08-22
    reporterThis script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/128056
    titleRancher 1.6.x < 1.6.28 / 2.0.x < 2.0.15 / 2.1.x < 2.1.10 / 2.2.x < 2.2.4 Arbitrary Files Read Vulnerability
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(128056);
      script_version("1.2");
      script_cvs_date("Date: 2019/10/17 14:31:04");
    
      script_cve_id("CVE-2019-12274");
    
      script_name(english:"Rancher 1.6.x < 1.6.28 / 2.0.x < 2.0.15 / 2.1.x < 2.1.10 / 2.2.x < 2.2.4 Arbitrary Files Read Vulnerability");
      script_summary(english:"Checks version of Rancher.");
    
      script_set_attribute(attribute:"synopsis", value:
    "A Docker container of Rancher installed on the remote host is missing a security patch.");
      script_set_attribute(attribute:"description", value:
    "In Rancher 1 and 2 through 2.2.3, unprivileged users (if allowed to deploy nodes) can gain admin access to the 
    Rancher management plane because node driver options intentionally allow posting certain data to the cloud. The 
    problem is that a user could choose to post a sensitive file such as /root/.kube/config or 
    /var/lib/rancher/management-state/cred/kubeconfig-system.yaml.
    
    Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version 
    number.");
      # https://forums.rancher.com/t/rancher-release-v2-2-4-addresses-rancher-cve-2019-12274-and-cve-2019-12303/14466
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?76c65d4b");
      # https://github.com/rancher/rancher/releases/tag/v2.2.4
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?972b6c60");
      # https://github.com/rancher/rancher/releases/tag/v2.1.10
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?48cf906b");
      # https://github.com/rancher/rancher/releases/tag/v2.0.15
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?3693a71b");
      # https://github.com/rancher/rancher/releases/tag/v1.6.28
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?f2d277a3");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to version 1.6.28 / 2.0.15 / 2.1.10 / 2.2.4 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:P/I:N/A:N");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2019-12274");
    
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2019/06/05");
      script_set_attribute(attribute:"patch_publication_date", value:"2019/06/05");
      script_set_attribute(attribute:"plugin_publication_date", value:"2019/08/22");
    
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_set_attribute(attribute:"plugin_type", value:"combined");
      script_set_attribute(attribute:"cpe", value:"x-cpe:/a:rancher_labs:rancher");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("rancher_local_detection.nbin", "rancher_web_ui_detect.nbin");
      script_require_keys("installed_sw/Rancher", "Settings/ParanoidReport");
    
      exit(0);
    }
    
    include('vcf.inc');
    include('vcf_extras.inc');
    
    app = 'Rancher';
    
    get_install_count(app_name:app, exit_if_zero:TRUE);
    app_info = vcf::combined_get_app_info(app:app);
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    constraints = [
      {'min_version'   : '1.6.0',  'fixed_version' : '1.6.28'},
      {'min_version'   : '2.0.0',  'fixed_version' : '2.0.15'},
      {'min_version'   : '2.1.0',  'fixed_version' : '2.1.10'},
      {'min_version'   : '2.2.0',  'fixed_version' : '2.2.4'}
    ];
    
    vcf::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_WARNING);