Skip to content

Commit 45e1a61

Browse files
committed
Mark test as bad-but-missed
This test ought ideally to be caught, but isn't by the current version of the query.
1 parent d7f26df commit 45e1a61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/ql/test/experimental/query-tests/security/CWE-1004/SensitiveCookieNotHttpOnly.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ public void addCookie14(HttpServletRequest request, HttpServletResponse response
137137
response.addCookie(createCookie("refresh_token", refreshToken, true));
138138
}
139139

140-
// GOOD - Tests set a sensitive cookie header with the `HttpOnly` flag not set through a boolean variable using a wrapper method.
140+
// BAD (but not detected) - Tests set a sensitive cookie header with the `HttpOnly` flag not set through a boolean variable using a wrapper method.
141+
// This example is missed because the `cookie.setHttpOnly` call in `createCookie` is thought to maybe set the HTTP-only flag, and the `cookie`
142+
// object flows to this `addCookie` call.
141143
public void addCookie15(HttpServletRequest request, HttpServletResponse response, String refreshToken) {
142144
response.addCookie(createCookie("refresh_token", refreshToken, false));
143145
}

0 commit comments

Comments
 (0)