CVE-2021-28302
📋 TL;DR
This CVE describes a stack overflow vulnerability in the pupnp library's XML parser that can be triggered by maliciously crafted documents. When exploited, it causes denial of service through recursive node cleanup that consumes all available stack space and crashes the application. Any system using vulnerable versions of pupnp (commonly found in UPnP implementations for media servers, IoT devices, and network services) is affected.
💻 Affected Systems
- pupnp library
- Any software using vulnerable pupnp versions
📦 What is this software?
Pupnp by Pupnp Project
⚠️ Risk & Real-World Impact
Worst Case
Complete service disruption through application crash, potentially affecting dependent services and requiring manual intervention to restore functionality.
Likely Case
Denial of service causing application crashes and service interruptions when processing malicious XML content.
If Mitigated
Minimal impact with proper network segmentation and monitoring; crashes would be contained and quickly detected.
🎯 Exploit Status
Exploitation requires sending specially crafted XML to the vulnerable service but doesn't require authentication.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.14.5 and later
Vendor Advisory: https://github.com/pupnp/pupnp/releases/tag/release-1.14.5
Restart Required: Yes
Instructions:
1. Download pupnp version 1.14.5 or later from GitHub. 2. Replace existing installation with patched version. 3. Recompile any applications using the library. 4. Restart affected services.
🔧 Temporary Workarounds
Disable XML parsing if unused
allIf XML parsing functionality is not required, disable or restrict access to the vulnerable component.
Network segmentation
linuxRestrict network access to services using pupnp to trusted sources only.
iptables -A INPUT -p tcp --dport [UPNP_PORT] -s [TRUSTED_NETWORK] -j ACCEPT
iptables -A INPUT -p tcp --dport [UPNP_PORT] -j DROP
🧯 If You Can't Patch
- Implement strict network filtering to limit access to vulnerable services
- Deploy monitoring and alerting for application crashes or abnormal termination
🔍 How to Verify
Check if Vulnerable:
Check pupnp version with 'pkg-config --modversion libupnp' or examine library files for version strings.
Check Version:
pkg-config --modversion libupnp || strings /usr/lib/libupnp.so* | grep -i version
Verify Fix Applied:
Confirm version is 1.14.5 or higher and test XML parsing functionality remains operational.
📡 Detection & Monitoring
Log Indicators:
- Application crashes with stack overflow errors
- Abnormal termination of UPnP services
- Repeated service restarts
Network Indicators:
- Unusual XML payloads sent to UPnP ports
- Traffic patterns indicating denial of service attempts
SIEM Query:
source="application.log" AND ("stack overflow" OR "segmentation fault" OR "crash") AND process="*upnp*"