Skip to content

Commit 850646b

Browse files
committed
C++: Deprecate the experimental version, forward to the new one.
1 parent 3fed7bf commit 850646b

File tree

2 files changed

+3
-50
lines changed

2 files changed

+3
-50
lines changed

cpp/ql/lib/experimental/semmle/code/cpp/security/PrivateCleartextWrite.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import cpp
66
import semmle.code.cpp.dataflow.TaintTracking
7-
import experimental.semmle.code.cpp.security.PrivateData
7+
import semmle.code.cpp.security.PrivateData
88
import semmle.code.cpp.security.FileWrite
99
import semmle.code.cpp.security.BufferWrite
1010

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,5 @@
11
/**
2-
* Provides classes and predicates for identifying private data and functions for security.
3-
*
4-
* 'Private' data in general is anything that would compromise user privacy if exposed. This
5-
* library tries to guess where private data may either be stored in a variable or produced by a
6-
* function.
7-
*
8-
* This library is not concerned with credentials. See `SensitiveActions` for expressions related
9-
* to credentials.
2+
* DEPRECATED: use semmle.code.cpp.security.PrivateData instead.
103
*/
114

12-
import cpp
13-
14-
/** A string for `match` that identifies strings that look like they represent private data. */
15-
private string privateNames() {
16-
result =
17-
[
18-
// Inspired by the list on https://cwe.mitre.org/data/definitions/359.html
19-
// Government identifiers, such as Social Security Numbers
20-
"%social%security%number%",
21-
// Contact information, such as home addresses and telephone numbers
22-
"%postcode%", "%zipcode%",
23-
// result = "%telephone%" or
24-
// Geographic location - where the user is (or was)
25-
"%latitude%", "%longitude%",
26-
// Financial data - such as credit card numbers, salary, bank accounts, and debts
27-
"%creditcard%", "%salary%", "%bankaccount%",
28-
// Communications - e-mail addresses, private e-mail messages, SMS text messages, chat logs, etc.
29-
// result = "%email%" or
30-
// result = "%mobile%" or
31-
"%employer%",
32-
// Health - medical conditions, insurance status, prescription records
33-
"%medical%"
34-
]
35-
}
36-
37-
/** An expression that might contain private data. */
38-
abstract class PrivateDataExpr extends Expr { }
39-
40-
/** A functiond call that might produce private data. */
41-
class PrivateFunctionCall extends PrivateDataExpr, FunctionCall {
42-
PrivateFunctionCall() {
43-
exists(string s | this.getTarget().getName().toLowerCase() = s | s.matches(privateNames()))
44-
}
45-
}
46-
47-
/** An access to a variable that might contain private data. */
48-
class PrivateVariableAccess extends PrivateDataExpr, VariableAccess {
49-
PrivateVariableAccess() {
50-
exists(string s | this.getTarget().getName().toLowerCase() = s | s.matches(privateNames()))
51-
}
52-
}
5+
import semmle.code.cpp.security.PrivateData

0 commit comments

Comments
 (0)