CVE-2020-36178

9.8 CRITICAL

📋 TL;DR

This CVE allows remote attackers to execute arbitrary operating system commands on TP-Link TL-WR840N routers by injecting malicious commands into an IP address field in the web interface. The vulnerability affects users of TP-Link TL-WR840N v6 routers with specific firmware versions. Attackers can gain full control of the device through command injection.

💻 Affected Systems

Products:
  • TP-Link TL-WR840N
Versions: v6 with firmware 0.9.1 4.16 (EU version confirmed)
Operating Systems: Embedded Linux on TP-Link hardware
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the oal_ipt_addBridgeIsolationRules function but similar issues may exist in other functions calling util_execSystem. EU version specifically mentioned but other regional versions may be affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the router allowing attackers to intercept all network traffic, install persistent malware, pivot to internal networks, and use the device as part of a botnet.

🟠

Likely Case

Router takeover enabling traffic interception, DNS hijacking, credential theft, and lateral movement to connected devices.

🟢

If Mitigated

Limited impact if web interface access is restricted and proper network segmentation is implemented.

🌐 Internet-Facing: HIGH - The web interface is typically accessible from WAN by default, making internet-facing devices directly exploitable.
🏢 Internal Only: MEDIUM - Internal attackers with network access can exploit the vulnerability if they reach the web interface.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires access to the web interface (typically requires authentication). The vulnerability is in a POST parameter that accepts raw input for iptables commands.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check TP-Link support for latest firmware

Vendor Advisory: https://www.tp-link.com/fr/support/download/tl-wr840n/v6/#Firmware

Restart Required: Yes

Instructions:

1. Log into TP-Link support portal. 2. Download latest firmware for TL-WR840N v6. 3. Access router web interface. 4. Navigate to System Tools > Firmware Upgrade. 5. Upload and install new firmware. 6. Router will reboot automatically.

🔧 Temporary Workarounds

Disable Remote Management

all

Prevent external access to the web interface by disabling remote management features.

Restrict Web Interface Access

linux

Use firewall rules to limit access to the router's web interface to trusted IP addresses only.

iptables -A INPUT -p tcp --dport 80 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
iptables -A INPUT -p tcp --dport 443 -j DROP

🧯 If You Can't Patch

  • Disable the web interface completely and use alternative management methods
  • Replace affected devices with patched or different models

🔍 How to Verify

Check if Vulnerable:

Check router firmware version in web interface under System Tools > Firmware Upgrade. If version is 0.9.1 4.16 or similar vulnerable version, device is affected.

Check Version:

Check web interface at System Tools > Firmware Upgrade or via SSH if available: cat /proc/version

Verify Fix Applied:

After firmware update, verify version has changed from vulnerable version. Test that input validation now properly sanitizes IP address fields.

📡 Detection & Monitoring

Log Indicators:

  • Unusual iptables commands in system logs
  • Multiple failed login attempts followed by successful login
  • Unexpected system command execution

Network Indicators:

  • Unusual outbound connections from router
  • DNS queries to suspicious domains
  • Unexpected port scans originating from router

SIEM Query:

source="router_logs" AND ("iptables" OR "system" OR "exec") AND command="*;*" OR command="*|*" OR command="*`*"

🔗 References

📤 Share & Export