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 1010import org .apache .commons .lang3 .RandomStringUtils ;
1111import org .owasp .esapi .Encoder ;
1212
13- public class WeakRandomCookies extends HttpServlet {
13+ public class InsecureRandomCookies extends HttpServlet {
1414 HttpServletResponse response ;
1515
1616 public void doGet () {
@@ -44,8 +44,8 @@ public void doGet() {
4444 byte [] bytes2 = new byte [16 ];
4545 sr .nextBytes (bytes2 );
4646 // 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+
4949 ThreadLocalRandom tlr = ThreadLocalRandom .current ();
5050
5151 Cookie cookie5 = new Cookie ("name" , Integer .toString (tlr .nextInt ())); // $hasWeakRandomFlow
You can’t perform that action at this time.
0 commit comments