CVE-2021-45039

9.8 CRITICAL

📋 TL;DR

This critical vulnerability allows remote unauthenticated attackers to execute arbitrary code on Uniview IP cameras by exploiting a buffer overflow in an undocumented UDP service on port 7788. Successful exploitation enables attackers to start telnetd with hardcoded credentials and bypass restricted shell access. Organizations using affected Uniview IP camera models are at risk.

💻 Affected Systems

Products:
  • Uniview IP Camera models: IPC_G6103
  • IPC_G61
  • IPC21
  • IPC23
  • IPC32
  • IPC36
  • IPC62
  • IPC_HCMN
Versions: Multiple firmware versions including B6103.16.10.B25.201218 and others
Operating Systems: Embedded Linux systems on Uniview cameras
Default Config Vulnerable: ⚠️ Yes
Notes: The undocumented UDP service on port 7788 is enabled by default on affected models.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of camera systems leading to persistent backdoor access, lateral movement to internal networks, video surveillance disruption, and potential use in botnets or ransomware attacks.

🟠

Likely Case

Remote code execution leading to camera compromise, unauthorized access to video feeds, and potential use as foothold for further network attacks.

🟢

If Mitigated

Limited impact if cameras are isolated in separate network segments with strict firewall rules blocking port 7788.

🌐 Internet-Facing: HIGH - Directly exploitable from internet without authentication, CVSS 9.8 indicates critical severity for exposed devices.
🏢 Internal Only: HIGH - Even internally, the vulnerability requires no authentication and allows complete system compromise.

🎯 Exploit Status

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

Exploit chain is well-documented: buffer overflow → start telnetd → use hardcoded credentials root/123456 → bypass restricted shell via ECHO command.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check vendor advisory for specific patched firmware versions

Vendor Advisory: https://www.uniview.com/About_Us/Security/Notice/202112/920471_140493_0.htm

Restart Required: Yes

Instructions:

1. Check current firmware version. 2. Download latest firmware from Uniview support portal. 3. Upload firmware to camera via web interface. 4. Reboot camera after update completes.

🔧 Temporary Workarounds

Network Segmentation and Firewall Rules

linux

Block UDP port 7788 at network perimeter and segment cameras from critical networks

iptables -A INPUT -p udp --dport 7788 -j DROP
iptables -A FORWARD -p udp --dport 7788 -j DROP

Disable Telnet Service

linux

Remove or disable telnetd service if camera configuration allows

chmod -x /usr/sbin/telnetd
rm /usr/sbin/telnetd

🧯 If You Can't Patch

  • Immediately block UDP port 7788 at network firewalls and ensure cameras are in isolated VLANs
  • Change default credentials and monitor for unauthorized telnet connections

🔍 How to Verify

Check if Vulnerable:

Use nmap to scan for open UDP port 7788: nmap -sU -p 7788 <camera_ip>

Check Version:

Check camera web interface under System Information or use curl to query status page

Verify Fix Applied:

Verify port 7788 is no longer responding and check firmware version matches patched release

📡 Detection & Monitoring

Log Indicators:

  • Unexpected telnetd service startup
  • Failed authentication attempts with root/123456
  • Unusual UDP traffic on port 7788

Network Indicators:

  • UDP traffic to port 7788 from unexpected sources
  • Telnet connections to camera ports
  • Unusual outbound traffic from cameras

SIEM Query:

source_port=7788 OR dest_port=7788 OR (service=telnet AND (username=root AND password=123456))

🔗 References

📤 Share & Export