Skip to content
Path traversal Disclosed report Beginner

Local File Inclusion In Registration Page

The registration form's nextPageName parameter allowed path traversal, letting an attacker read local files such as web.xml and app-config.xml. This exposed sensitive configuration and source code.

moloshy Follow

Originally disclosed on HackerOne

  • Triaged in 19 hours
  • Fixed in 28 days
  • Disclosed after 41 days

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

  1. Browse to https://██████/████████/register/RegisterUserInfo.htm
  2. Setup an intercepting proxy (e.g. BurpSuite) and click Next, catching the request in Burp (don't worry about filling out the form fields)
  3. 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&registerUserInfoCommand.organizationId=49800&registerUserInfoCommand.currPageName=SearchUserOrgInfo.jsp&registerUserInfoCommand.nextPageName=..%2f..%2f..%2fWEB-INF%2fweb.xml&registerUserInfoCommand.prevPageName=jsp%2FRegistration%2FRegisterAccountInfo.jsp&registerUserInfoCommand.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.

The original report as published on HackerOne, by moloshy. 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

The application used user input directly as a file path without validating or restricting it to a list of allowed pages.

Impact

An attacker could read local files on the web server that they would normally not have access to, such as application source code or configuration files.

What the attacker needed

Access to the registration page; ability to intercept and modify requests

The fix

The application should use a whitelist of acceptable filenames with unique identifiers and reject invalid ones, and also sanitise path traversal characters.

How it was found

  1. Browse to the registration page.
  2. Set up an intercepting proxy and click Next to catch the request.
  3. Replace the request parameters with ones containing path traversal to target a local file.
  4. Forward the request and observe the file contents in the response.

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.

A web page used a user-supplied value to decide which file to show next. By putting special characters like '../' in that value, an attacker could make the server show files it normally keeps private, such as configuration files.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.