Vulnerabilities > CVE-2016-4436 - Security Bypass vulnerability in Apache Struts

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
apache
nessus

Summary

Apache Struts 2 before 2.3.29 and 2.5.x before 2.5.1 allow attackers to have unspecified impact via vectors related to improper action name clean up.

Nessus

  • NASL familyMisc.
    NASL idSTRUTS_2_3_29_WIN_LOCAL.NASL
    descriptionThe version of Apache Struts running on the remote Windows host is 2.x prior to 2.3.29. It is, therefore, affected by the following vulnerabilities : - A remote code execution vulnerability exists due to erroneously performing double OGNL evaluation of attribute values assigned to certain tags. An unauthenticated, remote attacker can exploit this, via a specially crafted request, to execute arbitrary code. (CVE-2016-0785) - A cross-site request forgery (XSRF) vulnerability exists due to improper validation of session tokens. An unauthenticated, remote attacker can exploit this, via a malicious OGNL expression, to bypass token validation and perform an XSRF attack. (CVE-2016-4430) - Multiple input validation issues exists that allow internal security mechanisms to be bypassed, allowing the manipulation of a return string which can be used to redirect users to a malicious website. This affects both the default action method the
    last seen2020-06-01
    modified2020-06-02
    plugin id91812
    published2016-06-24
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/91812
    titleApache Struts 2.x < 2.3.29 Multiple Vulnerabilities (S2-035 - S2-040)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(91812);
      script_version("1.15");
      script_cvs_date("Date: 2019/11/14");
    
      script_cve_id(
        "CVE-2016-0785",
        "CVE-2016-4430",
        "CVE-2016-4431",
        "CVE-2016-4433",
        "CVE-2016-4436",
        "CVE-2016-4438",
        "CVE-2016-4461"
      );
      script_bugtraq_id(
        85066,
        91275,
        91277,
        91280,
        91281,
        91282,
        91284
      );
    
      script_name(english:"Apache Struts 2.x < 2.3.29 Multiple Vulnerabilities (S2-035 - S2-040)");
      script_summary(english:"Checks the Struts 2 version.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote Windows host contains a web application that uses a Java
    framework that is affected by multiple vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "The version of Apache Struts running on the remote Windows host is 2.x
    prior to 2.3.29. It is, therefore, affected by the following
    vulnerabilities :
    
      - A remote code execution vulnerability exists due to
        erroneously performing double OGNL evaluation of
        attribute values assigned to certain tags. An
        unauthenticated, remote attacker can exploit this, via a
        specially crafted request, to execute arbitrary code.
        (CVE-2016-0785)
    
      - A cross-site request forgery (XSRF) vulnerability exists
        due to improper validation of session tokens. An
        unauthenticated, remote attacker can exploit this, via a
        malicious OGNL expression, to bypass token validation
        and perform an XSRF attack. (CVE-2016-4430)
    
      - Multiple input validation issues exists that allow
        internal security mechanisms to be bypassed, allowing
        the manipulation of a return string which can be used to
        redirect users to a malicious website. This affects both
        the default action method the 'getter' action method.
        (CVE-2016-4431, CVE-2016-4433)
    
      - An unspecified flaw exists that is triggered during the
        cleanup of action names. An unauthenticated, remote
        attacker can exploit this, via a specially crafted
        payload, to perform unspecified actions. (CVE-2016-4436)
    
      - A remote code execution vulnerability exists in the REST
        plugin due to improper handling of OGNL expressions. An
        unauthenticated, remote attacker can exploit this, via
        a specially crafted OGNL expression, to execute
        arbitrary code. (CVE-2016-4438)
    
      - A remote code execution vulnerability exists in user tag
        attributes due to improper handling of OGNL expressions. 
        An unauthenticated, remote attacker can exploit this, 
        via a specially crafted double OGNL evaluation, to 
        execute arbitrary code. (CVE-2016-4461)
    
    Note that Nessus has not tested for these issues but has instead
    relied only on the application's self-reported version number.");
      script_set_attribute(attribute:"see_also", value:"https://struts.apache.org/docs/s2-035.html");
      script_set_attribute(attribute:"see_also", value:"https://struts.apache.org/docs/s2-036.html");
      script_set_attribute(attribute:"see_also", value:"https://struts.apache.org/docs/s2-037.html");
      script_set_attribute(attribute:"see_also", value:"https://struts.apache.org/docs/s2-038.html");
      script_set_attribute(attribute:"see_also", value:"https://struts.apache.org/docs/s2-039.html");
      script_set_attribute(attribute:"see_also", value:"https://struts.apache.org/docs/s2-040.html");
      script_set_attribute(attribute:"see_also", value:"http://struts.apache.org/docs/version-notes-2329.html");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to Apache Struts version 2.3.29 or later. Alternatively,
    apply the workarounds referenced in the vendor advisory.");
      script_set_attribute(attribute:"agent", value:"all");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:F/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:F/RL:O/RC:C");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2016-4461");
    
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"d2_elliot_name", value:"Apache Struts REST Plugin OGNL Expression Handling RCE");
      script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2016/06/14");
      script_set_attribute(attribute:"patch_publication_date", value:"2016/06/14");
      script_set_attribute(attribute:"plugin_publication_date", value:"2016/06/24");
    
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_set_attribute(attribute:"plugin_type", value:"combined");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:apache:struts");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("os_fingerprint.nasl", "struts_detect_win.nbin", "struts_detect_nix.nbin", "struts_config_browser_detect.nbin");
      script_require_keys("Settings/ParanoidReport");
      script_require_ports("installed_sw/Apache Struts", "installed_sw/Struts");
    
      exit(0);
    }
    
    include('vcf.inc');
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    app_info = vcf::combined_get_app_info(app:'Apache Struts');
    vcf::check_granularity(app_info:app_info, sig_segments:3);
    
    constraints = [
      { 'min_version' : '2.0.0', 'max_version' : '2.3.28.1', 'fixed_display' : '2.3.29' }
    ];
    
    vcf::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_HOLE, flags:{xsrf:TRUE});
    
    
  • NASL familyCGI abuses
    NASL idMYSQL_ENTERPRISE_MONITOR_3_3_3_1199.NASL
    descriptionAccording to its self-reported version, the MySQL Enterprise Monitor application running on the remote host is 3.1.x prior to 3.1.7.8023, 3.2.x prior to 3.2.7.1204, or 3.3.x prior to 3.3.3.1199. It is, therefore, affected by multiple vulnerabilities : - A denial of service vulnerability exists in the Apache Commons component in the FileUpload functionality due to improper handling of file upload requests. An unauthenticated, remote attacker can exploit this, via a specially crafted content-type header, to cause a denial of service condition. Note that this vulnerability does not affect MySQL Enterprise Monitor versions 3.3.x. (CVE-2016-3092) - An unspecified flaw exists in the Apache Struts component that is triggered during the cleanup of action names. An unauthenticated, remote attacker can exploit this, via a specially crafted payload, to perform unspecified actions. (CVE-2016-4436) - A carry propagation error exists in the OpenSSL component in the Broadwell-specific Montgomery multiplication procedure when handling input lengths divisible by but longer than 256 bits. This can result in transient authentication and key negotiation failures or reproducible erroneous outcomes of public-key operations with specially crafted input. A man-in-the-middle attacker can possibly exploit this issue to compromise ECDH key negotiations that utilize Brainpool P-512 curves. (CVE-2016-7055) - An unspecified flaw exists in the Monitoring Server subcomponent that allows an authenticated, remote attacker to impact confidentiality and integrity. (CVE-2017-3306) - An unspecified flaw exists in the Monitoring Server subcomponent that allows an authenticated, remote attacker to impact integrity and availability. (CVE-2017-3307) - An out-of-bounds read error exists in the OpenSSL component when handling packets using the CHACHA20/POLY1305 or RC4-MD5 ciphers. An unauthenticated, remote attacker can exploit this, via specially crafted truncated packets, to cause a denial of service condition. (CVE-2017-3731) - A carry propagating error exists in the OpenSSL component in the x86_64 Montgomery squaring implementation that may cause the BN_mod_exp() function to produce incorrect results. An unauthenticated, remote attacker with sufficient resources can exploit this to obtain sensitive information regarding private keys. (CVE-2017-3732) - A remote code execution vulnerability exists in the Apache Struts component in the Jakarta Multipart parser due to improper handling of the Content-Type, Content-Disposition, and Content-Length headers. An unauthenticated, remote attacker can exploit this, via a specially crafted header value in the HTTP request, to execute arbitrary code. (CVE-2017-5638)
    last seen2020-06-01
    modified2020-06-02
    plugin id99593
    published2017-04-21
    reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/99593
    titleMySQL Enterprise Monitor 3.1.x < 3.1.7.8023 / 3.2.x < 3.2.7.1204 / 3.3.x < 3.3.3.1199 Multiple Vulnerabilities (April 2017 CPU)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(99593);
      script_version("1.15");
      script_cvs_date("Date: 2019/11/13");
    
      script_cve_id(
        "CVE-2016-3092",
        "CVE-2016-4436",
        "CVE-2016-7055",
        "CVE-2017-3306",
        "CVE-2017-3307",
        "CVE-2017-3731",
        "CVE-2017-3732",
        "CVE-2017-5638"
      );
      script_bugtraq_id(
        91280,
        91453,
        94242,
        95813,
        95814,
        96729,
        97724,
        97844
      );
      script_xref(name:"CERT", value:"834067");
      script_xref(name:"EDB-ID", value:"41570");
      script_xref(name:"EDB-ID", value:"41614");
    
      script_name(english:"MySQL Enterprise Monitor 3.1.x < 3.1.7.8023 / 3.2.x < 3.2.7.1204 / 3.3.x < 3.3.3.1199 Multiple Vulnerabilities (April 2017 CPU)");
      script_summary(english:"Checks the version of MySQL Enterprise Monitor.");
    
      script_set_attribute(attribute:"synopsis", value:
    "A web application running on the remote host is affected by multiple
    vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "According to its self-reported version, the MySQL Enterprise Monitor
    application running on the remote host is 3.1.x prior to 3.1.7.8023,
    3.2.x prior to 3.2.7.1204, or 3.3.x prior to 3.3.3.1199. It is,
    therefore, affected by multiple vulnerabilities :
    
      - A denial of service vulnerability exists in the Apache
        Commons component in the FileUpload functionality due to
        improper handling of file upload requests. An
        unauthenticated, remote attacker can exploit this, via a
        specially crafted content-type header, to cause a denial
        of service condition. Note that this vulnerability does
        not affect MySQL Enterprise Monitor versions 3.3.x.
        (CVE-2016-3092)
    
      - An unspecified flaw exists in the Apache Struts
        component that is triggered during the cleanup of action
        names. An unauthenticated, remote attacker can exploit
        this, via a specially crafted payload, to perform
        unspecified actions. (CVE-2016-4436)
    
      - A carry propagation error exists in the OpenSSL
        component in the Broadwell-specific Montgomery
        multiplication procedure when handling input lengths
        divisible by but longer than 256 bits. This can result
        in transient authentication and key negotiation failures
        or reproducible erroneous outcomes of public-key
        operations with specially crafted input. A
        man-in-the-middle attacker can possibly exploit this
        issue to compromise ECDH key negotiations that utilize
        Brainpool P-512 curves. (CVE-2016-7055)
    
      - An unspecified flaw exists in the Monitoring Server
        subcomponent that allows an authenticated, remote
        attacker to impact confidentiality and integrity.
        (CVE-2017-3306)
    
      - An unspecified flaw exists in the Monitoring Server
        subcomponent that allows an authenticated, remote
        attacker to impact integrity and availability.
        (CVE-2017-3307)
    
      - An out-of-bounds read error exists in the OpenSSL
        component when handling packets using the
        CHACHA20/POLY1305 or RC4-MD5 ciphers. An
        unauthenticated, remote attacker can exploit this, via
        specially crafted truncated packets, to cause a denial
        of service condition. (CVE-2017-3731)
    
      - A carry propagating error exists in the OpenSSL
        component in the x86_64 Montgomery squaring
        implementation that may cause the BN_mod_exp() function
        to produce incorrect results. An unauthenticated, remote
        attacker with sufficient resources can exploit this to
        obtain sensitive information regarding private keys.
        (CVE-2017-3732)
    
      - A remote code execution vulnerability exists in the
        Apache Struts component in the Jakarta Multipart parser
        due to improper handling of the Content-Type,
        Content-Disposition, and Content-Length headers.
        An unauthenticated, remote attacker can exploit this,
        via a specially crafted header value in the HTTP
        request, to execute arbitrary code. (CVE-2017-5638)");
      # https://www.oracle.com/technetwork/security-advisory/cpuapr2017-3236618.html#AppendixMSQL
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?d679be85");
      # http://www.oracle.com/technetwork/security-advisory/cpujul2017-3236622.html#AppendixMSQL
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?50229a1a");
      # https://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/3681811.xml
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?eb4db3c7");
      script_set_attribute(attribute:"see_also", value:"https://support.oracle.com/rs?type=doc&id=2244179.1");
      script_set_attribute(attribute:"see_also", value:"https://support.oracle.com/rs?type=doc&id=2279658.1");
      script_set_attribute(attribute:"see_also", value:"http://blog.talosintelligence.com/2017/03/apache-0-day-exploited.html");
      # https://threatpost.com/apache-struts-2-exploits-installing-cerber-ransomware/124844/
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?77e9c654");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to MySQL Enterprise Monitor version 3.1.7.8023 / 3.2.7.1204 /
    3.3.3.1199 or later as referenced in the April 2017 Oracle Critical
    Patch Update advisory.
    
    Note that the 3.2.x version was fixed for the CVE-2016-4436
    vulnerability in version 3.2.6.1182.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:ND");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:X");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2017-5638");
    
      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:"exploited_by_malware", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'Apache Struts Jakarta Multipart Parser OGNL Injection');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
      script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
      script_set_attribute(attribute:"canvas_package", value:'CANVAS');
      script_set_attribute(attribute:"in_the_news", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2016/06/21");
      script_set_attribute(attribute:"patch_publication_date", value:"2017/04/18");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/04/21");
    
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:oracle:mysql_enterprise_monitor");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("mysql_enterprise_monitor_web_detect.nasl");
      script_require_keys("installed_sw/MySQL Enterprise Monitor", "Settings/ParanoidReport");
      script_require_ports("Services/www", 18443);
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("install_func.inc");
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    app  = "MySQL Enterprise Monitor";
    get_install_count(app_name:app, exit_if_zero:TRUE);
    
    port = get_http_port(default:18443);
    
    install = get_single_install(app_name:app, port:port, exit_if_unknown_ver:TRUE);
    version = install['version'];
    install_url = build_url(port:port, qs:"/");
    
    fixes = {"^3.3": "3.3.3.1199",
             "^3.2": "3.2.7.1204",
             "^3.1": "3.1.7.8023"};
    
    vuln = FALSE;
    fix = '';
    foreach (prefix in keys(fixes))
    {
      if (version =~ prefix && ver_compare(ver:version,
                                           fix:fixes[prefix],
                                           strict:FALSE) < 0)
      { 
        vuln = TRUE;
        fix = fixes[prefix];
        break;
      }
    }
    
    if (vuln)
    {
      report =
        '\n  URL               : ' + install_url +
        '\n  Installed version : ' + version +
        '\n  Fixed version     : ' + fix +
        '\n';
      security_report_v4(port:port, severity:SECURITY_HOLE, extra:report);
    }
    else audit(AUDIT_WEB_APP_NOT_AFFECTED, app, install_url, version);