mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Updated vulnerable XSS.java version
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
public class XSS extends HttpServlet {
|
public class XSS extends HttpServlet {
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
// BAD: a request parameter is written directly to an error response page
|
// BAD: a request parameter is written directly to the Servlet response stream
|
||||||
response.sendError(HttpServletResponse.SC_NOT_FOUND,
|
response.getWriter().print(
|
||||||
"The page \"" + request.getParameter("page") + "\" was not found.");
|
"The page \"" + request.getParameter("page") + "\" was not found."); // $xss
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user