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

XSS in Portlet #216

Closed
h3xstream opened this issue Aug 19, 2016 · 0 comments
Closed

XSS in Portlet #216

h3xstream opened this issue Aug 19, 2016 · 0 comments
Labels
enhancement New feature or improvement to existing detector.
Milestone

Comments

@h3xstream
Copy link
Member

h3xstream commented Aug 19, 2016

Similar to the XSS in servlet and JSP detector. A detector could be made to detect the following patterns:

import javax.portlet.*;
import java.io.*;

public class HelloWorld extends GenericPortlet {

   public void init (PortletConfig portletConfig) throws UnavailableException, PortletException
   {
      super.init(portletConfig);
   }

   public void doView(RenderRequest request, RenderResponse response)
                      throws PortletException, IOException
   {
      response.setContentType("text/html");
      PrintWriter writer = response.getWriter();
      String user = request.getParameter("user");
      writer.println("<h1>Hello "+user+"!</h1>");
    }

}
import org.apache.jetspeed.portlet.*;
import java.io.*;

public class HelloWorld extends PortletAdapter {

   public void init (PortletConfig portletConfig) throws UnavailableException
   {
      super.init(portletConfig);
   }

   public void doView(PortletRequest request, PortletResponse response)
                      throws PortletException, IOException
   {
      PrintWriter writer = response.getWriter();
      String user = request.getParameter("user");
      writer.println("<h1>Hello "+user+"!</h1>");
   }

}

Ref: https://www.ibm.com/support/knowledgecenter/SSHRKX_8.0.0/dev/wpsbscfg.html

@h3xstream h3xstream added the enhancement New feature or improvement to existing detector. label Aug 19, 2016
@h3xstream h3xstream added this to the version-1.6.0 milestone Aug 19, 2016
@h3xstream h3xstream modified the milestones: version-1.5.0, version-1.6.0 Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing detector.
Projects
None yet
Development

No branches or pull requests

1 participant