Vulnerabilities > CVE-2017-2750 - Improper Input Validation vulnerability in HP products

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
hp
CWE-20
nessus

Summary

Insufficient Solution DLL Signature Validation allows potential execution of arbitrary code in HP LaserJet Enterprise printers, HP PageWide Enterprise printers, HP LaserJet Managed printers, HP OfficeJet Enterprise printers before 2308937_578479, 2405087_018548, and other firmware versions.

Vulnerable Configurations

Part Description Count
OS
Hp
253
Hardware
Hp
173

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 familyMisc.
    NASL idHP_OFFICEJET_HPSBPI03569.NASL
    descriptionAccording to its model number and firmware revision, the remote HP OfficeJet printer is affected by a remote code execution vulnerability.
    last seen2020-06-01
    modified2020-06-02
    plugin id104813
    published2017-11-28
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/104813
    titleHP OfficeJet Printers RCE (HPSBPI03569)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(104813);
      script_version("1.5");
      script_cvs_date("Date: 2019/11/12");
    
      script_cve_id("CVE-2017-2750");
      script_xref(name:"HP", value:"HPSBPI03569");
      script_xref(name:"IAVB", value:"2017-B-0166");
    
      script_name(english:"HP OfficeJet Printers RCE (HPSBPI03569)");
      script_summary(english:"Checks the model number and firmware revision.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote printer is affected by a remote code execution
    vulnerability.");
      script_set_attribute(attribute:"description", value:
    "According to its model number and firmware revision, the remote HP
    OfficeJet printer is affected by a remote code execution
    vulnerability.");
      script_set_attribute(attribute:"see_also", value:"https://support.hp.com/gb-en/document/c05839270");
      script_set_attribute(attribute:"solution", value:
    "Upgrade the HP OfficeJet firmware in accordance with the vendor
    advisory.");
      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:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/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-2017-2750");
    
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/11/17");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/11/17");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/11/28");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/h:hp:officejet");
      script_set_attribute(attribute:"stig_severity", value:"I");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("hp_officejet_web_detect.nbin");
      script_require_keys("hp/officejet/detected");
      script_require_ports("Services/www", 80, 443);
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    
    port = get_http_port(default:80, dont_break:TRUE);
                                                                           # Examples :
    product   = get_kb_item_or_exit('hp/officejet/' + port + '/product');  # HP Officejet X555
    model     = get_kb_item_or_exit('hp/officejet/' + port + '/model');    # C2S11A
    firmware  = get_kb_item_or_exit('hp/officejet/' + port + '/firmware'); # 2302908_435004
    
    full_product = "HP OfficeJet " + product + " Model " + model;
    
    parts = split(firmware, sep:"_", keep:FALSE);
    firmware_major = parts[0]; 
    
    serial = get_kb_item('hp/officejet/serial');
    if (empty_or_null(serial)) serial = "unknown";
    
    affected_models =
      make_list(
        "B5L06A", "B5L06V", "B5L07A",          # Color Flow MFP X585
        "B5L04A", "B5L04V", "B5L05A", "B5L05V" # Color MFP X585
    );
    
    vuln = FALSE;
    # Check model
    foreach affected_model (affected_models)
    {
      if (affected_model == model)
      {
        vuln = TRUE;
        break;
      }
    }
    
    if (!vuln) audit(AUDIT_DEVICE_NOT_VULN, full_product);
    
    # Check firmware revision
    #  Only look at the first part of the firmware revision (e.g. 2307497 of 2307497_543950).
    #  The last part of the firmware revision changes for each model
    
    fix = "2405129";
    
    if (ver_compare(ver:firmware_major, fix:fix) == -1)
    {
      report =
        '\n  Product           : ' + product +
        '\n  Model             : ' + model +
        '\n  Serial number     : ' + serial +
        '\n  Installed version : ' + firmware +
        '\n  Fixed version     : 2405129_000050' +
        '\n';
    
      security_report_v4(extra:report, port:port, severity:SECURITY_HOLE);
    }
    else audit(AUDIT_DEVICE_NOT_VULN, full_product, firmware);
    
  • NASL familyMisc.
    NASL idHP_LASERJET_HPSBPI03569.NASL
    descriptionAccording to its model number and firmware revision, the remote HP LaserJet printer is affected by a remote code execution vulnerability.
    last seen2020-06-01
    modified2020-06-02
    plugin id104812
    published2017-11-28
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/104812
    titleHP LaserJet Printers RCE (HPSBPI03569)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(104812);
      script_version("1.5");
      script_cvs_date("Date: 2019/11/12");
    
      script_cve_id("CVE-2017-2750");
      script_xref(name:"HP", value:"HPSBPI03569");
      script_xref(name:"IAVB", value:"2017-B-0166");
    
      script_name(english:"HP LaserJet Printers RCE (HPSBPI03569)");
      script_summary(english:"Checks the model number and firmware revision.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote printer is affected by a remote code execution
    vulnerability.");
      script_set_attribute(attribute:"description", value:
    "According to its model number and firmware revision, the remote HP
    LaserJet printer is affected by a remote code execution
    vulnerability.");
      script_set_attribute(attribute:"see_also", value:"https://support.hp.com/gb-en/document/c05839270");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to the HP LaserJet firmware referenced in the
    advisory.");
      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:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/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-2017-2750");
    
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2017/11/17");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/11/17");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/11/28");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/h:hp:laserjet");
      script_set_attribute(attribute:"stig_severity", value:"I");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("hp_laserjet_detect.nasl");
      script_require_keys("www/hp_laserjet");
      script_require_ports("Services/www", 80, 443);
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    
    port = get_http_port(default:80, dont_break:TRUE, embedded:TRUE);
                                                                             # Examples:
    product   = get_kb_item_or_exit('www/hp_laserjet/'+port+'/pname');       # HP LaserJet M750
    model     = get_kb_item_or_exit('www/hp_laserjet/'+port+'/modelnumber'); # D3L09A
    firmware  = get_kb_item_or_exit('www/hp_laserjet/'+port+'/fw_rev');      # 2304061_439474
    url       = get_kb_item_or_exit('www/hp_laserjet/'+port+'/url');
    
    full_product = "HP LaserJet " + product + " Model " + model;
    
    parts = split(firmware, sep:"_", keep:FALSE);
    firmware_major = parts[0]; 
    
    serial = get_kb_item('www/hp_laserjet/'+port+'/serial');
    if (empty_or_null(serial)) serial = "unknown";
    
    vuln = FALSE;
    
    if (model == "CZ255A" || 
        model == "CZ256A" || 
        model == "CZ257A" || 
        model == "CZ258A" || 
        model == "B5L46A" || 
        model == "B5L47A" || 
        model == "B5L48A" ||
        model == "CZ250A" ||
        model == "CA251A" ||
        model == "CD644A" ||
        model == "CD645A" ||
        model == "CF116A" ||
        model == "CF117A" ||
        model == "CF304A" ||
        model == "CC523A" ||
        model == "CC524C" ||
        model == "CC522A" ||
        model == "L3U49A" ||
        model == "L3U50A" ||
        model == "A2W77A" ||
        model == "A2W78A" ||
        model == "A2W79A" ||
        model == "A2W76A" ||
        model == "A2W75A" ||
        model == "D7P70A" ||
        model == "D7P71A" ||
        model == "CD646A" ||
        model == "CF367A" ||
        model == "CF118A" ||
        model == "B3G85A" ||
        model == "J8J64A" ||
        model == "J8J72A" ||
        model == "J8J78A" ||
        model == "F2A76A" ||
        model == "F2A77A" ||
        model == "F2A81A" ||
        model == "CZ244A" ||
        model == "CZ245A" ||
        model == "J7X28A" ||
        model == "J8J63A" ||
        model == "J8J65A" ||
        model == "J8J70A" ||
        model == "J8J71A" ||
        model == "J8J76A" ||
        model == "CF066A" ||
        model == "CF067A" ||
        model == "CF068A" ||
        model == "CF069A" ||
        model == "J8J67A" ||
        model == "J8J74A" ||
        model == "J8J79A" ||
        model == "J8J80A" ||
        model == "J8J66A" ||
        model == "J8J73A")
    {
      fix = "2405129";
      vuln = TRUE;
    }
    
    else if (model == "J7Z98A" || 
             model == "J7Z99A" || 
             model == "J8A04A" || 
             model == "J8A05A" || 
             model == "J8A06A" ||
             model == "L3U55A" ||
             model == "L3U56A" ||
             model == "L3U57A" ||
             model == "K0Q14A" ||
             model == "K0Q15A" ||
             model == "K0Q17A" ||
             model == "K0Q18A" ||
             model == "M0P32A" ||
             model == "K0Q19A" ||
             model == "K0Q20A" ||
             model == "K0Q21A" ||
             model == "K0Q22A" ||
             model == "M0P33A" ||
             model == "M0P35A" ||
             model == "M0P36A" ||
             model == "M0P39A" ||
             model == "M0P40A")
    {
      fix = "2405130";
      vuln = TRUE;
    }
    
    else if (model == "B5L23A" ||
             model == "B5L23V" ||
             model == "B5L24A" ||
             model == "B5L25A" ||
             model == "B5L26A" ||
             model == "B5L27A" ||
             model == "B5L38A")
    {
      fix = "2308903";
      vuln = TRUE;
    }
    
    
    if (!vuln) audit(AUDIT_DEVICE_NOT_VULN, full_product);
    
    # Check firmware revision
    #  Only look at the first part of the firmware revision (e.g. 2307497 of 2307497_543950).
    #  The last part of the firmware revision changes for each model
    
    if (ver_compare(ver:firmware_major, fix:fix) == -1)
    {
      report =
        '\n  Product           : ' + product +
        '\n  Model             : ' + model +
        '\n  Serial number     : ' + serial +
        '\n  Source URL        : ' + url +
        '\n  Installed version : ' + firmware +
        '\n  Fixed version     : ' + fix +
        '\n';
    
      security_report_v4(extra:report, port:port, severity:SECURITY_HOLE);
    }
    else audit(AUDIT_DEVICE_NOT_VULN, full_product, firmware);
    

The Hacker News

idTHN:F8956237718871D56E2C1B51CF4EFAAC
last seen2018-01-27
modified2017-11-23
published2017-11-22
reporterMohit Kumar
sourcehttps://thehackernews.com/2017/11/hp-printer-hacking.html
titleRemotely Exploitable Flaw Found In HP Enterprise Printers—Patch Now