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+
16import cpp
27
8+ /**
9+ * Holds if the name `s` suggests something might contain or return a password
10+ * or other sensitive information.
11+ */
312bindingset [ s]
413private predicate suspicious ( string s ) {
514 (
@@ -16,14 +25,23 @@ private predicate suspicious(string s) {
1625 )
1726}
1827
28+ /**
29+ * A variable that might contain a password or other sensitive information.
30+ */
1931class SensitiveVariable extends Variable {
2032 SensitiveVariable ( ) { suspicious ( getName ( ) .toLowerCase ( ) ) }
2133}
2234
35+ /**
36+ * A function that might return a password or other sensitive information.
37+ */
2338class SensitiveFunction extends Function {
2439 SensitiveFunction ( ) { suspicious ( getName ( ) .toLowerCase ( ) ) }
2540}
2641
42+ /**
43+ * An expression whose value might be a password or other sensitive information.
44+ */
2745class SensitiveExpr extends Expr {
2846 SensitiveExpr ( ) {
2947 this .( VariableAccess ) .getTarget ( ) instanceof SensitiveVariable or
You can’t perform that action at this time.
0 commit comments