Skip to content

Commit e907d68

Browse files
committed
JS: Add crypto test with AES-ECB
1 parent a9e5b34 commit e907d68

File tree

1 file changed

+3
-0
lines changed
  • javascript/ql/test/query-tests/Security/CWE-327

1 file changed

+3
-0
lines changed

javascript/ql/test/query-tests/Security/CWE-327/tst.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ unknownCipher.update(secretText, 'utf8', 'hex'); // OK: unknown algorithm
1717
desCipher.write(o.trusted, 'utf8', 'hex'); // BAD
1818

1919
desCipher.write(password, 'utf8', 'hex'); // OK (flagged by js/insufficient-password-hash)
20+
21+
const aesEcbCipher = crypto.createCipher('aes-128-ecb', key);
22+
aesEcbCipher.update(secretText, 'utf8', 'hex'); // BAD

0 commit comments

Comments
 (0)