File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
java/ql/test/query-tests/security/CWE-330 Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 10
10
import org .apache .commons .lang3 .RandomStringUtils ;
11
11
import org .owasp .esapi .Encoder ;
12
12
13
- public class WeakRandomCookies extends HttpServlet {
13
+ public class InsecureRandomCookies extends HttpServlet {
14
14
HttpServletResponse response ;
15
15
16
16
public void doGet () {
@@ -44,8 +44,8 @@ public void doGet() {
44
44
byte [] bytes2 = new byte [16 ];
45
45
sr .nextBytes (bytes2 );
46
46
// GOOD: The cookie value is unpredictable.
47
- Cookie cookie4 = new Cookie ("name" , new String (bytes2 ));
48
-
47
+ Cookie cookie4 = new Cookie ("name" , new String (bytes2 ));
48
+
49
49
ThreadLocalRandom tlr = ThreadLocalRandom .current ();
50
50
51
51
Cookie cookie5 = new Cookie ("name" , Integer .toString (tlr .nextInt ())); // $hasWeakRandomFlow
You can’t perform that action at this time.
0 commit comments