Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 781a2a7

Browse files
authored
Merge branch 'main' into feat/SM/java_partial_path_traversal_vulnerability
2 parents 39f8854 + 022acf2 commit 781a2a7

332 files changed

Lines changed: 5613 additions & 2053 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Swift: Run Integration Tests"
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "swift/**"
7+
- .github/workflows/swift-integration-tests.yml
8+
- codeql-workspace.yml
9+
branches:
10+
- main
11+
defaults:
12+
run:
13+
working-directory: swift
14+
15+
jobs:
16+
integration-tests:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os:
22+
- ubuntu-20.04
23+
# - macos-latest TODO
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: ./.github/actions/fetch-codeql
27+
- uses: bazelbuild/setup-bazelisk@v2
28+
- uses: actions/setup-python@v3
29+
- name: Build Swift extractor
30+
run: |
31+
bazel run //swift:create-extractor-pack
32+
- name: Run integration tests
33+
run: |
34+
python integration-tests/runner.py

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ WORKSPACE.bazel @github/codeql-ci-reviewers
4242
/.github/workflows/js-ml-tests.yml @github/codeql-ml-powered-queries-reviewers
4343
/.github/workflows/ql-for-ql-* @github/codeql-ql-for-ql-reviewers
4444
/.github/workflows/ruby-* @github/codeql-ruby
45+
/.github/workflows/swift-* @github/codeql-c

config/identical-files.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,11 @@
453453
"python/ql/src/Lexical/CommentedOutCodeReferences.inc.qhelp"
454454
],
455455
"IDE Contextual Queries": [
456-
"cpp/ql/src/IDEContextual.qll",
457-
"csharp/ql/src/IDEContextual.qll",
458-
"java/ql/src/IDEContextual.qll",
459-
"javascript/ql/src/IDEContextual.qll",
460-
"python/ql/src/analysis/IDEContextual.qll"
456+
"cpp/ql/lib/IDEContextual.qll",
457+
"csharp/ql/lib/IDEContextual.qll",
458+
"java/ql/lib/IDEContextual.qll",
459+
"javascript/ql/lib/IDEContextual.qll",
460+
"python/ql/lib/analysis/IDEContextual.qll"
461461
],
462462
"SSA C#": [
463463
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll",

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config
428428
exists(Node n1, Node n2 |
429429
node1.asNode() = n1 and
430430
node2.asNode() = n2 and
431-
simpleLocalFlowStepExt(n1, n2) and
431+
simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
432432
stepFilter(node1, node2, config)
433433
)
434434
or
@@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat
447447
exists(Node n1, Node n2 |
448448
node1.asNode() = n1 and
449449
node2.asNode() = n2 and
450-
config.isAdditionalFlowStep(n1, n2) and
450+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
451451
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
452452
stepFilter(node1, node2, config)
453453
)
@@ -466,7 +466,7 @@ private predicate additionalLocalStateStep(
466466
exists(Node n1, Node n2 |
467467
node1.asNode() = n1 and
468468
node2.asNode() = n2 and
469-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
469+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
470470
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
471471
stepFilter(node1, node2, config) and
472472
not stateBarrier(node1, s1, config) and
@@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) {
481481
exists(Node n1, Node n2 |
482482
node1.asNode() = n1 and
483483
node2.asNode() = n2 and
484-
jumpStepCached(n1, n2) and
484+
jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
485485
stepFilter(node1, node2, config) and
486486
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
487487
)
@@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c
494494
exists(Node n1, Node n2 |
495495
node1.asNode() = n1 and
496496
node2.asNode() = n2 and
497-
config.isAdditionalFlowStep(n1, n2) and
497+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
498498
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
499499
stepFilter(node1, node2, config) and
500500
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
@@ -507,7 +507,7 @@ private predicate additionalJumpStateStep(
507507
exists(Node n1, Node n2 |
508508
node1.asNode() = n1 and
509509
node2.asNode() = n2 and
510-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
510+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
511511
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
512512
stepFilter(node1, node2, config) and
513513
not stateBarrier(node1, s1, config) and
@@ -518,7 +518,7 @@ private predicate additionalJumpStateStep(
518518

519519
pragma[nomagic]
520520
private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) {
521-
readSet(node1.asNode(), c, node2.asNode()) and
521+
readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and
522522
stepFilter(node1, node2, config)
523523
or
524524
exists(Node n |
@@ -562,7 +562,8 @@ pragma[nomagic]
562562
private predicate store(
563563
NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config
564564
) {
565-
store(node1.asNode(), tc, node2.asNode(), contentType) and
565+
store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()),
566+
contentType) and
566567
read(_, tc.getContent(), _, config) and
567568
stepFilter(node1, node2, config)
568569
}

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config
428428
exists(Node n1, Node n2 |
429429
node1.asNode() = n1 and
430430
node2.asNode() = n2 and
431-
simpleLocalFlowStepExt(n1, n2) and
431+
simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
432432
stepFilter(node1, node2, config)
433433
)
434434
or
@@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat
447447
exists(Node n1, Node n2 |
448448
node1.asNode() = n1 and
449449
node2.asNode() = n2 and
450-
config.isAdditionalFlowStep(n1, n2) and
450+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
451451
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
452452
stepFilter(node1, node2, config)
453453
)
@@ -466,7 +466,7 @@ private predicate additionalLocalStateStep(
466466
exists(Node n1, Node n2 |
467467
node1.asNode() = n1 and
468468
node2.asNode() = n2 and
469-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
469+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
470470
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
471471
stepFilter(node1, node2, config) and
472472
not stateBarrier(node1, s1, config) and
@@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) {
481481
exists(Node n1, Node n2 |
482482
node1.asNode() = n1 and
483483
node2.asNode() = n2 and
484-
jumpStepCached(n1, n2) and
484+
jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
485485
stepFilter(node1, node2, config) and
486486
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
487487
)
@@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c
494494
exists(Node n1, Node n2 |
495495
node1.asNode() = n1 and
496496
node2.asNode() = n2 and
497-
config.isAdditionalFlowStep(n1, n2) and
497+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
498498
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
499499
stepFilter(node1, node2, config) and
500500
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
@@ -507,7 +507,7 @@ private predicate additionalJumpStateStep(
507507
exists(Node n1, Node n2 |
508508
node1.asNode() = n1 and
509509
node2.asNode() = n2 and
510-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
510+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
511511
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
512512
stepFilter(node1, node2, config) and
513513
not stateBarrier(node1, s1, config) and
@@ -518,7 +518,7 @@ private predicate additionalJumpStateStep(
518518

519519
pragma[nomagic]
520520
private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) {
521-
readSet(node1.asNode(), c, node2.asNode()) and
521+
readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and
522522
stepFilter(node1, node2, config)
523523
or
524524
exists(Node n |
@@ -562,7 +562,8 @@ pragma[nomagic]
562562
private predicate store(
563563
NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config
564564
) {
565-
store(node1.asNode(), tc, node2.asNode(), contentType) and
565+
store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()),
566+
contentType) and
566567
read(_, tc.getContent(), _, config) and
567568
stepFilter(node1, node2, config)
568569
}

0 commit comments

Comments
 (0)