Giter Club home page Giter Club logo

cms's People

Contributors

fuge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cms's Issues

runtime exception

java.lang.RuntimeException: no site record in database!
foo.cms.web.FrontContextInterceptor.preHandle(FrontContextInterceptor.java:38)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:914)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
foo.common.web.ProcessTimeFilter.doFilter(ProcessTimeFilter.java:38)

Vulnerability Report - Unvalidated open redirection

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

Vulnerability Report - Unvalidated open redirection in ProcessAct.java

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/core/action/front/ProcessAct.java where application is taking RETURN_URL parameter as a user input and passing it without any validation. in next lines this returnUrl paramter is being used for redirection.

Root Cause

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

@RequestMapping(value = "/process.jspx", method = RequestMethod.GET)
public String process(HttpServletRequest request,
		HttpServletResponse response) {
	String returnUrl = RequestUtils.getQueryParam(request,
			LoginAct.RETURN_URL);
	String authId = RequestUtils.getQueryParam(request, AUTH_KEY);
	Authentication auth = authMng.retrieve(authId);
	if (auth != null) {
		authMng.storeAuthIdToSession(session, request, response, auth
				.getId());
	} else {
		log.warn("Authentication id not found: {}", authId);
	}
	return "redirect:" + returnUrl;
}

Steps to reproduce

  • Compile and run the following application using java.
  • navigate to /process.jspx endpoint.
  • modify the RETURN_URL parameter and enter the user controlled url. submit it.
  • analyze the response.

Proof of Concept

redirect vulnerability -3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.