We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46751e5 commit 1c4488eCopy full SHA for 1c4488e
java/ql/src/Security/CWE/CWE-079/XSS.java
@@ -1,8 +1,9 @@
1
public class XSS extends HttpServlet {
2
protected void doGet(HttpServletRequest request, HttpServletResponse response)
3
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.");
+ // BAD: a request parameter is written directly to the Servlet response stream
+ response.getWriter().print(
+ "The page \"" + request.getParameter("page") + "\" was not found."); // $xss
7
+
8
}
9
0 commit comments