CVE-2020-28951
📋 TL;DR
CVE-2020-28951 is a use-after-free vulnerability in libuci (Unified Configuration Interface) used by OpenWrt. Attackers can exploit this by providing malicious package names to potentially execute arbitrary code or cause denial of service. This affects OpenWrt devices running vulnerable versions of libuci.
💻 Affected Systems
- OpenWrt
- Devices using OpenWrt firmware
📦 What is this software?
Openwrt by Openwrt
Openwrt by Openwrt
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, allowing attackers to install malware, pivot to other systems, or create persistent backdoors.
Likely Case
Denial of service causing system crashes or instability, potentially requiring device reboot or reconfiguration.
If Mitigated
Limited impact if proper network segmentation and access controls prevent malicious package uploads.
🎯 Exploit Status
Exploitation requires crafting malicious package names to trigger the use-after-free condition. The vulnerability is in core configuration parsing code.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: OpenWrt 18.06.9 and 19.07.5
Vendor Advisory: https://openwrt.org/advisory/2020-12-01-1
Restart Required: Yes
Instructions:
1. Update OpenWrt to version 18.06.9 or 19.07.5 or later. 2. Use 'opkg update && opkg upgrade' command. 3. Reboot the device after upgrade completes.
🔧 Temporary Workarounds
Restrict package management access
linuxLimit who can upload or modify packages on the OpenWrt device
Configure firewall rules to restrict access to package management services
Use strong authentication for administrative interfaces
🧯 If You Can't Patch
- Network segmentation: Isolate OpenWrt devices from untrusted networks
- Monitor for suspicious package uploads or configuration changes
🔍 How to Verify
Check if Vulnerable:
Check OpenWrt version with 'cat /etc/openwrt_release' or 'opkg list-installed | grep uci'
Check Version:
cat /etc/openwrt_release | grep VERSION
Verify Fix Applied:
Verify version is 18.06.9 or 19.07.5 or later, and check that libuci package is updated
📡 Detection & Monitoring
Log Indicators:
- Unexpected package installation attempts
- System crashes or segmentation faults in uci processes
- Failed authentication attempts to package management interfaces
Network Indicators:
- Unusual network traffic to/from OpenWrt management interfaces
- Suspicious package uploads via HTTP/HTTPS
SIEM Query:
source="openwrt" AND (event="package_install" OR event="uci_error" OR process="uci")
🔗 References
- https://git.openwrt.org/?p=openwrt/openwrt.git%3Ba=commit%3Bh=5625f5bc36954d644cb80adf8de47854c65d91c3
- https://git.openwrt.org/?p=openwrt/openwrt.git%3Ba=log%3Bh=refs/tags/v18.06.9
- https://git.openwrt.org/?p=project/uci.git%3Ba=commit%3Bh=a3e650911f5e6f67dcff09974df3775dfd615da6
- https://git.openwrt.org/?p=openwrt/openwrt.git%3Ba=commit%3Bh=5625f5bc36954d644cb80adf8de47854c65d91c3
- https://git.openwrt.org/?p=openwrt/openwrt.git%3Ba=log%3Bh=refs/tags/v18.06.9
- https://git.openwrt.org/?p=project/uci.git%3Ba=commit%3Bh=a3e650911f5e6f67dcff09974df3775dfd615da6