{"id":"CVE-2026-55584","aliases":[],"url":"https://o3.security/vulnerability/CVE-2026-55584","summary":"phpSysInfo has an IP allowlist (PSI_ALLOWED) bypass via spoofed X-Forwarded-For / Client-IP headers","details":"## Summary\nphpSysInfo's `PSI_ALLOWED` IP allowlist can be trivially bypassed by any unauthenticated remote attacker. The access-control check in `read_config.php` derives the client IP from the attacker-controlled `X-Forwarded-For` and `Client-IP` HTTP headers **before** falling back to `REMOTE_ADDR`. 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.\n\n## Affected component\n- File: `read_config.php`\n- Versions: all versions up to and including 3.4.x (current `main`)\n\n## Description\nWhen `PSI_ALLOWED` is configured, `read_config.php` enforces an IP allowlist. The client IP is resolved as follows:\n\n```php\nif (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n    $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n} else {\n    if (isset($_SERVER[\"HTTP_CLIENT_IP\"])) {\n        $ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n    } else {\n        $ip = $_SERVER[\"REMOTE_ADDR\"];\n    }\n}\n```\n\nBoth `HTTP_X_FORWARDED_FOR` and `HTTP_CLIENT_IP` are fully attacker-controlled request headers. They are trusted unconditionally and take priority over `REMOTE_ADDR`. 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.\n\n## Proof of Concept\nVerified against phpSysInfo `3.4.x-main-d786ab2` running in a local Docker container (`php:8.2-apache`).\n\nDeployment with the allowlist (under `[main]`) restricted to an address the attacker does not own:\n\n```ini\n; phpsysinfo.ini  ([main] section)\nALLOWED=8.8.8.8\n```\n\nRequest without the spoofed header — correctly denied (attacker's real IP is the container gateway `172.17.0.1`):\n\n```bash\n$ curl -s http://localhost:8080/xml.php | head -c 200\nClient IP address (172.17.0.1) not allowed.\n```\n\nRequest with a spoofed `X-Forwarded-For` matching the allowlist — bypass, full system information returned:\n\n```bash\n$ curl -s -H \"X-Forwarded-For: 8.8.8.8\" http://localhost:8080/xml.php | head -c 200\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tns:phpsysinfo xmlns:tns=\"http://phpsysinfo.sourceforge.net/\" ...>\n```\n\nThe same bypass works with the `Client-IP` header (`HTTP_CLIENT_IP`), which is also trusted before `REMOTE_ADDR`.\n\n## Impact\nAny remote, unauthenticated attacker can defeat the `PSI_ALLOWED` 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.\n\n## Remediation\nUse `REMOTE_ADDR` 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:\n\n```php\n$ip = $_SERVER[\"REMOTE_ADDR\"];\nif (defined('PSI_TRUSTED_PROXIES') && in_array($ip, $trusted_proxies, true)\n    && isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n    // take the right-most untrusted hop from the XFF chain\n    $parts = array_map('trim', explode(',', $_SERVER[\"HTTP_X_FORWARDED_FOR\"]));\n    $ip = end($parts);\n}\n```\n\n## Discovery / Credit\n- Reported by: Muhammed Mirac Kayıkci\n- Coordinated disclosure; no third-party systems were tested. Verification performed against a local Docker deployment only.","published":"2026-08-28T18:30:55Z","modified":"2026-08-28T18:45:07.873962898Z","cvss":{"score":7.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"Packagist","name":"phpsysinfo/phpsysinfo","fixedVersion":"3.4.6"}],"fix":{"url":"https://github.com/phpsysinfo/phpsysinfo/commit/019fa2d7e568ea11461adb4bd33da5dc87c4b9ab","label":"phpsysinfo/phpsysinfo@019fa2d"},"references":[{"type":"WEB","url":"https://github.com/phpsysinfo/phpsysinfo/security/advisories/GHSA-786w-p5pm-cvgh"},{"type":"WEB","url":"https://github.com/phpsysinfo/phpsysinfo/commit/019fa2d7e568ea11461adb4bd33da5dc87c4b9ab"},{"type":"PACKAGE","url":"https://github.com/phpsysinfo/phpsysinfo"},{"type":"WEB","url":"https://github.com/phpsysinfo/phpsysinfo/releases/tag/v3.4.6"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-28T18:45:07.873962898Z"}}