PHP info page disclosure in ██████████
A phpinfo() debug page was publicly accessible, exposing detailed PHP configuration, OS version, internal IP addresses and environment variables. An attacker could use this information to research known vulnerabilities and assist in exploiting other issues.
Originally disclosed on HackerOne
- Triaged in 11 days
- Fixed in 12 months
- Disclosed after 19 months
Summary:
[phpinfo() is a debug functionality that prints out detailed information on both the system and the PHP configuration.]
Steps To Reproduce:
Step to reproduce:
- [Go here: ████]
An attacker can obtain information such as: Exact PHP version. Exact OS and its version. Details of the PHP configuration. Internal IP addresses. Server environment variables. Loaded PHP extensions and their configurations and etc.
Supporting Material/References:
*████ ████████
Impact
This information can help an attacker gain more information on the system. After gaining detailed information, the attacker can research known vulnerabilities for that system under review. The attacker can also use this information during the exploitation of other vulnerabilities.
What the report shows
This is a medium severity report from the MTN Group program on HackerOne, disclosed on 30 August 2024 and credited to the researcher 0xmr_b4rayz. The subject is a publicly reachable phpinfo() page on a host whose name is redacted in the published text.
The researcher's summary describes phpinfo() as debug functionality that prints detailed information about both the system and the PHP configuration. The reproduction step is a single instruction to visit a URL, which is redacted:
Go here: ████
No request, response, header or parameter is reproduced in the report. The supporting material section contains only redacted references, so the evidence behind the finding is not visible in the disclosed text.
The report lists the categories of information an attacker can obtain from the page:
- the exact PHP version;
- the exact operating system and its version;
- details of the PHP configuration;
- internal IP addresses;
- server environment variables;
- loaded PHP extensions and their configurations, and similar items.
The report does not describe a fix, and the disclosed text gives no bounty figure. Severity is recorded as medium.
Root cause
The page is a standard phpinfo() output page reachable at a public URL; the report does not say how it came to be deployed. phpinfo() is intended for development and troubleshooting: it dumps the build configuration, compiled-in and loaded modules, environment and request data, and path information. The report does not discuss the root cause.
Impact
The report describes what the disclosure gives an attacker. It says the information helps an attacker learn more about the system, and that with that detail they can research known vulnerabilities affecting the software under review. It also notes the information can be used while exploiting other vulnerabilities. The report says the information can help research known vulnerabilities and be used during exploitation of other vulnerabilities. The report does not claim that any vulnerability was actually exploited as a result.
How this kind of bug works
phpinfo() is a core PHP function that emits an HTML page describing the running interpreter. Its output typically includes the PHP version and build date, the Server API, the configuration file path, the values of display_errors, allow_url_include and similar directives, the list of loaded extensions with their versions, environment variables inherited by the PHP process, and the values of $_SERVER entries such as internal addresses and hostnames. Because it is a debugging aid, it is verbose by design.
The bug class is information exposure through leftover debug or diagnostic functionality. It happens because development artefacts (probe scripts, framework debug pages, status endpoints, stack traces) are copied to production along with application code, and nothing in the deployment pipeline removes or protects them. The exposure is passive: the server simply answers a GET with the diagnostic page, so no malicious input is needed.
The defences are straightforward. Diagnostic endpoints should not exist in production builds, and where they must exist they should be bound to localhost or placed behind authentication and network restrictions. Web server configuration can deny access to known probe filenames. Returning generic error pages instead of framework debug output removes a related class of leak.
How to test for it
Testing is mostly enumeration, then confirmation.
- Look for common diagnostic filenames in every directory that serves application code:
phpinfo.php,info.php,test.php,php_info.php,i.php, and framework specific debug or status routes. Directory listings, backup files and source maps often reveal the names actually in use. - Request each candidate with a plain GET and inspect the response body and content type. A positive result is an HTML page containing the PHP logo block, a version string, and configuration tables. Confirm it is genuinely
phpinfo()output and not a static copy. - Check whether the page is reachable without authentication and from outside the expected network. A page that only answers on localhost or behind a VPN is a much weaker finding.
- Record what the page actually exposes: version strings, environment variables, internal addresses, configuration directives. That list is the evidence for impact.
Common false positives: a page that returns 403 or a login redirect (protected, so not exposed); a generic error page that merely mentions PHP; cached or archived copies served by a third party rather than the target; and staging hosts that are explicitly out of scope. Also be careful that the host you reached belongs to the program's in-scope assets.
How it is fixed
- Remove diagnostic scripts from production deployments and add them to the ignore or exclusion rules of the deployment pipeline.
- Where a diagnostic page is operationally required, restrict it by IP allowlist, HTTP authentication or a private network binding.
- Deny access to known probe filenames at the web server or reverse proxy layer as a safety net.
- Disable verbose error display in production so that stack traces and configuration details do not leak through other paths.
- Review the exposed values and rotate any secret that appeared on the page, such as credentials in environment variables.
Hunting notes
Exposed phpinfo() pages cluster where code moves between environments: shared hosting, legacy applications, CMS installations with sample files, and hosts where developers left setup or test scripts behind. Old subdomains and forgotten virtual hosts are good candidates, as are directories that return listings.
Useful recon signals include server banners naming PHP, directory listings that show .php files with diagnostic sounding names, and search engine results or archived snapshots pointing at such paths. Content discovery wordlists that include common probe filenames are effective here.
To make the report acceptable, show the page is reachable by an unauthenticated external user, quote the sensitive values it discloses (redacting secrets in the report itself), and explain the concrete follow-on risk, for example that the exact version and extension list narrow the search for known vulnerabilities. Programs often rate plain version disclosure as low; the strongest cases are those where environment variables, internal addresses or credentials are visible, or where the page sits on a host that handles sensitive data.
What happened, in plain words
This is a medium severity report from the MTN Group program on HackerOne, disclosed on 30 August 2024 and credited to the researcher 0xmr_b4rayz. It describes a publicly reachable phpinfo() page on a host whose name is redacted in the published text.
phpinfo() is a built-in PHP function used for debugging. When a web server runs it, it prints a long page describing the system and the PHP setup. The researcher's summary calls it debug functionality that prints detailed information about both the system and the PHP configuration.
The reproduction step is a single instruction to visit a URL, which is redacted:
Go here: ████
The steps to reproduce consist of a single instruction to visit a URL. No request, response, header or parameter is reproduced in the report. The supporting material section contains only redacted references, so the evidence behind the finding is not visible in the disclosed text.
The report lists the categories of information an attacker can obtain from the page:
- the exact PHP version;
- the exact operating system and its version;
- details of the PHP configuration;
- internal IP addresses;
- server environment variables;
- loaded PHP extensions and their configurations, and similar items.
The report does not describe a fix, and the disclosed text gives no bounty figure. Severity is recorded as medium.
In general, how this kind of bug works
phpinfo() is a core PHP function that emits an HTML page describing the running interpreter. Its output typically includes the PHP version and build date, the Server API, the configuration file path, the values of display_errors, allow_url_include and similar directives, the list of loaded extensions with their versions, environment variables inherited by the PHP process, and the values of $_SERVER entries such as internal addresses and hostnames. Because it is a debugging aid, it is verbose by design.
The bug class is information exposure through leftover debug or diagnostic functionality. It happens because development artefacts (probe scripts, framework debug pages, status endpoints, stack traces) are copied to production along with application code, and nothing in the deployment pipeline removes or protects them. The exposure is passive: the server simply answers a GET with the diagnostic page, so no malicious input is needed.
The defences are straightforward. Diagnostic endpoints should not exist in production builds, and where they must exist they should be bound to localhost or placed behind authentication and network restrictions. Web server configuration can deny access to known probe filenames. Returning generic error pages instead of framework debug output removes a related class of leak.
How to test for it
Testing is mostly enumeration, then confirmation.
- Look for common diagnostic filenames in every directory that serves application code:
phpinfo.php,info.php,test.php,php_info.php,i.php, and framework specific debug or status routes. Directory listings, backup files and source maps often reveal the names actually in use. - Request each candidate with a plain GET and inspect the response body and content type. A positive result is an HTML page containing the PHP logo block, a version string, and configuration tables. Confirm it is genuinely
phpinfo()output and not a static copy. - Check whether the page is reachable without authentication and from outside the expected network. A page that only answers on localhost or behind a VPN is a much weaker finding.
- Record what the page actually exposes: version strings, environment variables, internal addresses, configuration directives. That list is the evidence for impact.
Common false positives: a page that returns 403 or a login redirect (protected, so not exposed); a generic error page that merely mentions PHP; cached or archived copies served by a third party rather than the target; and staging hosts that are explicitly out of scope. Also be careful that the host you reached belongs to the program's in-scope assets.
How it is fixed
- Remove diagnostic scripts from production deployments and add them to the ignore or exclusion rules of the deployment pipeline.
- Where a diagnostic page is operationally required, restrict it by IP allowlist, HTTP authentication or a private network binding.
- Deny access to known probe filenames at the web server or reverse proxy layer as a safety net.
- Disable verbose error display in production so that stack traces and configuration details do not leak through other paths.
- Review the exposed values and rotate any secret that appeared on the page, such as credentials in environment variables.
Hunting notes
Exposed phpinfo() pages cluster where code moves between environments: shared hosting, legacy applications, CMS installations with sample files, and hosts where developers left setup or test scripts behind. Old subdomains and forgotten virtual hosts are good candidates, as are directories that return listings.
Useful recon signals include server banners naming PHP, directory listings that show .php files with diagnostic sounding names, and search engine results or archived snapshots pointing at such paths. Content discovery wordlists that include common probe filenames are effective here.
To make the report acceptable, show the page is reachable by an unauthenticated external user, quote the sensitive values it discloses (redacting secrets in the report itself), and explain the concrete follow-on risk, for example that the exact version and extension list narrow the search for known vulnerabilities. Programs often rate plain version disclosure as low; the strongest cases are those where environment variables, internal addresses or credentials are visible, or where the page sits on a host that handles sensitive data.
Glossary
- phpinfo(): a PHP function that prints a detailed page about the PHP installation and the system it runs on, used for debugging.
- PHP: a programming language commonly used to build websites.
- Debug functionality: features meant to help developers find problems, which should not be left on in a live system.
- GET: the basic HTTP method a browser uses to ask a server for a page.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- Request: a message a browser sends to a server asking for something.
- Response: the message a server sends back.
- Header: extra information sent alongside a request or response.
- Parameter: a value passed in a request, often in the URL or body.
- URL: the address of a resource on the web.
- Host: a computer or server that serves a website.
- Server: a computer that provides services to other computers over a network.
- Environment variables: named values a server passes to programs it runs, which can include configuration and secrets.
- Internal IP addresses: network addresses used inside an organisation, not meant to be public.
- IP address: a numeric label identifying a device on a network.
- Extension: an add-on module that gives PHP extra features.
- Configuration: the settings that control how software behaves.
- Vulnerability: a weakness that can be used to cause harm or gain unauthorised access.
- Exploitation: using a vulnerability to achieve an attacker's goal.
- Reconnaissance: gathering information about a target before attacking.
- Information exposure: a bug where sensitive information is revealed to someone who should not see it.
- Production: the live environment where a service is used by real users.
- Deployment pipeline: the automated process that builds and releases software.
- Localhost: the computer itself, reachable only from that machine.
- Authentication: proving who you are, for example with a username and password.
- VPN: a private network connection that restricts access to authorised users.
- 403: an HTTP status code meaning access is forbidden.
- Redirect: a response that sends the browser to a different address.
- False positive: a finding that looks like a problem but is not.
- Staging: a test environment that mimics production.
- In-scope assets: the systems a bug bounty program allows you to test.
- IP allowlist: a list of addresses permitted to access something.
- Reverse proxy: a server that sits in front of web servers and forwards requests.
- Stack trace: a list of function calls shown when an error occurs, which can reveal internal details.
- Secret: a value such as a password or key that must be kept private.
- Rotate: replace a secret with a new one.
- CMS: a content management system, software for building and managing websites.
- Subdomain: a prefix of a domain name, such as
blog.example.com. - Virtual host: a configuration that lets one server host multiple websites.
- Directory listing: a web page that shows the files in a folder.
- Content discovery: trying many possible file and folder names to find hidden ones.
- Wordlist: a list of common names used in content discovery.
- Severity: a rating of how serious a finding is.
- CVSS: a standard scoring system for vulnerability severity.
- Bounty: a reward paid for a valid report.