U.S. Dept Of Defense · Report #1007799
Local File Inclusion In Registration Page
How it was found
Summary: When registering on https://████████ it is possible to use path traversal characters in a parameter allowing an attacker to read local files.
Description: The registerUserInfoCommand.nextPageName parameter within the registration form is vulnerable to file path manipulation, where it is possible to submit a request containing path traversal characters (e.g. ../../../) followed by a local file, which will return the contents of the file. This can be used to read local files including sensitive configuration files such as /WEB-INF/web.xml, /WEB-INF/app-config.xml and /WEB-INF/spring/explicit-security-config.xml.
Impact
An attacker could read local files on the web server that they would normally not have access to, such as the application source code or configuration files containing sensitive information on how the website is configured.
Step-by-step Reproduction Instructions
- Browse to https://██████/████████/register/RegisterUserInfo.htm
- Setup an intercepting proxy (e.g. BurpSuite) and click Next, catching the request in Burp (don't worry about filling out the form fields)
- For ease here I would recommend copying and pasting the below parameters into the request, replacing the parameters that were there originally. This request will fetch the /WEB-INF/web.xml configuration file, I have also attached two other requests which grab app-config.xml and explicity-security-config.xml. Once the parameters are there, forward the request to the server and you should see the web.xml file.
registerUserInfoCommand.organization=Chantest+Corporation®isterUserInfoCommand.organizationId=49800®isterUserInfoCommand.currPageName=SearchUserOrgInfo.jsp®isterUserInfoCommand.nextPageName=..%2f..%2f..%2fWEB-INF%2fweb.xml®isterUserInfoCommand.prevPageName=jsp%2FRegistration%2FRegisterAccountInfo.jsp®isterUserInfoCommand.submitButton=Choose+This+Organization+and+Continue+%3E
Product, Version, and Configuration (If applicable)
N/A
Suggested Mitigation/Remediation Actions
Rather than placing the filename of the next page directly in a parameter, it would be better to maintain a whitelist of acceptable filenames and use a unique corresponding identifier to access the file. Then any request containing an invalid identifier can just be rejected. Additionally, you could also sanitise any path traversal characters that may be present in a request.
Impact
An attacker could read local files on the web server that they would normally not have access to, such as the application source code or configuration files containing sensitive information on how the website is configured.