Skip to content

Commit a8a7df4

Browse files
committed
C++: QLDoc SensitiveExprs.qll.
1 parent e2e5e9b commit a8a7df4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cpp/ql/src/semmle/code/cpp/security/SensitiveExprs.qll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
/**
2+
* Provides classes for heuristically identifying variables and functions that
3+
* might contain or return a password or other sensitive information.
4+
*/
5+
16
import cpp
27

8+
/**
9+
* Holds if the name `s` suggests something might contain or return a password
10+
* or other sensitive information.
11+
*/
312
bindingset[s]
413
private 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+
*/
1931
class SensitiveVariable extends Variable {
2032
SensitiveVariable() { suspicious(getName().toLowerCase()) }
2133
}
2234

35+
/**
36+
* A function that might return a password or other sensitive information.
37+
*/
2338
class 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+
*/
2745
class SensitiveExpr extends Expr {
2846
SensitiveExpr() {
2947
this.(VariableAccess).getTarget() instanceof SensitiveVariable or

0 commit comments

Comments
 (0)