SonicWall Secure Mobile Access Multiple Vulnerabilities (SNWLID-2021-0026) - Nessus

High   Plugin ID: 155961

This page contains detailed information about the SonicWall Secure Mobile Access Multiple Vulnerabilities (SNWLID-2021-0026) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 155961
Name: SonicWall Secure Mobile Access Multiple Vulnerabilities (SNWLID-2021-0026)
Filename: sonicwall_sma_SNWLID-2021-0026.nasl
Vulnerability Published: 2021-12-07
This Plugin Published: 2021-12-09
Last Modification Time: 2022-04-11
Plugin Version: 1.7
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: sonicwall_sma_web_detect.nbin
Required KB Items [?]: installed_sw/SonicWall Secure Mobile Access

Vulnerability Information


Severity: High
Vulnerability Published: 2021-12-07
Patch Published: 2021-12-07
CVE [?]: CVE-2021-20038, CVE-2021-20039, CVE-2021-20040, CVE-2021-20041, CVE-2021-20042, CVE-2021-20043, CVE-2021-20044, CVE-2021-20045
CPE [?]: cpe:/o:sonicwall:sma_100_firmware

Synopsis

The remote host is affected by multiple vulnerabilities.

Description

According to its self-reported version, the remote SonicWall Secure Mobile Access is affected by multiple vulnerabilities, including:

- An unauthenticated stack-based buffer overflow due to the SonicWall SMA SSLVPN Apache httpd server GET method of mod_cgi module environment variables use a single stack-based buffer using `strcat`. This can allow a remote, unauthenticated attacker to execute arbitrary code. (CVE-2021-20038)

- Multiple unauthenticated file explorer heap-based and stack-based buffer overflows due the sonicfiles RAC_COPY_TO (RacNumber 36) method which allows users to upload files to an SMB share and can be called without any authentication. This can allow a remote, unauthenticated attacker to execute arbitrary code as the nobody user. (CVE-2021-20045)

- A heap-based buffer overflow due to the RAC_GET_BOOKMARKS_HTML5 (RacNumber 35) method that allows users to list their bookmarks. This method is vulnerable to heap-based buffer-overflow, due to unchecked use of strcat. This can allow a remote, authenticated attacker to execute arbitrary code as the nobody user. (CVE-2021-20043)

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

Solution

Upgrade to version 10.2.0.9-41sv or 10.2.1.3-27sv or later.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the SonicWall Secure Mobile Access Multiple Vulnerabilities (SNWLID-2021-0026) vulnerability:

  1. Metasploit: exploit/linux/http/sonicwall_cve_2021_20039
    [SonicWall SMA 100 Series Authenticated Command Injection]
  2. GitHub: https://github.com/ExploitPwner/CVE-2021-20038-Mass-RCE
    [CVE-2021-20038: CVE-2021-20038 multithreaded Mass Scanner and Exploiter tool. SonicWall SMA-100 ...]
  3. GitHub: https://github.com/ExploitPwner/CVE-2021-20038-Mass-RCE-SonicWall
    [CVE-2021-20038: CVE-2021-20038 multithreaded Mass Scanner and Exploiter tool. SonicWall SMA-100 ...]
  4. GitHub: https://github.com/XmasSnowREAL/CVE-2021-20038-Mass-RCE
    [CVE-2021-20038: CVE-2021-20038 multithreaded Mass Scanner and Exploiter tool. SonicWall SMA-100 ...]
  5. GitHub: https://github.com/binganao/vulns-2022
    [CVE-2021-20038]
  6. GitHub: https://github.com/jbaines-r7/badblood
    [CVE-2021-20039]
  7. GitHub: https://github.com/jbaines-r7/badblood
    [CVE-2021-20038: SonicWall SMA-100 Unauth RCE Exploit (CVE-2021-20038)]

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-2021-20044
CVSS V2 Vector: AV:N/AC:L/Au:S/C:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score:9.0 (High)
Impact Subscore:10.0
Exploitability Subscore:8.0
CVSS Temporal Score:7.8 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.8 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:8.8 (High)
Impact Subscore:5.9
Exploitability Subscore:2.8
CVSS Temporal Score:8.4 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.4 (High)
STIG Severity [?]: I
STIG Risk Rating: High

Go back to menu.

Plugin Source


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

#%NASL_MIN_LEVEL 70300
##
# (C) Tenable Network Security, Inc.
##

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(155961);
  script_version("1.7");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id(
    "CVE-2021-20038",
    "CVE-2021-20039",
    "CVE-2021-20040",
    "CVE-2021-20041",
    "CVE-2021-20042",
    "CVE-2021-20043",
    "CVE-2021-20044",
    "CVE-2021-20045"
  );
  script_xref(name:"IAVA", value:"2021-A-0572");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/02/11");

  script_name(english:"SonicWall Secure Mobile Access Multiple Vulnerabilities (SNWLID-2021-0026)");

  script_set_attribute(attribute:"synopsis", value:
"The remote host is affected by multiple vulnerabilities.");
  script_set_attribute(attribute:"description", value:
"According to its self-reported version, the remote SonicWall Secure Mobile Access is affected by multiple
vulnerabilities, including:

  - An unauthenticated stack-based buffer overflow due to the SonicWall SMA SSLVPN Apache httpd server GET method of
    mod_cgi module environment variables use a single stack-based buffer using `strcat`. This can allow a remote,
    unauthenticated attacker to execute arbitrary code. (CVE-2021-20038)

  - Multiple unauthenticated file explorer heap-based and stack-based buffer overflows due the sonicfiles RAC_COPY_TO
    (RacNumber 36) method which allows users to upload files to an SMB share and can be called without any
    authentication. This can allow a remote, unauthenticated attacker to execute arbitrary code as the nobody user.
    (CVE-2021-20045)

  - A heap-based buffer overflow due to the RAC_GET_BOOKMARKS_HTML5 (RacNumber 35) method that allows users to list
    their bookmarks. This method is vulnerable to heap-based buffer-overflow, due to unchecked use of strcat. This can
    allow a remote, authenticated attacker to execute arbitrary code as the nobody user. (CVE-2021-20043)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version
number.");
  # https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0026
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?e1e1dbee");
  # https://www.sonicwall.com/support/product-notification/product-security-notice-sma-100-series-vulnerability-patches-q4-2021/211201154715443/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?01c34e29");
  script_set_attribute(attribute:"solution", value:
"Upgrade to version 10.2.0.9-41sv or 10.2.1.3-27sv or later.");
  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:H/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:H/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2021-20044");

  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:'SonicWall SMA 100 Series Authenticated Command Injection');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2021/12/07");
  script_set_attribute(attribute:"patch_publication_date", value:"2021/12/07");
  script_set_attribute(attribute:"plugin_publication_date", value:"2021/12/09");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:sonicwall:sma_100_firmware");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

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

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

  script_dependencies("sonicwall_sma_web_detect.nbin");
  script_require_keys("installed_sw/SonicWall Secure Mobile Access");

  exit(0);
}

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

var app_name = 'SonicWall Secure Mobile Access';
var port = get_http_port(default:443,embedded:TRUE);
var app = vcf::get_app_info(app:app_name, webapp:TRUE, port:port);

if (app['Model'] !~ "SMA (200|210|400|410|500v)")
  audit(AUDIT_WEB_APP_NOT_AFFECTED, app_name, port);

var constraints =
[
  {'min_version' : '9.0.0.0.0', 'max_version': '9.0.0.11.31', 'fixed_version' : '10.2.0.9.41', 'fixed_display':'Upgrade to version 10.2.0.9-41sv or later.'},
  {'min_version' : '10.2.0.0.0', 'max_version': '10.2.0.8.37', 'fixed_version' : '10.2.0.9.41', 'fixed_display':'Upgrade to version 10.2.0.9-41sv or later.'},
  {'min_version' : '10.2.1.0.0', 'max_version': '10.2.1.1.19', 'fixed_version' : '10.2.1.3.27', 'fixed_display':'Upgrade to version 10.2.1.3-27sv or later.'},
  {'min_version' : '10.2.1.2.0', 'max_version': '10.2.1.2.24', 'fixed_version' : '10.2.1.3.27', 'fixed_display':'Upgrade to version 10.2.1.3-27sv or later.'}
];

vcf::check_version_and_report(app_info:app, constraints:constraints, severity:SECURITY_HOLE);

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

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/sonicwall_sma_SNWLID-2021-0026.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\sonicwall_sma_SNWLID-2021-0026.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/sonicwall_sma_SNWLID-2021-0026.nasl

Go back to menu.

How to Run


Here is how to run the SonicWall Secure Mobile Access Multiple Vulnerabilities (SNWLID-2021-0026) 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 CGI abuses plugin family.
  6. On the right side table select SonicWall Secure Mobile Access Multiple Vulnerabilities (SNWLID-2021-0026) plugin ID 155961.
  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 sonicwall_sma_SNWLID-2021-0026.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a sonicwall_sma_SNWLID-2021-0026.nasl -t <IP/HOST>

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

/opt/nessus/bin/nasl -T - sonicwall_sma_SNWLID-2021-0026.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 sonicwall_sma_SNWLID-2021-0026.nasl -t <IP/HOST>

Go back to menu.

References


IAVA | Information Assurance Vulnerability Alert:
  • 2021-A-0572
See also: Similar and related Nessus plugins:
  • 146091 - SonicWall Secure Mobile Access Remote Code Execution (SNWLID-2021-0001)
  • 159487 - SonicWall Secure Mobile Access (SMA) SQLi (SNWLID-2021-0017)
  • 153807 - SonicWall Secure Mobile Access Arbitrary File Delete (SNWLID-2021-0021)
  • 150720 - SonicWall Secure Remote Access (SRA) Pre-Authentication SQLi (CVE-2019-7481)
  • 159486 - SonicWall Secure Remote Access (SRA) SQLi (SNWLID-2021-0017)
  • 27618 - SonicWALL SSL-VPN NetExtender NELaunchCtrl ActiveX Control Multiple Overflows
  • 127107 - SonicWall SonicOS Firewall Multiple Management Vulnerabilities (URGENT/11)
  • 141474 - SonicWall SonicOS Buffer Overflow Vulnerability
  • 157199 - Apple iOS < 15.3 Multiple Vulnerabilities (HT213053)
  • 157403 - macOS 12.x < 12.2 (HT213054)
  • 157242 - macOS 11.x < 11.6.3 Multiple Vulnerabilities (HT213055)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file sonicwall_sma_SNWLID-2021-0026.nasl version 1.7. For more plugins, visit the Nessus Plugin Library.

Go back to menu.