CVE-2020-7982

8.1 HIGH

📋 TL;DR

This vulnerability in OpenWrt/LEDE's opkg package manager allows man-in-the-middle attackers to inject malicious packages that install without verification. It affects OpenWrt 18.06.0-18.06.6 and 19.07.0, and LEDE 17.01.0-17.01.7. Attackers can achieve remote code execution on vulnerable routers and embedded devices.

💻 Affected Systems

Products:
  • OpenWrt
  • LEDE
Versions: OpenWrt 18.06.0 to 18.06.6 and 19.07.0; LEDE 17.01.0 to 17.01.7
Operating Systems: Linux-based embedded systems
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerable when using package repositories over HTTP or when HTTPS connections can be intercepted

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise via arbitrary package installation leading to persistent backdoor, data theft, and device takeover

🟠

Likely Case

Malicious package installation resulting in remote code execution, network compromise, and lateral movement

🟢

If Mitigated

No impact if using patched versions or isolated networks with certificate pinning

🌐 Internet-Facing: HIGH - Devices exposed to internet are directly vulnerable to MITM attacks during package updates
🏢 Internal Only: MEDIUM - Requires attacker to be positioned on network path between device and update server

🎯 Exploit Status

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

Exploitation requires MITM position but no authentication; public proof-of-concept demonstrates package injection

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: opkg after 2020-01-25; OpenWrt 18.06.7+, 19.07.1+

Vendor Advisory: https://openwrt.org/advisory/2020-01-31-1

Restart Required: No

Instructions:

1. Update opkg package: 'opkg update && opkg upgrade opkg' 2. Update entire system: 'opkg update && opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade' 3. For firmware: Flash to OpenWrt 18.06.7+ or 19.07.1+

🔧 Temporary Workarounds

Use HTTPS repositories only

linux

Configure opkg to use only HTTPS repositories to prevent MITM attacks

sed -i 's/http:/https:/g' /etc/opkg/distfeeds.conf
opkg update

Disable package updates

linux

Temporarily disable package manager updates until patching

rm /etc/opkg/distfeeds.conf
echo 'src/gz openwrt_core file:///dev/null' > /etc/opkg/distfeeds.conf

🧯 If You Can't Patch

  • Isolate vulnerable devices from untrusted networks and internet
  • Implement network segmentation and monitor for suspicious package installation attempts

🔍 How to Verify

Check if Vulnerable:

Check opkg version: 'opkg --version | head -1' - versions before 2020-01-25 are vulnerable

Check Version:

opkg --version | head -1

Verify Fix Applied:

Verify opkg version is after 2020-01-25: 'opkg --version | grep -q 2020 && echo "Patched" || echo "Vulnerable"'

📡 Detection & Monitoring

Log Indicators:

  • Unexpected package installations in /var/log/opkg.log
  • Package signatures failing verification

Network Indicators:

  • MITM activity between device and package repositories
  • Unencrypted package downloads

SIEM Query:

source="/var/log/opkg.log" AND "install" AND NOT expected_package_name

🔗 References

📤 Share & Export