File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
cpp/ql/src/semmle/code/cpp/security Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Provides classes for heuristically identifying variables and functions that
3
+ * might contain or return a password or other sensitive information.
4
+ */
5
+
1
6
import cpp
2
7
8
+ /**
9
+ * Holds if the name `s` suggests something might contain or return a password
10
+ * or other sensitive information.
11
+ */
3
12
bindingset [ s]
4
13
private predicate suspicious ( string s ) {
5
14
(
@@ -16,14 +25,23 @@ private predicate suspicious(string s) {
16
25
)
17
26
}
18
27
28
+ /**
29
+ * A variable that might contain a password or other sensitive information.
30
+ */
19
31
class SensitiveVariable extends Variable {
20
32
SensitiveVariable ( ) { suspicious ( getName ( ) .toLowerCase ( ) ) }
21
33
}
22
34
35
+ /**
36
+ * A function that might return a password or other sensitive information.
37
+ */
23
38
class SensitiveFunction extends Function {
24
39
SensitiveFunction ( ) { suspicious ( getName ( ) .toLowerCase ( ) ) }
25
40
}
26
41
42
+ /**
43
+ * An expression whose value might be a password or other sensitive information.
44
+ */
27
45
class SensitiveExpr extends Expr {
28
46
SensitiveExpr ( ) {
29
47
this .( VariableAccess ) .getTarget ( ) instanceof SensitiveVariable or
You can’t perform that action at this time.
0 commit comments