Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2020-14472

CVE-2020-14472: Draytek Vigor300b RCE Vulnerability

CVE-2020-14472 is a command injection RCE flaw in Draytek Vigor3900, Vigor2960, and Vigor300b devices that enables attackers to execute arbitrary commands. This article covers technical details, affected versions, and mitigation.

Updated:

CVE-2020-14472 Overview

CVE-2020-14472 is a command injection vulnerability affecting Draytek Vigor3900, Vigor2960, and Vigor 300B enterprise routers running firmware before version 1.5.1.1. The flaw resides in the mainfunction.cgi file and allows unauthenticated attackers to inject arbitrary operating system commands through crafted network requests. The vulnerability is categorized as Improper Neutralization of Special Elements used in a Command [CWE-77]. Successful exploitation grants attackers full control over the affected router, enabling traffic interception, lateral movement, and persistent network compromise.

Critical Impact

Unauthenticated remote attackers can execute arbitrary commands on affected Draytek Vigor devices, compromising the router and any network it gates.

Affected Products

  • Draytek Vigor3900 firmware before 1.5.1.1
  • Draytek Vigor2960 firmware before 1.5.1.1
  • Draytek Vigor 300B firmware before 1.5.1.1

Discovery Timeline

  • 2020-06-24 - CVE-2020-14472 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2020-14472

Vulnerability Analysis

The vulnerability resides in the mainfunction.cgi script exposed by the device web management interface. The script accepts user-supplied parameters and passes them to underlying shell commands without proper sanitization. Attackers can append shell metacharacters such as ;, |, or backticks to legitimate parameters and have the appended payload executed by the device shell.

Because the affected endpoint is reachable over the network without authentication, exploitation requires no credentials and no user interaction. Commands execute in the context of the web server process, which on these embedded devices typically runs with elevated privileges. The EPSS probability of 2.669% (85.97 percentile) reflects measurable real-world exploitation interest against this class of edge devices.

Root Cause

The root cause is unsafe handling of HTTP request parameters inside mainfunction.cgi. Input received from the network is concatenated directly into command strings passed to the operating system shell. The CGI implementation lacks both allow-list validation and metacharacter escaping, satisfying the conditions for [CWE-77] command injection.

Attack Vector

The vulnerability is exploited remotely over HTTP or HTTPS by sending a crafted request to the mainfunction.cgi endpoint on the router management interface. The attacker supplies a parameter value containing shell metacharacters followed by the desired command. Public proof-of-concept code is available on GitHub Gist, demonstrating parameter manipulation that triggers command execution on the router shell. See the GitHub Gist PoC Code and the GitHub Gist Exploit Code for technical details.

Detection Methods for CVE-2020-14472

Indicators of Compromise

  • HTTP requests to /cgi-bin/mainfunction.cgi containing shell metacharacters such as ;, |, &, backticks, or $() in parameter values.
  • Outbound connections initiated from the router to unknown hosts shortly after suspicious requests to the management interface.
  • Unexpected new accounts, modified firewall rules, or altered DNS settings on the Vigor device.
  • Presence of downloaded binaries or scripts in writable directories on the router filesystem.

Detection Strategies

  • Inspect web server and reverse proxy logs for requests targeting mainfunction.cgi with anomalous URL-encoded characters or unusually long parameters.
  • Deploy network intrusion detection signatures matching command injection patterns against the Draytek management URI.
  • Compare device firmware version banners across the fleet to identify routers running versions earlier than 1.5.1.1.

Monitoring Recommendations

  • Forward router syslog and HTTP access logs to a centralized analytics platform for retrospective hunting.
  • Alert on management interface access from any source outside an approved administrator IP allow-list.
  • Monitor for configuration changes on the Vigor devices using scheduled integrity checks and SNMP polling.

How to Mitigate CVE-2020-14472

Immediate Actions Required

  • Upgrade affected Draytek Vigor3900, Vigor2960, and Vigor 300B devices to firmware 1.5.1.1 or later immediately.
  • Disable WAN-side access to the router web management interface until patching is complete.
  • Audit device configurations, administrative accounts, and firewall rules for unauthorized modifications.
  • Rotate any credentials stored on or passing through the affected devices.

Patch Information

Draytek addressed this vulnerability in firmware version 1.5.1.1. Administrators should download the latest firmware from the official Draytek support portal and apply it through the device management interface or vendor-supplied update tooling. Verify post-update that the firmware version reported by the device is 1.5.1.1 or higher before returning the unit to service.

Workarounds

  • Restrict access to the router web management interface to a dedicated management VLAN or trusted administrative subnet.
  • Place the management interface behind a VPN and disable HTTP and HTTPS exposure on the WAN interface.
  • Apply ACLs at upstream firewalls to block external traffic destined for the router management ports.
bash
# Configuration example - restrict management interface exposure
# Disable WAN-side HTTP/HTTPS management on Draytek Vigor (CLI)
set management wan_access disable
set management https_wan disable
set management http_wan disable
# Allow management only from trusted subnet
set management acl add 10.10.0.0/24 allow
set management acl default deny

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.