Grandstream Networks UCM6200 Series SQLi (Web UI) - Nessus

Critical   Plugin ID: 160531

This page contains detailed information about the Grandstream Networks UCM6200 Series SQLi (Web UI) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 160531
Name: Grandstream Networks UCM6200 Series SQLi (Web UI)
Filename: grandstream_networking_cve-2020-5722.nasl
Vulnerability Published: 2020-03-23
This Plugin Published: 2022-05-05
Last Modification Time: 2022-05-05
Plugin Version: 1.2
Plugin Type: remote
Plugin Family: Misc.
Dependencies: grandstream_networking_solutions_web_detect.nbin

Vulnerability Information


Severity: Critical
Vulnerability Published: 2020-03-23
Patch Published: 2020-02-03
CVE [?]: CVE-2020-5722
CPE [?]: N/A

Synopsis

The remote device is vulnerable and can be compromised

Description

A SQL injection vulnerability exists in Grandstream UCM6200 Series devices. An unauthenticated, remote attacker can exploit this to execute shell commands as root on versions before 1.0.19.20 or inject HTML in password recovery emails in versions before 1.0.20.17.

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.

Solution

Update to the fixed version as per the advisory.

Public Exploits


Target Network Port(s): 80, 443
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Grandstream Networks UCM6200 Series SQLi (Web UI) vulnerability:

  1. Metasploit: exploit/linux/http/grandstream_ucm62xx_sendemail_rce
    [Grandstream UCM62xx IP PBX sendPasswordEmail RCE]
  2. Exploit-DB: exploits/hardware/webapps/48247.py
    [EDB-48247: UCM6202 1.0.18.13 - Remote Command Injection]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2020-5722
CVSS V2 Vector: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.7 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.7 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:9.4 (Critical)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.4 (Critical)

Go back to menu.

Plugin Source


This is the grandstream_networking_cve-2020-5722.nasl nessus plugin source code. This script is Copyright (C) 2022 and is owned by Tenable, Inc. or an Affiliate thereof.

##
# (C) Tenable, Inc.
##

include('compat.inc');

if (description)
{
  script_id(160531);
  script_version("1.2");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/05/05");

  script_cve_id("CVE-2020-5722");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/07/28");

  script_name(english:"Grandstream Networks UCM6200 Series SQLi (Web UI)");

  script_set_attribute(attribute:"synopsis", value:
"The remote device is vulnerable and can be compromised");
  script_set_attribute(attribute:"description", value:
"A SQL injection vulnerability exists in Grandstream UCM6200 Series devices. An unauthenticated, remote attacker can
exploit this to execute shell commands as root on versions before 1.0.19.20 or inject HTML in password recovery emails
in versions before 1.0.20.17. 

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version
number.");
  script_set_attribute(attribute:"see_also", value:"https://www.tenable.com/security/research/tra-2020-15");
  script_set_attribute(attribute:"solution", value:
"Update to the fixed version as per the advisory.");
  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:N/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:"cvss_score_source", value:"CVE-2020-5722");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Grandstream UCM62xx IP PBX sendPasswordEmail RCE');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2020/03/23");
  script_set_attribute(attribute:"patch_publication_date", value:"2020/02/03");
  script_set_attribute(attribute:"plugin_publication_date", value:"2022/05/05");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Misc.");

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

  script_dependencies("grandstream_networking_solutions_web_detect.nbin");
  script_require_ports("Services/www", 80, 443);

  exit(0);
}

include('vcf.inc');
include('vcf_extras.inc');

var port = get_http_port(default:80, embedded:TRUE);
var app_info = vcf::get_app_info(app:'Grandstream Networking Solutions', port:port, webapp:TRUE);

# UCM6200 Series Models only. Empty model and paranoid still runs
if (empty_or_null(app_info.Model))
{
  if (report_paranoia < 2)
    audit(AUDIT_POTENTIAL_VULN, 'Grandstream device', app_info.version);
  else
    app_info.Model = UNKNOWN_VER;
}
else if (app_info.Model !~ "UCM62[0-9]{2}($|[^0-9])")
  audit(AUDIT_HOST_NOT, 'an affected Grandstream device');

var constraints = [
  { 'fixed_version' : '1.0.20.17' }
];

vcf::grandstream::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_HOLE, flags:{'sqli':TRUE});

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/grandstream_networking_cve-2020-5722.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\grandstream_networking_cve-2020-5722.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/grandstream_networking_cve-2020-5722.nasl

Go back to menu.

How to Run


Here is how to run the Grandstream Networks UCM6200 Series SQLi (Web UI) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Misc. plugin family.
  6. On the right side table select Grandstream Networks UCM6200 Series SQLi (Web UI) plugin ID 160531.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl grandstream_networking_cve-2020-5722.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a grandstream_networking_cve-2020-5722.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - grandstream_networking_cve-2020-5722.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state grandstream_networking_cve-2020-5722.nasl -t <IP/HOST>

Go back to menu.

References


See also: Similar and related Nessus plugins:
  • 160530 - Grandstream Networks UCM6200 Series SQLi (Phone Web UI)
  • 160532 - Grandstream Networks UCM6200 Series SQLi (SIP)
  • 123520 - Multiple Command Injection Vulnerabilities in Grandstream Products
  • 123796 - Blind Command Injection Vulnerability in Grandstream Products
  • 124173 - Multiple Command Injection Vulnerabilities in Grandstream Products
  • 137182 - Cisco IOS XE Software Web UI RCE (cisco-sa-iosxe-webui-rce-uk8BXcUD)
  • 139325 - Cisco IOS XE Software Web UI Command Injection (cisco-sa-web-cmdinj2-fOnjk2LD)
  • 106699 - FreeBSD : Mailman -- XSS (XSS) vulnerability in the web UI (3d0eeef8-0cf9-11e8-99b0-d017c2987f9a)
  • 88965 - Nessus Web UI Scanned Content Stored XSS
  • 99595 - Tenable Appliance < 4.5.0 Web UI simpleupload.py Remote Command Execution (CVE-2017-8051)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file grandstream_networking_cve-2020-5722.nasl version 1.2. For more plugins, visit the Nessus Plugin Library.

Go back to menu.