The PHP configuration file is used for running applications that require PHP. The major use of this file is to configure the properties of the variable. This includes upload size, file timeouts, resource limits etc. The PHP file might include Database ids and password details. An attacker with an average idea on the working of the credentials can exploit the vulnerability and he will be able to communicate directly with the database.
Example
The following is a sample code present in a PHP configuration file.
Impact
Using this vulnerability, an attacker can:-
gain full access to the server.
perform a data breach for gathering sensitive information.
Read, update and delete any data/tables from the database.
Execute commands on the underlying operating system.
Mitigation / Precaution
Beagle recommends the following impacts:-
Restrict access to this file or restrict the disclosure
This can be done by creating a new file named configuration file with unix permission set to 644.
The following will be the change in the main PHP file.
Automated human-like penetration testing for your web apps & APIs
Teams using Beagle Security are set up in minutes, embrace release-based CI/CD security testing and save up to 65% with timely remediation of vulnerabilities. Sign up for a free account to see what it can do for you.