GHSA-786w-p5pm-cvgh: High severity composer/phpsysinfo/phpsysinfo vulnerability

Published Aug 28, 2026
·
Updated

Summary phpSysInfo's PSIALLOWED IP allowlist can be trivially bypassed by any unauthenticated remote attacker. The access-control check in readconfig.php derives the client IP from the attacker-controlled X-Forwarded-For and Client-IP HTTP headers before falling back to REMOTEADDR. An attacker can send X-Forwarded-For: <an allowed IP> to impersonate a trusted address and gain full access to all exposed system information, defeating the only IP-based access restriction the application provides.

Affected component - File: readconfig.php - Versions: all versions up to and including 3.4.x (current main)

Description When PSIALLOWED is configured, readconfig.php enforces an IP allowlist. The client IP is resolved as follows:

php if (isset($SERVER["HTTPXFORWARDEDFOR"])) { $ip = $SERVER["HTTPXFORWARDEDFOR"]; } else { if (isset($SERVER["HTTPCLIENTIP"])) { $ip = $SERVER["HTTPCLIENTIP"]; } else { $ip = $SERVER["REMOTEADDR"]; } }

Both HTTPXFORWARDEDFOR and HTTPCLIENTIP are fully attacker-controlled request headers. They are trusted unconditionally and take priority over REMOTEADDR. There is no concept of a configured/trusted reverse proxy, so even when phpSysInfo is exposed directly (no proxy in front), the spoofed header wins. As a result the allowlist provides no real protection.

Proof of Concept Verified against phpSysInfo 3.4.x-main-d786ab2 running in a local Docker container (php:8.2-apache).

Deployment with the allowlist (under [main]) restricted to an address the attacker does not own:

ini ; phpsysinfo.ini ([main] section) ALLOWED=8.8.8.8

Request without the spoofed header — correctly denied (attacker's real IP is the container gateway 172.17.0.1):

bash $ curl -s http://localhost:8080/xml.php | head -c 200 Client IP address (172.17.0.1) not allowed.

Request with a spoofed X-Forwarded-For matching the allowlist — bypass, full system information returned:

bash $ curl -s -H "X-Forwarded-For: 8.8.8.8" http://localhost:8080/xml.php | head -c 200 <?xml version="1.0" encoding="UTF-8"?> <tns:phpsysinfo xmlns:tns="http://phpsysinfo.sourceforge.net/" ...>

The same bypass works with the Client-IP header (HTTPCLIENTIP), which is also trusted before REMOTEADDR.

Impact Any remote, unauthenticated attacker can defeat the PSIALLOWED access restriction and read the complete system information exposed by phpSysInfo, including hostname, kernel version, CPU model, memory layout, mounted filesystems, and all network interface addresses. This information is valuable for reconnaissance and targeting of further attacks.

Remediation Use REMOTEADDR as the authoritative client IP by default. Only honor X-Forwarded-For / Client-IP when the request originates from an explicitly configured list of trusted proxies, and when honoring it, parse the correct entry from the chain rather than trusting the whole header. Example direction:

php $ip = $SERVER["REMOTEADDR"]; if (defined('PSITRUSTEDPROXIES') && inarray($ip, $trustedproxies, true) && isset($SERVER["HTTPXFORWARDEDFOR"])) { // take the right-most untrusted hop from the XFF chain $parts = arraymap('trim', explode(',', $SERVER["HTTPXFORWARDEDFOR"])); $ip = end($parts); }

Discovery / Credit - Reported by: Muhammed Mirac Kayıkci - Coordinated disclosure; no third-party systems were tested. Verification performed against a local Docker deployment only.

Affected Software

1 affected componentFixes available
composer/phpsysinfo/phpsysinfo<=3.4.5
3.4.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/phpsysinfo/phpsysinfo to a version that resolves this vulnerability.

    Fixed in 3.4.6
  2. Upgrade

    Upgrade phpSysInfo to a version that resolves this vulnerability.

    Fixed in 3.4.x
  3. Configuration

    Modify read_config.php access-control logic so the client IP used for PSI_ALLOWED allowlisting is not taken unconditionally from HTTP_X_FORWARDED_FOR or HTTP_CLIENT_IP. Per provided remediation guidance, only honor X-Forwarded-For/Client-IP when behind explicitly configured trusted proxies, and when honoring X-Forwarded-For, parse the correct hop from the chain. Otherwise fall back to $_SERVER['REMOTE_ADDR'].'

    phpSysInfo (read_config.php) Client IP derivation (HTTP_X_FORWARDED_FOR / HTTP_CLIENT_IP vs REMOTE_ADDR) = Use REMOTE_ADDR as authoritative by default; only honor X-Forwarded-For/Client-IP when request originates from explicitly configured trusted proxies; when honoring XFF, parse the correct entry from the chain rather than trusting the whole header.

Event History

Aug 28, 2026
Advisory Published
via GitHub·06:30 PM
Data Sourced
via GitHub·06:30 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed?

Deployments that configure PSI_ALLOWED and permit remote requests are exposed, because the application’s IP allowlist is the affected access control. The issue affects phpSysInfo versions through 3.4.x, including current main.

2

What does an attacker need to bypass the restriction?

No authentication or prior access is required. An attacker only needs to send a request with an X-Forwarded-For header containing an IP address permitted by PSI_ALLOWED; Client-IP is also trusted when X-Forwarded-For is absent.

3

How can I determine whether an instance is vulnerable?

Inspect read_config.php and check whether it takes HTTP_X_FORWARDED_FOR or HTTP_CLIENT_IP before REMOTE_ADDR when enforcing PSI_ALLOWED. If so, a requester can supply the header value used for the allowlist check.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203