Skip to content

Commit 8327325

Browse files
Typos and style fixes
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
1 parent 3297073 commit 8327325

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

java/ql/src/Security/CWE/CWE-501/TrustBoundaryFixed.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
22
String username = request.getParameter("username");
33

44
if (validator.isValidInput("HTTP parameter", username, "username", 20, false)) {
5-
// GOOD: The input is sanitized before being written to the response.
5+
// GOOD: The input is sanitized before being written to the session.
66
request.getSession().setAttribute("username", username);
77
}
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
public void doGet(HttpServletRequest request, HttpServletResponse response) {
22
String username = request.getParameter("username");
33

4-
// BAD: The input is written to the response without being sanitized.
4+
// BAD: The input is written to the session without being sanitized.
55
request.getSession().setAttribute("username", username);
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
category: newQuery
33
---
4-
* Added the `java/trust-boundary-violation` query to detect trust boundary violations between http requests and the http session.
4+
* Added the `java/trust-boundary-violation` query to detect trust boundary violations between HTTP requests and the HTTP session.
55

java/ql/test/query-tests/security/CWE-501/TrustBoundaryViolations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ public class TrustBoundaryViolations extends HttpServlet {
1010
public void doGet(HttpServletRequest request, HttpServletResponse response) {
1111
String input = request.getParameter("input");
1212

13-
// BAD: The input is written to the response without being sanitized.
13+
// BAD: The input is written to the session without being sanitized.
1414
request.getSession().setAttribute("input", input); // $ hasTaintFlow
1515

1616
String input2 = request.getParameter("input2");
1717

1818
try {
1919
String sanitized = validator.getValidInput("HTTP parameter", input2, "HTTPParameterValue", 100, false);
20-
// GOOD: The input is sanitized before being written to the response.
20+
// GOOD: The input is sanitized before being written to the session.
2121
request.getSession().setAttribute("input2", sanitized);
2222

2323
} catch (Exception e) {
@@ -26,7 +26,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
2626
try {
2727
String input3 = request.getParameter("input3");
2828
if (validator.isValidInput("HTTP parameter", input3, "HTTPParameterValue", 100, false)) {
29-
// GOOD: The input is sanitized before being written to the response.
29+
// GOOD: The input is sanitized before being written to the session.
3030
request.getSession().setAttribute("input3", input3);
3131
}
3232
} catch (Exception e) {

0 commit comments

Comments
 (0)