Skip to content
Info disclosure Disclosed report Beginner

Source Code Disclosure

A publicly accessible PHP file on the server exposed its own source code, revealing a call to the phpinfo function. An attacker could use the disclosed information to learn about the server configuration and potentially find further weaknesses.

linkks Follow

Originally disclosed on HackerOne

  • Disclosed after 21 months

URL http://www.urbandictionary.com/phpinfo.php

Identified Source Code

<?php echo phpinfo(); ?>

An attacker can obtain server-side source code of the web application, which can contain sensitive data - such as database connection strings, usernames and passwords - along with the technical and business logic of the application.

Impact Depending on the source code, database connection strings, username, and passwords, the internal workings and business logic of application might be revealed. With such information, an attacker can mount the following types of attacks: Access the database or other data resources. Depending on the privileges of the account obtained from the source code, it may be possible to read, update or delete arbitrary data from the database. Gain access to password protected administrative mechanisms such as dashboards, management consoles and admin panels, hence gaining full control of the application. Develop further attacks by investigating the source code for input validation errors and logic vulnerabilities. Actions to Take Confirm exactly what aspects of the source code are actually disclosed; due to the limitations of this type of vulnerability, it might not be possible to confirm this in all instances. Confirm this is not an intended functionality. If it is a file required by the application, change its permissions to prevent public users from accessing it. If it is not, then remove it from the web server. Ensure that the server has all the current security patches applied. Remove all temporary and backup files from the web server. Required Skills for Successful Exploitation This is dependent on the information obtained from the source code. Uncovering these forms of vulnerabilities does not require high levels of skills. However, a highly skilled attacker could leverage this form of vulnerability to obtain account information from databases or administrative panels, ultimately leading to the control of the application or even the host the application resides on.

The original report as published on HackerOne, by linkks. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a diagnostic PHP file was left on the production web server and was publicly accessible, causing its source code to be disclosed.

Impact

The disclosed source code could reveal sensitive configuration details, and an attacker could use that information to attempt further attacks such as accessing the database or administrative panels.

What the attacker needed

None

The fix

The file should be removed from the web server, or if it is required, its permissions should be changed so that public users cannot access it.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Some web servers can be tricked into showing the code that runs a page instead of just the page's output. Here, a file that was meant to display server information was left publicly reachable, so anyone could see its code. That code can reveal details about how the server is set up, which helps an attacker plan further attacks.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by linkks

View all

20 more disclosed reports, best first.

More from Urban Dictionary

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.