CVE-2023-25082

7.2 HIGH

📋 TL;DR

This vulnerability allows authenticated attackers with high privileges to execute arbitrary code on Milesight UR32L routers by sending specially crafted HTTP requests that trigger buffer overflows in the vtysh_ubus binary. The exploit occurs due to unsafe sprintf usage in firewall_handler_set function, affecting organizations using these routers for network infrastructure.

💻 Affected Systems

Products:
  • Milesight UR32L
Versions: v32.3.0.5 and possibly earlier versions
Operating Systems: Embedded Linux
Default Config Vulnerable: ⚠️ Yes
Notes: Requires attacker with high privileges (admin/root access) to exploit via HTTP requests to the router's management interface.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attacker to install persistent backdoors, pivot to internal networks, intercept/modify network traffic, and disable security functions.

🟠

Likely Case

Privilege escalation leading to router takeover, configuration modification, credential theft, and network disruption.

🟢

If Mitigated

Limited impact due to proper network segmentation, privilege restrictions, and monitoring preventing successful exploitation.

🌐 Internet-Facing: HIGH - HTTP interface may be exposed to internet, allowing remote exploitation if authentication is bypassed or credentials are compromised.
🏢 Internal Only: HIGH - Even internally, compromised credentials or insider threats could lead to router takeover and lateral movement.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires authentication with high privileges. Buffer overflow in firewall_handler_set function with old_ip and old_mac variables makes reliable exploitation feasible.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: Not publicly available

Restart Required: Yes

Instructions:

1. Check Milesight support for firmware updates. 2. Download latest firmware from vendor portal. 3. Backup current configuration. 4. Upload and install new firmware via web interface. 5. Restart router. 6. Restore configuration if needed.

🔧 Temporary Workarounds

Restrict HTTP Management Access

linux

Limit HTTP management interface access to trusted IP addresses only

iptables -A INPUT -p tcp --dport 80 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP

Disable Unused HTTP Interface

linux

Turn off HTTP management if HTTPS is sufficient

uci set uhttpd.main.listen_http=''
uci commit uhttpd
/etc/init.d/uhttpd restart

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate UR32L routers from critical systems
  • Enforce least privilege access controls and regularly rotate administrative credentials

🔍 How to Verify

Check if Vulnerable:

Check firmware version via web interface or SSH: cat /etc/version | grep 32.3.0.5

Check Version:

cat /etc/version

Verify Fix Applied:

Verify firmware version is newer than v32.3.0.5 and check for security patches in release notes

📡 Detection & Monitoring

Log Indicators:

  • Unusual HTTP requests to firewall configuration endpoints
  • Multiple failed authentication attempts followed by successful login and firewall modifications
  • Process crashes of vtysh_ubus binary

Network Indicators:

  • HTTP POST requests with unusually long old_ip or old_mac parameters to firewall endpoints
  • Traffic patterns suggesting reverse shells from router

SIEM Query:

source="router_logs" AND (uri="*firewall*" AND (param="old_ip" OR param="old_mac") AND length(param_value)>50)

🔗 References

📤 Share & Export