CVE-2025-15154
Executive Summary
CVE-2025-15154 is a security vulnerability in PbootCMS, a popular content management system, affecting versions up to and including 3.2.12. The vulnerability resides in the get_user_ip function within the core/function/handle.php file. The core issue is that the application trusts the X-Forwarded-For HTTP header to determine the client's IP address without proper validation. This allows an attacker to spoof their IP address by manipulating this header, leading to the use of a less trusted source for IP-based decisions. This can be exploited remotely and has a public proof-of-concept (PoC) available. The vulnerability is classified under CWE-348 (Use of Less Trusted Source).
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 is a direct code-level issue within the PbootCMS application itself. The risk is primarily for organizations that self-host PbootCMS and rely on IP-based access controls, logging, or rate limiting.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder or uncalculated value. Based on the nature of the vulnerability (remote, low complexity, no privileges required, user interaction not required), a reasonable CVSS v3.1 vector would be:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- Attack Vector (AV): Network (N) - The attack can be launched remotely.
- Attack Complexity (AC): Low (L) - No special conditions are required.
- Privileges Required (PR): None (N) - No authentication is needed.
- User Interaction (UI): None (N) - The victim does not need to perform any action.
- Scope (S): Unchanged (U) - The vulnerability does not affect other components.
- Confidentiality (C): None (N) - No direct data exposure.
- Integrity (I): Low (L) - The attacker can spoof their IP, potentially bypassing IP-based restrictions or injecting false data into logs.
- Availability (A): None (N) - No direct impact on availability.
Threat Level: Medium. While the direct impact is limited to IP spoofing, this can be a stepping stone for more severe attacks, such as bypassing IP-based access controls or injecting false audit trails.
Deep Dive & Mechanics
The vulnerability is located in the get_user_ip function in core/function/handle.php. This function is responsible for retrieving the client's IP address. The flawed implementation likely checks the X-Forwarded-For header first and uses its value without verifying if it came from a trusted proxy. In a typical deployment, the X-Forwarded-For header is added by reverse proxies (like Nginx or Apache) to indicate the original client IP. However, if the application directly trusts this header from the client, an attacker can simply set it to any arbitrary IP address.
Attack Flow:
- An attacker sends an HTTP request to the PbootCMS application.
- The attacker includes a crafted
X-Forwarded-Forheader, e.g.,X-Forwarded-For: 127.0.0.1. - The
get_user_ipfunction reads this header and returns127.0.0.1as the client IP. - The application then uses this spoofed IP for logging, access control, or other IP-dependent features.
Impact:
- Bypass IP-based restrictions: If the application restricts access based on IP (e.g., admin panel only from internal IPs), an attacker can spoof a trusted IP.
- Log poisoning: Attackers can inject false IP addresses into logs, complicating forensic analysis.
- Rate limiting bypass: If rate limiting is based on IP, an attacker can change the header for each request to avoid being blocked.
Vulnerable vs. Patched Code
Vulnerable Code (PbootCMS <= 3.2.12): The vulnerable function likely looks like this:
function get_user_ip() {
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (!empty($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
} else {
$ip = '0.0.0.0';
}
return $ip;
}
This code directly trusts the X-Forwarded-For header without validation.
Patched Code (Hypothetical): A patched version should validate the IP address and optionally check against a list of trusted proxies:
function get_user_ip() {
$trusted_proxies = ['127.0.0.1', '::1', '10.0.0.0/8']; // Example trusted proxies
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$ip = trim(end($ips)); // Take the last IP in the chain
if (filter_var($ip, FILTER_VALIDATE_IP) === false) {
$ip = $_SERVER['REMOTE_ADDR'];
}
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
This patched version takes the last IP in the X-Forwarded-For chain (which is typically the one added by the first trusted proxy) and validates it.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A target running PbootCMS <= 3.2.12.
- Ability to send HTTP requests to the target.
Exploit Steps:
- Identify a PbootCMS instance (e.g., via Shodan dork:
http.title:"PbootCMS"). - Send a request with a spoofed
X-Forwarded-Forheader:curl -H "X-Forwarded-For: 192.168.1.100" http://target.com/ - Verify the spoofed IP is logged or used for access control.
Proof-of-Concept (PoC) Script:
import requests
target = "http://target.com/"
headers = {"X-Forwarded-For": "10.0.0.1"}
response = requests.get(target, headers=headers)
print(f"Sent request with spoofed IP. Status: {response.status_code}")
Blue Team (Detection & Hardening)
Detection:
- Monitor for multiple requests from the same client with different
X-Forwarded-Forvalues. - Alert on
X-Forwarded-Forheaders containing private IP ranges (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) if the application is not behind a proxy.
Hardening:
- Immediate: Configure the web server (Nginx/Apache) to strip or overwrite the
X-Forwarded-Forheader from client requests. For example, in Nginx:proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - Long-term: Apply the patched code as described in the "Vulnerable vs. Patched Code" section.
Indicators of Compromise (IOCs)
- Network:
- HTTP requests with multiple or unusual
X-Forwarded-Forheaders. - Requests where the
X-Forwarded-Forheader contains private IP addresses (e.g., 10.x.x.x, 192.168.x.x) when the application is directly exposed to the internet.
- HTTP requests with multiple or unusual
- Logs:
- Application logs showing IP addresses that do not match the actual source IP from the TCP connection.
- Repeated login attempts from different spoofed IPs in a short time frame.
Detection Engineering
YARA Rule
rule Detect_PbootCMS_IP_Spoofing_Exploit {
meta:
description = "Detects attempts to exploit CVE-2025-15154 by looking for suspicious X-Forwarded-For headers"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-15154"
strings:
$header = "X-Forwarded-For:" nocase
$private_ip = /(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2[0-9]|3[0-1])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})/
condition:
$header and $private_ip
}
Sigma Rule
title: PbootCMS IP Spoofing via X-Forwarded-For Header
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests with spoofed X-Forwarded-For headers targeting PbootCMS
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-15154
logsource:
category: webserver
product: apache
product: nginx
detection:
selection:
http.header|contains: 'X-Forwarded-For'
http.header|re: '(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2[0-9]|3[0-1])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})'
condition: selection
falsepositives:
- Legitimate proxy servers
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-15154 - PbootCMS IP Spoofing via X-Forwarded-For"; flow:to_server; content:"X-Forwarded-For"; http_header; pcre:"/(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2[0-9]|3[0-1])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update PbootCMS: Check for an official patch or update from the vendor. If unavailable, apply the code fix described in the "Vulnerable vs. Patched Code" section.
- Web Server Configuration: Configure your reverse proxy (Nginx/Apache) to overwrite the
X-Forwarded-Forheader from client requests. For example, in Nginx:location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://backend; } - Firewall Rules: Implement rate limiting and block requests with suspicious
X-Forwarded-Forheaders.
Long-term Actions:
- Code Review: Review all IP-dependent functions in the application to ensure they use a trusted source (e.g.,
REMOTE_ADDRfrom the web server). - Security Hardening: Implement a Web Application Firewall (WAF) to detect and block IP spoofing attempts.
- Monitoring: Enable logging of
X-Forwarded-Forheaders and set up alerts for anomalies.
Valters IT
Securing Digital Frontiers