Typos and style fixes

Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
This commit is contained in:
Edward Minnix III
2023-07-26 09:58:56 -04:00
committed by Ed Minnix
parent 52ebf9fff6
commit 929090a847
4 changed files with 6 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
String username = request.getParameter("username");
if (validator.isValidInput("HTTP parameter", username, "username", 20, false)) {
// GOOD: The input is sanitized before being written to the response.
// GOOD: The input is sanitized before being written to the session.
request.getSession().setAttribute("username", username);
}
}

View File

@@ -1,6 +1,6 @@
public void doGet(HttpServletRequest request, HttpServletResponse response) {
String username = request.getParameter("username");
// BAD: The input is written to the response without being sanitized.
// BAD: The input is written to the session without being sanitized.
request.getSession().setAttribute("username", username);
}

View File

@@ -1,5 +1,5 @@
---
category: newQuery
---
* Added the `java/trust-boundary-violation` query to detect trust boundary violations between http requests and the http session.
* Added the `java/trust-boundary-violation` query to detect trust boundary violations between HTTP requests and the HTTP session.

View File

@@ -10,14 +10,14 @@ public class TrustBoundaryViolations extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) {
String input = request.getParameter("input");
// BAD: The input is written to the response without being sanitized.
// BAD: The input is written to the session without being sanitized.
request.getSession().setAttribute("input", input); // $ hasTaintFlow
String input2 = request.getParameter("input2");
try {
String sanitized = validator.getValidInput("HTTP parameter", input2, "HTTPParameterValue", 100, false);
// GOOD: The input is sanitized before being written to the response.
// GOOD: The input is sanitized before being written to the session.
request.getSession().setAttribute("input2", sanitized);
} catch (Exception e) {
@@ -26,7 +26,7 @@ public class TrustBoundaryViolations extends HttpServlet {
try {
String input3 = request.getParameter("input3");
if (validator.isValidInput("HTTP parameter", input3, "HTTPParameterValue", 100, false)) {
// GOOD: The input is sanitized before being written to the response.
// GOOD: The input is sanitized before being written to the session.
request.getSession().setAttribute("input3", input3);
}
} catch (Exception e) {