Skip to content

Commit dec747f

Browse files
committed
Merge branch 'main' into more-random-sources-in-uncontrolled-arithmetic
2 parents 04dcef5 + c47d680 commit dec747f

File tree

1,143 files changed

+29262
-13588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,143 files changed

+29262
-13588
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update framework coverage reports
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
8+
jobs:
9+
update:
10+
name: Update framework coverage report
11+
if: github.event.repository.fork == false
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Dump GitHub context
16+
env:
17+
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
18+
run: echo "$GITHUB_CONTEXT"
19+
- name: Clone self (github/codeql)
20+
uses: actions/checkout@v2
21+
with:
22+
path: ql
23+
fetch-depth: 0
24+
- name: Set up Python 3.8
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.8
28+
- name: Download CodeQL CLI
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip"
33+
- name: Unzip CodeQL CLI
34+
run: unzip -d codeql-cli codeql-linux64.zip
35+
36+
- name: Generate coverage files
37+
run: |
38+
PATH="$PATH:codeql-cli/codeql" python ql/misc/scripts/library-coverage/generate-report.py ci ql ql
39+
40+
- name: Create pull request with changes
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
python ql/misc/scripts/library-coverage/create-pr.py ql "$GITHUB_REPOSITORY"

config/identical-files.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,5 +448,17 @@
448448
"SensitiveDataHeuristics Python/JS": [
449449
"javascript/ql/src/semmle/javascript/security/internal/SensitiveDataHeuristics.qll",
450450
"python/ql/src/semmle/python/security/internal/SensitiveDataHeuristics.qll"
451+
],
452+
"ReDoS Util Python/JS": [
453+
"javascript/ql/src/semmle/javascript/security/performance/ReDoSUtil.qll",
454+
"python/ql/src/semmle/python/security/performance/ReDoSUtil.qll"
455+
],
456+
"ReDoS Exponential Python/JS": [
457+
"javascript/ql/src/semmle/javascript/security/performance/ExponentialBackTracking.qll",
458+
"python/ql/src/semmle/python/security/performance/ExponentialBackTracking.qll"
459+
],
460+
"ReDoS Polynomial Python/JS": [
461+
"javascript/ql/src/semmle/javascript/security/performance/SuperlinearBackTracking.qll",
462+
"python/ql/src/semmle/python/security/performance/SuperlinearBackTracking.qll"
451463
]
452464
}

cpp/ql/src/Diagnostics/FailedExtractorInvocations.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77

88
import cpp
99

10-
class AnonymousCompilation extends Compilation {
11-
override string toString() { result = "<compilation>" }
12-
}
13-
1410
string describe(Compilation c) {
1511
if c.getArgument(1) = "--mimic"
1612
then result = "compiler invocation " + concat(int i | i > 1 | c.getArgument(i), " " order by i)
@@ -19,4 +15,4 @@ string describe(Compilation c) {
1915

2016
from Compilation c
2117
where not c.normalTermination()
22-
select c, "Extraction aborted for " + describe(c), 2
18+
select "Extraction aborted for " + describe(c)

cpp/ql/src/Summary/LinesOfCode.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* @description The total number of lines of C/C++ code across all files, including system headers, libraries, and auto-generated files. This is a useful metric of the size of a database. For all files that were seen during the build, this query counts the lines of code, excluding whitespace or comments.
55
* @kind metric
66
* @tags summary
7-
* lines-of-code
87
*/
98

109
import cpp

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ private module Stage2 {
13931393
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
1396-
revFlow(ret, true, apSome(_), ap0, config) and
1396+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
1397+
pragma[only_bind_into](config)) and
13971398
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
@@ -2086,7 +2087,8 @@ private module Stage3 {
20862087
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
2089-
revFlow(ret, true, apSome(_), ap0, config) and
2090+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2091+
pragma[only_bind_into](config)) and
20902092
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
@@ -2848,7 +2850,8 @@ private module Stage4 {
28482850
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
2851-
revFlow(ret, true, apSome(_), ap0, config) and
2853+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2854+
pragma[only_bind_into](config)) and
28522855
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ private module Stage2 {
13931393
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
1396-
revFlow(ret, true, apSome(_), ap0, config) and
1396+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
1397+
pragma[only_bind_into](config)) and
13971398
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
@@ -2086,7 +2087,8 @@ private module Stage3 {
20862087
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
2089-
revFlow(ret, true, apSome(_), ap0, config) and
2090+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2091+
pragma[only_bind_into](config)) and
20902092
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
@@ -2848,7 +2850,8 @@ private module Stage4 {
28482850
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
2851-
revFlow(ret, true, apSome(_), ap0, config) and
2853+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2854+
pragma[only_bind_into](config)) and
28522855
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ private module Stage2 {
13931393
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
1396-
revFlow(ret, true, apSome(_), ap0, config) and
1396+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
1397+
pragma[only_bind_into](config)) and
13971398
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
@@ -2086,7 +2087,8 @@ private module Stage3 {
20862087
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
2089-
revFlow(ret, true, apSome(_), ap0, config) and
2090+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2091+
pragma[only_bind_into](config)) and
20902092
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
@@ -2848,7 +2850,8 @@ private module Stage4 {
28482850
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
2851-
revFlow(ret, true, apSome(_), ap0, config) and
2853+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2854+
pragma[only_bind_into](config)) and
28522855
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ private module Stage2 {
13931393
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
1396-
revFlow(ret, true, apSome(_), ap0, config) and
1396+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
1397+
pragma[only_bind_into](config)) and
13971398
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
@@ -2086,7 +2087,8 @@ private module Stage3 {
20862087
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
2089-
revFlow(ret, true, apSome(_), ap0, config) and
2090+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2091+
pragma[only_bind_into](config)) and
20902092
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
@@ -2848,7 +2850,8 @@ private module Stage4 {
28482850
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
2851-
revFlow(ret, true, apSome(_), ap0, config) and
2853+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2854+
pragma[only_bind_into](config)) and
28522855
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ private module Stage2 {
13931393
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
1396-
revFlow(ret, true, apSome(_), ap0, config) and
1396+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
1397+
pragma[only_bind_into](config)) and
13971398
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
@@ -2086,7 +2087,8 @@ private module Stage3 {
20862087
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
2089-
revFlow(ret, true, apSome(_), ap0, config) and
2090+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2091+
pragma[only_bind_into](config)) and
20902092
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
@@ -2848,7 +2850,8 @@ private module Stage4 {
28482850
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
2851-
revFlow(ret, true, apSome(_), ap0, config) and
2853+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2854+
pragma[only_bind_into](config)) and
28522855
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,8 @@ private module Stage2 {
13931393
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
13941394
parameterFlow(p, ap, ap0, c, config) and
13951395
c = ret.getEnclosingCallable() and
1396-
revFlow(ret, true, apSome(_), ap0, config) and
1396+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
1397+
pragma[only_bind_into](config)) and
13971398
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
13981399
kind = ret.getKind() and
13991400
p.getPosition() = pos and
@@ -2086,7 +2087,8 @@ private module Stage3 {
20862087
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
20872088
parameterFlow(p, ap, ap0, c, config) and
20882089
c = ret.getEnclosingCallable() and
2089-
revFlow(ret, true, apSome(_), ap0, config) and
2090+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2091+
pragma[only_bind_into](config)) and
20902092
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
20912093
kind = ret.getKind() and
20922094
p.getPosition() = pos and
@@ -2848,7 +2850,8 @@ private module Stage4 {
28482850
exists(RetNodeEx ret, Ap ap0, ReturnKindExt kind, int pos |
28492851
parameterFlow(p, ap, ap0, c, config) and
28502852
c = ret.getEnclosingCallable() and
2851-
revFlow(ret, true, apSome(_), ap0, config) and
2853+
revFlow(pragma[only_bind_into](ret), true, apSome(_), pragma[only_bind_into](ap0),
2854+
pragma[only_bind_into](config)) and
28522855
fwdFlow(ret, any(CcCall ccc), apSome(ap), ap0, config) and
28532856
kind = ret.getKind() and
28542857
p.getPosition() = pos and

0 commit comments

Comments
 (0)