Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulnerability Report - Unvalidated open redirection #3

Open
honeyakshat999 opened this issue May 26, 2023 · 0 comments
Open

Vulnerability Report - Unvalidated open redirection #3

honeyakshat999 opened this issue May 26, 2023 · 0 comments

Comments

@honeyakshat999
Copy link

Description

Open redirection vulnerabilities arise when an application incorporates user-controllable data into the target of a redirection in an unsafe way. An attacker can construct a URL within the application that causes a redirection to an arbitrary external domain. This behavior can be leveraged to facilitate phishing attacks against users of the application. The ability to use an authentic application URL, targeting the correct domain and with a valid SSL certificate (if SSL is used), lends credibility to the phishing attack because many users, even if they verify these features, will not notice the subsequent redirection to a different domain.

The vulnerability exists in the file https://github.com/fuge/cms/blob/master/src/foo/cms/action/member/RegisterAct.java where application is taking the nextUrl parameter as a user input and passing it without any validation. in next lines this nextUrl paramter is being used for redirection.

Root Cause

As mentioned above the file https://github.com/fuge/cms/blob/master/src/foo/cms/action/member/RegisterAct.java contains the following code:

 @RequestMapping(value = "/register.jspx", method = RequestMethod.POST)
public String submit(String username, String email, String password,
		CmsUserExt userExt, String captcha, String nextUrl,
		HttpServletRequest request, HttpServletResponse response,
		ModelMap model) throws IOException {  

This code takes in nextUrl as user input and passing it then this parameter is directly being used in line 110

response.sendRedirect(nextUrl);

Steps to reproduce

  • Compile and run the following application using java.
  • Once done, navigate to the application.
  • open /register.jspx endpoint.
  • modify the nextUrl parameter and enter the user controlled url. submit it.
  • analyze the response.

Proof of concept

redirect vulnerability -2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant