File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
java/ql/src/Security/CWE/CWE-079 Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11public 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 ,
4+ // BAD: a request parameter is written directly to the Servlet response stream
5+ response .getWriter (). print (
66 "The page \" " + request .getParameter ("page" ) + "\" was not found." );
7+
78 }
89}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ reference.</p>
1818</recommendation >
1919<example >
2020
21- <p >The following example shows the page parameter being written directly to the server error page,
21+ <p >The following example shows the < code > page</ code > parameter being written directly to the page,
2222leaving the website vulnerable to cross-site scripting.</p >
2323
2424<sample src =" XSS.java" />
You can’t perform that action at this time.
0 commit comments