Source code disclosure
High Web Application Scanning Plugin ID 98098
SynopsisSource code disclosure
DescriptionA modern web application will be reliant on several different programming languages.
Because all server side code should be executed by the server, it should never be seen by the client. However in some scenarios, it is possible that:
1. The server side code has syntax errors and therefore is not executed by the server but is instead sent to the client. 2. Using crafted requests it is possible to force the server into displaying the source code of the application without executing it.
As the server-side source code often contains sensitive information, such as database connection strings or details into the application workflow, this can be extremely risky.
Cyber-criminals will attempt to discover pages that either accidentally or forcefully allow the server-side source code to be disclosed, to assist in discovering further vulnerabilities or sensitive information.
Scanner has detected server-side source code within the server's response.
_(False positives may occur when requesting binary files such as images (.JPG or .PNG) and may require manual verification.)_
SolutionIt is important that input sanitisation be conducted to prevent application files (ASP, JSP, PHP or config files) from being called. It is also important that the file system permissions are correctly configured and that all unused files are removed from the web root.
If these are not an option, then the vulnerable file should be removed from the server.