deepsourcestatus / test-repository

Audit: Including request data within HTML response strings may lead to XSS attacks JAVA-A1035
Security
Critical
8 months ago8 months old
This code appears to return tainted input as a response
 59                    resp.getWriter().print("An additional offer is available only for you!" + req.getParameter("offerId"));
 60                }
 61
 62                resp.getWriter().write("You win, " + r.getString("userName") + "!<br>You can fill your details in with this link: " + req.getParameter(id)); 63            } else {
 64                resp.getWriter().print("You lose, " + r.getString("userName"));
 65            }
This code appears to return tainted input as a response
 56                HttpResponse<String> offerResp = hc.send(offerReq, HttpResponse.BodyHandlers.ofString());
 57
 58                if (offerResp.body() != null) {
 59                    resp.getWriter().print("An additional offer is available only for you!" + req.getParameter("offerId")); 60                }
 61
 62                resp.getWriter().write("You win, " + r.getString("userName") + "!<br>You can fill your details in with this link: " + req.getParameter(id));
This code appears to return tainted input as a response
 47            String id = r.getString(0);
 48
 49            if (r.getBoolean("isWin") && b) {
 50                resp.getWriter().print("You win, " + r.getString("userName") + "!<br>You can fill your details in with this link: " + req.getParameter(id)); 51                StringBuffer sb = new StringBuffer();
 52                HttpClient hc = HttpClient.newBuilder().build();
 53                HttpRequest offerReq = HttpRequest.newBuilder(offerAPI).GET().build();