Skip to content

Commit 09c5caa

Browse files
committed
C++: Move ExternalAPI files into query directory to prevent out-of-tree use.
1 parent f16591d commit 09c5caa

11 files changed

+12
-10
lines changed

config/identical-files.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@
359359
"python/ql/test/TestUtilities/InlineExpectationsTest.qll"
360360
],
361361
"C++ ExternalAPIs": [
362-
"cpp/ql/src/semmle/code/cpp/security/ExternalAPIs.qll",
363-
"cpp/ql/src/semmle/code/cpp/security/ir/ExternalAPIs.qll"
362+
"cpp/ql/src/Security/CWE/CWE-020/ExternalAPIs.qll",
363+
"cpp/ql/src/Security/CWE/CWE-020/ir/ExternalAPIs.qll"
364364
],
365365
"C++ SafeExternalAPIFunction": [
366-
"cpp/ql/src/semmle/code/cpp/security/implementation/SafeExternalAPIFunction.qll",
367-
"cpp/ql/src/semmle/code/cpp/security/ir/implementation/SafeExternalAPIFunction.qll"
366+
"cpp/ql/src/Security/CWE/CWE-020/SafeExternalAPIFunction.qll",
367+
"cpp/ql/src/Security/CWE/CWE-020/ir/SafeExternalAPIFunction.qll"
368368
],
369369
"XML": [
370370
"cpp/ql/src/semmle/code/cpp/XML.qll",

cpp/ql/src/Security/CWE/CWE-020/CountUntrustedDataToExternalAPI.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
import cpp
12-
import semmle.code.cpp.security.ExternalAPIs
12+
import ExternalAPIs
1313

1414
from ExternalAPIUsedWithUntrustedData externalAPI
1515
select externalAPI, count(externalAPI.getUntrustedDataNode()) as numberOfUses,

cpp/ql/src/semmle/code/cpp/security/ExternalAPIs.qll renamed to cpp/ql/src/Security/CWE/CWE-020/ExternalAPIs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
private import cpp
77
private import semmle.code.cpp.models.interfaces.DataFlow
88
private import semmle.code.cpp.models.interfaces.Taint
9-
import implementation.ExternalAPIsSpecific
9+
import ExternalAPIsSpecific
1010

1111
/** A node representing untrusted data being passed to an external API. */
1212
class UntrustedExternalAPIDataNode extends ExternalAPIDataNode {

cpp/ql/src/Security/CWE/CWE-020/IRCountUntrustedDataToExternalAPI.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
import cpp
12-
import semmle.code.cpp.security.ir.ExternalAPIs
12+
import ir.ExternalAPIs
1313

1414
from ExternalAPIUsedWithUntrustedData externalAPI
1515
select externalAPI, count(externalAPI.getUntrustedDataNode()) as numberOfUses,

cpp/ql/src/Security/CWE/CWE-020/IRUntrustedDataToExternalAPI.ql

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

1111
import cpp
1212
import semmle.code.cpp.ir.dataflow.TaintTracking
13-
import semmle.code.cpp.security.ir.ExternalAPIs
13+
import ir.ExternalAPIs
1414
import semmle.code.cpp.security.FlowSources
1515
import DataFlow::PathGraph
1616

cpp/ql/src/semmle/code/cpp/security/implementation/SafeExternalAPIFunction.qll renamed to cpp/ql/src/Security/CWE/CWE-020/SafeExternalAPIFunction.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
private import cpp
6+
private import semmle.code.cpp.models.implementations.Pure
67

78
/**
89
* A `Function` that is considered a "safe" external API from a security perspective.

cpp/ql/src/Security/CWE/CWE-020/UntrustedDataToExternalAPI.ql

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

1111
import cpp
1212
import semmle.code.cpp.dataflow.TaintTracking
13-
import semmle.code.cpp.security.ExternalAPIs
13+
import ExternalAPIs
1414
import DataFlow::PathGraph
1515

1616
from UntrustedDataToExternalAPIConfig config, DataFlow::PathNode source, DataFlow::PathNode sink

cpp/ql/src/semmle/code/cpp/security/ir/ExternalAPIs.qll renamed to cpp/ql/src/Security/CWE/CWE-020/ir/ExternalAPIs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
private import cpp
77
private import semmle.code.cpp.models.interfaces.DataFlow
88
private import semmle.code.cpp.models.interfaces.Taint
9-
import implementation.ExternalAPIsSpecific
9+
import ExternalAPIsSpecific
1010

1111
/** A node representing untrusted data being passed to an external API. */
1212
class UntrustedExternalAPIDataNode extends ExternalAPIDataNode {

0 commit comments

Comments
 (0)