CVE-2024-39227

9.8 CRITICAL

📋 TL;DR

This vulnerability allows unauthenticated attackers to execute arbitrary code or perform directory traversal attacks on affected GL-iNet routers via the /cgi-bin/glc endpoint. Attackers can exploit insecure permissions by sending crafted JSON data without authentication. All users running vulnerable firmware versions on listed GL-iNet products are affected.

💻 Affected Systems

Products:
  • AR750
  • AR750S
  • AR300M
  • AR300M16
  • MT300N-V2
  • B1300
  • MT1300
  • SFT1200
  • X750
  • MT3000
  • MT2500
  • AXT1800
  • AX1800
  • A1300
  • X300B
  • XE300
  • E750
  • AP1300
  • S1300
  • XE3000
  • X3000
Versions: v4.3.11, v4.5.16, v4.3.16, v4.3.12, v4.3.13, v4.4
Operating Systems: GL-iNet firmware
Default Config Vulnerable: ⚠️ Yes
Notes: All default configurations are vulnerable as the endpoint is accessible without authentication.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the router allowing persistent backdoor installation, network traffic interception, lateral movement to connected devices, and router bricking.

🟠

Likely Case

Remote code execution leading to router configuration changes, credential theft, DNS hijacking, and botnet recruitment.

🟢

If Mitigated

Limited impact if network segmentation isolates routers and strict firewall rules block external access to management interfaces.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

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

The vulnerability requires sending crafted JSON to a specific endpoint, which is straightforward for attackers with basic HTTP knowledge.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check GL-iNet firmware updates for each model

Vendor Advisory: https://github.com/gl-inet/CVE-issues/blob/main/4.0.0/Access%20to%20the%20C%20library%20without%20logging%20in.md

Restart Required: Yes

Instructions:

1. Log into router admin interface. 2. Navigate to System > Firmware Upgrade. 3. Check for available updates. 4. Download and install latest firmware. 5. Reboot router after installation.

🔧 Temporary Workarounds

Block CGI endpoint access

linux

Use firewall rules to block external access to /cgi-bin/glc endpoint

iptables -A INPUT -p tcp --dport 80 -m string --string "/cgi-bin/glc" --algo bm -j DROP
iptables -A INPUT -p tcp --dport 443 -m string --string "/cgi-bin/glc" --algo bm -j DROP

Disable remote administration

all

Turn off remote management access to router web interface

🧯 If You Can't Patch

  • Segment affected routers on isolated VLANs with strict firewall rules
  • Implement network monitoring for unusual traffic to /cgi-bin/glc endpoint

🔍 How to Verify

Check if Vulnerable:

Check firmware version in router admin interface under System > Status, or run: cat /etc/glversion

Check Version:

cat /etc/glversion

Verify Fix Applied:

Verify firmware version is updated beyond vulnerable versions listed, and test if /cgi-bin/glc endpoint requires authentication

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests to /cgi-bin/glc with JSON payloads
  • Unusual process execution from web server user
  • Failed authentication attempts followed by successful /cgi-bin/glc access

Network Indicators:

  • Unusual outbound connections from router
  • HTTP POST requests to /cgi-bin/glc from external IPs
  • Sudden traffic spikes from router

SIEM Query:

source="router_logs" AND (uri="/cgi-bin/glc" OR method="POST" AND uri CONTAINS "glc")

🔗 References

📤 Share & Export