CVE-2024-21877
Executive Summary
CVE-2024-21877 is a path traversal vulnerability in Enphase IQ Gateway (formerly Envoy) that allows an authenticated attacker to manipulate files on the device via a URL parameter. The vulnerability affects versions from 4.x up to 8.0 and versions below 8.2.4225. The CVSS score is currently 0.0, indicating incomplete scoring data, but the impact is significant as it enables file manipulation on the gateway. The EPSS score is 0.0%, suggesting low exploitation likelihood at this time, but the vulnerability is unpatched for many versions. No public proof-of-concept or exploit code is available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It affects embedded firmware on Enphase IQ Gateway devices.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder or incomplete assessment. Based on the vulnerability characteristics (authenticated path traversal leading to file manipulation), a reasonable CVSS vector would be:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): Low (L) – requires authentication
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): High (H) – file manipulation can expose sensitive data
- Integrity (I): High (H) – file manipulation can alter system files
- Availability (A): High (H) – file manipulation can cause denial of service
Estimated CVSS:3.1 Score: 7.5 (High)
Threat Level: High – due to the potential for file manipulation, which can lead to configuration changes, data exfiltration, or persistent compromise.
Deep Dive & Mechanics
The vulnerability is an improper limitation of a pathname to a restricted directory (path traversal) in the Enphase IQ Gateway. The issue exists in a URL parameter that does not properly sanitize user input, allowing an attacker to traverse directories outside the intended web root. Since authentication is required, the attacker must have valid credentials (e.g., installer or owner credentials). Once authenticated, the attacker can manipulate files on the device, potentially overwriting configuration files, injecting malicious scripts, or reading sensitive data.
The vulnerable code likely processes a URL parameter like file=../../etc/passwd without proper validation. The fix in version 8.2.4225 presumably adds input validation to restrict file paths to a safe directory.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
# Example of vulnerable path handling
def get_file(request):
filename = request.GET.get('file')
# No path validation
with open(filename, 'r') as f:
return f.read()
Patched Code (Conceptual):
import os
def get_file(request):
filename = request.GET.get('file')
# Validate path is within allowed directory
safe_dir = '/var/www/files'
full_path = os.path.normpath(os.path.join(safe_dir, filename))
if not full_path.startswith(safe_dir):
return "Access denied", 403
with open(full_path, 'r') as f:
return f.read()
Exploitation & Lab Setup
Red Team
Prerequisites:
- Valid credentials for the Enphase IQ Gateway (e.g., installer or owner account)
- Network access to the gateway (typically on local network or via cloud if exposed)
Exploitation Steps:
- Authenticate to the gateway (e.g., via web interface or API).
- Identify the vulnerable endpoint (likely a file download or configuration page).
- Craft a request with a path traversal payload in the URL parameter:
GET /path/to/endpoint?file=../../etc/passwd HTTP/1.1 Host: <gateway_ip> Cookie: <session_cookie> - Observe the response for file contents or manipulation success.
Example Request:
GET /api/v1/file?name=../../etc/shadow HTTP/1.1
Host: 192.168.1.100
Cookie: session=valid_session_token
Blue Team
Detection:
- Monitor for unusual file access patterns in web server logs.
- Look for path traversal patterns in URL parameters (e.g.,
../,..\\,%2e%2e%2f). - Alert on access to sensitive files like
/etc/passwd,/etc/shadow, or configuration files.
Hunting:
- Search for HTTP requests containing
../or encoded variants. - Correlate with authentication logs to identify compromised accounts.
Mitigation:
- Upgrade to version 8.2.4225 or later.
- If upgrade is not possible, restrict network access to the gateway and use strong authentication.
- Implement web application firewall (WAF) rules to block path traversal attempts.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests with path traversal patterns in URL parameters (e.g.,
../,..\\,%2e%2e%2f) - Requests to sensitive files like
/etc/passwd,/etc/shadow,/var/log/syslog - Unusual file download requests from the gateway
File IOCs:
- Modified configuration files (e.g.,
/etc/config.json,/var/www/html/index.html) - Presence of unexpected files in the web root
- Changes to system binaries or scripts
Log IOCs:
- Web server logs showing path traversal attempts
- Authentication logs showing repeated access from unusual IPs
- System logs indicating file access outside normal patterns
Detection Engineering
YARA Rule
rule CVE_2024_21877_Path_Traversal {
meta:
description = "Detects path traversal attempts targeting Enphase IQ Gateway"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-21877"
strings:
$path_traversal1 = "../"
$path_traversal2 = "..\\"
$path_traversal3 = "%2e%2e%2f"
$path_traversal4 = "%2e%2e%5c"
$sensitive_file1 = "/etc/passwd"
$sensitive_file2 = "/etc/shadow"
$sensitive_file3 = "/var/log"
condition:
any of ($path_traversal*) and any of ($sensitive_file*)
}
Sigma Rule
title: CVE-2024-21877 Path Traversal on Enphase IQ Gateway
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects path traversal attempts targeting Enphase IQ Gateway
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-21877
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains:
- '../'
- '..\\'
- '%2e%2e%2f'
- '%2e%2e%5c'
cs-uri-query|contains:
- '/etc/passwd'
- '/etc/shadow'
- '/var/log'
condition: selection
falsepositives:
- Legitimate file access with similar patterns (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-21877 Path Traversal Attempt on Enphase IQ Gateway";
flow:to_server,established;
content:"../"; http_uri;
content:"/etc/passwd"; http_uri;
sid:1000001;
rev:1;
reference:cve,2024-21877;
classtype:attempted-admin;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade all Enphase IQ Gateway devices to version 8.2.4225 or later.
- If upgrade is not possible, restrict network access to the gateway (e.g., place behind a firewall, disable remote access).
- Change all default credentials and enforce strong passwords.
Long-term Measures:
- Implement network segmentation for IoT devices.
- Monitor for path traversal attempts using the provided detection rules.
- Regularly audit device logs for suspicious activity.
- Apply vendor patches as soon as they are released.
Workarounds:
- Use a web application firewall (WAF) to block path traversal patterns.
- Disable unnecessary web services on the gateway.
- Implement IP whitelisting for administrative access.
Valters IT