Skip to content

Commit 1c4488e

Browse files
authored
Updated vulnerable XSS.java version
1 parent 46751e5 commit 1c4488e

File tree

1 file changed

+4
-3
lines changed
  • java/ql/src/Security/CWE/CWE-079

1 file changed

+4
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
public class XSS extends HttpServlet {
22
protected void doGet(HttpServletRequest request, HttpServletResponse response)
33
throws ServletException, IOException {
4-
// BAD: a request parameter is written directly to an error response page
5-
response.sendError(HttpServletResponse.SC_NOT_FOUND,
6-
"The page \"" + request.getParameter("page") + "\" was not found.");
4+
// BAD: a request parameter is written directly to the Servlet response stream
5+
response.getWriter().print(
6+
"The page \"" + request.getParameter("page") + "\" was not found."); // $xss
7+
78
}
89
}

0 commit comments

Comments
 (0)