11/**
2- * Provides a taint tracking configuration for reasoning about password hashing with insufficient computational effort.
2+ * Provides a taint tracking configuration for reasoning about
3+ * password hashing with insufficient computational effort.
4+ *
5+ * Note, for performance reasons: only import this file if
6+ * `InsufficientPasswordHash::Configuration` is needed, otherwise
7+ * `InsufficientPasswordHashCustomizations` should be imported instead.
38 */
49
510import javascript
6- private import semmle.javascript.security.SensitiveActions
7- private import semmle.javascript.frameworks.CryptoLibraries
811
912module InsufficientPasswordHash {
10- /**
11- * A data flow source for password hashing with insufficient computational effort.
12- */
13- abstract class Source extends DataFlow:: Node {
14- /** Gets a string that describes the type of this data flow source. */
15- abstract string describe ( ) ;
16- }
17-
18- /**
19- * A data flow sink for password hashing with insufficient computational effort.
20- */
21- abstract class Sink extends DataFlow:: Node { }
22-
23- /**
24- * A sanitizer for password hashing with insufficient computational effort.
25- */
26- abstract class Sanitizer extends DataFlow:: Node { }
13+ import InsufficientPasswordHashCustomizations:: InsufficientPasswordHash
2714
2815 /**
2916 * A taint tracking configuration for password hashing with insufficient computational effort.
@@ -46,30 +33,4 @@ module InsufficientPasswordHash {
4633 node instanceof Sanitizer
4734 }
4835 }
49-
50- /**
51- * A potential clear-text password, considered as a source for password hashing
52- * with insufficient computational effort.
53- */
54- class CleartextPasswordSource extends Source , DataFlow:: ValueNode {
55- override SensitiveExpr astNode ;
56-
57- CleartextPasswordSource ( ) { astNode .getClassification ( ) = SensitiveExpr:: password ( ) }
58-
59- override string describe ( ) { result = astNode .describe ( ) }
60- }
61-
62- /**
63- * An expression used by a cryptographic algorithm that is not suitable for password hashing.
64- */
65- class InsufficientPasswordHashAlgorithm extends Sink {
66- InsufficientPasswordHashAlgorithm ( ) {
67- exists ( CryptographicOperation application |
68- application .getAlgorithm ( ) .isWeak ( ) or
69- not application .getAlgorithm ( ) instanceof PasswordHashingAlgorithm
70- |
71- this .asExpr ( ) = application .getInput ( )
72- )
73- }
74- }
7536}
0 commit comments