Skip to content

Commit 88411ce

Browse files
Merge branch 'main' into js-insecure-http-parser
2 parents 4ae8377 + 7285704 commit 88411ce

File tree

110 files changed

+2398
-1655
lines changed

Some content is hidden

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

110 files changed

+2398
-1655
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
6.1.2

.github/workflows/go-tests-other-os.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go 1.20
1616
uses: actions/setup-go@v4
1717
with:
18-
go-version: 1.20.0
18+
go-version: '1.20'
1919
id: go
2020

2121
- name: Check out code
@@ -50,7 +50,7 @@ jobs:
5050
- name: Set up Go 1.20
5151
uses: actions/setup-go@v4
5252
with:
53-
go-version: 1.20.0
53+
go-version: '1.20'
5454
id: go
5555

5656
- name: Check out code

.github/workflows/go-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Go 1.20
2424
uses: actions/setup-go@v4
2525
with:
26-
go-version: 1.20.0
26+
go-version: '1.20'
2727
id: go
2828

2929
- name: Check out code

.github/workflows/ruby-build.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ jobs:
5858
id: cache-extractor
5959
with:
6060
path: |
61-
ruby/extractor/target/release/autobuilder
62-
ruby/extractor/target/release/autobuilder.exe
63-
ruby/extractor/target/release/extractor
64-
ruby/extractor/target/release/extractor.exe
61+
ruby/extractor/target/release/codeql-extractor-ruby
62+
ruby/extractor/target/release/codeql-extractor-ruby.exe
6563
ruby/extractor/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
6664
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-extractor-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/extractor/Cargo.lock') }}--${{ hashFiles('ruby/extractor/**/*.rs') }}
6765
- uses: actions/cache@v3
@@ -88,15 +86,13 @@ jobs:
8886
run: |
8987
cd extractor
9088
cross build --release
91-
mv target/x86_64-unknown-linux-gnu/release/extractor target/release/
92-
mv target/x86_64-unknown-linux-gnu/release/autobuilder target/release/
93-
mv target/x86_64-unknown-linux-gnu/release/generator target/release/
89+
mv target/x86_64-unknown-linux-gnu/release/codeql-extractor-ruby target/release/
9490
- name: Release build (windows and macos)
9591
if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os != 'Linux'
9692
run: cd extractor && cargo build --release
9793
- name: Generate dbscheme
9894
if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}}
99-
run: extractor/target/release/generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
95+
run: extractor/target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
10096
- uses: actions/upload-artifact@v3
10197
if: ${{ matrix.os == 'ubuntu-latest' }}
10298
with:
@@ -111,10 +107,8 @@ jobs:
111107
with:
112108
name: extractor-${{ matrix.os }}
113109
path: |
114-
ruby/extractor/target/release/autobuilder
115-
ruby/extractor/target/release/autobuilder.exe
116-
ruby/extractor/target/release/extractor
117-
ruby/extractor/target/release/extractor.exe
110+
ruby/extractor/target/release/codeql-extractor-ruby
111+
ruby/extractor/target/release/codeql-extractor-ruby.exe
118112
retention-days: 1
119113
compile-queries:
120114
runs-on: ubuntu-latest-xl
@@ -172,13 +166,10 @@ jobs:
172166
mkdir -p ruby
173167
cp -r codeql-extractor.yml tools ql/lib/ruby.dbscheme.stats ruby/
174168
mkdir -p ruby/tools/{linux64,osx64,win64}
175-
cp linux64/autobuilder ruby/tools/linux64/autobuilder
176-
cp osx64/autobuilder ruby/tools/osx64/autobuilder
177-
cp win64/autobuilder.exe ruby/tools/win64/autobuilder.exe
178-
cp linux64/extractor ruby/tools/linux64/extractor
179-
cp osx64/extractor ruby/tools/osx64/extractor
180-
cp win64/extractor.exe ruby/tools/win64/extractor.exe
181-
chmod +x ruby/tools/{linux64,osx64}/{autobuilder,extractor}
169+
cp linux64/codeql-extractor-ruby ruby/tools/linux64/extractor
170+
cp osx64/codeql-extractor-ruby ruby/tools/osx64/extractor
171+
cp win64/codeql-extractor-ruby.exe ruby/tools/win64/extractor.exe
172+
chmod +x ruby/tools/{linux64,osx64}/extractor
182173
zip -rq codeql-ruby.zip ruby
183174
- uses: actions/upload-artifact@v3
184175
with:

cpp/ql/test/library-tests/attributes/type_attributes/type_attributes.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
| file://:0:0:0:0 | short __attribute((__may_alias__)) | type_attributes.c:25:30:25:42 | may_alias |
22
| type_attributes.c:5:36:5:51 | my_packed_struct | type_attributes.c:5:23:5:32 | packed |
3-
| type_attributes.c:10:54:10:54 | union <unnamed> | type_attributes.c:10:30:10:50 | transparent_union |
4-
| type_attributes.c:16:54:16:54 | union <unnamed> | type_attributes.c:16:30:16:50 | transparent_union |
3+
| type_attributes.c:10:54:10:54 | (unnamed class/struct/union) | type_attributes.c:10:30:10:50 | transparent_union |
4+
| type_attributes.c:16:54:16:54 | (unnamed class/struct/union) | type_attributes.c:16:30:16:50 | transparent_union |
55
| type_attributes.c:21:37:21:45 | unusedInt | type_attributes.c:21:24:21:29 | unused |
66
| type_attributes.c:23:13:23:18 | depInt | type_attributes.c:23:36:23:45 | deprecated |
77
| type_attributes_ms.cpp:1:29:1:29 | X | type_attributes_ms.cpp:1:19:1:26 | novtable |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
| (unnamed class/struct/union) |
12
| float[3] |
23
| float[3][3] |
34
| foo[1] |
4-
| struct <unnamed> |

cpp/ql/test/library-tests/structs/compatible_c/compatible.expected

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
| a1.c:6:16:6:16 | struct <unnamed> | 0 members | 2 locations | -1 | <none> |
2-
| a1.c:10:16:10:16 | struct <unnamed> | 1 members | 2 locations | 0 | x |
3-
| a1.c:17:16:17:16 | struct <unnamed> | 1 members | 2 locations | 0 | x |
1+
| a1.c:6:16:6:16 | (unnamed class/struct/union) | 0 members | 2 locations | -1 | <none> |
2+
| a1.c:10:16:10:16 | (unnamed class/struct/union) | 1 members | 2 locations | 0 | x |
3+
| a1.c:17:16:17:16 | (unnamed class/struct/union) | 1 members | 2 locations | 0 | x |
44
| a1.c:24:8:24:10 | Foo | 3 members | 2 locations | 0 | empty |
55
| a1.c:24:8:24:10 | Foo | 3 members | 2 locations | 1 | nonempty |
66
| a1.c:24:8:24:10 | Foo | 3 members | 2 locations | 2 | i |
@@ -9,9 +9,9 @@
99
| a1.c:36:8:36:10 | Bar | 3 members | 2 locations | 0 | empty |
1010
| a1.c:36:8:36:10 | Bar | 3 members | 2 locations | 1 | nonempty |
1111
| a1.c:36:8:36:10 | Bar | 3 members | 2 locations | 2 | i |
12-
| a2.c:6:16:6:16 | struct <unnamed> | 0 members | 2 locations | -1 | <none> |
13-
| a2.c:10:16:10:16 | struct <unnamed> | 1 members | 2 locations | 0 | x |
14-
| a2.c:17:16:17:16 | struct <unnamed> | 1 members | 2 locations | 0 | x |
12+
| a2.c:6:16:6:16 | (unnamed class/struct/union) | 0 members | 2 locations | -1 | <none> |
13+
| a2.c:10:16:10:16 | (unnamed class/struct/union) | 1 members | 2 locations | 0 | x |
14+
| a2.c:17:16:17:16 | (unnamed class/struct/union) | 1 members | 2 locations | 0 | x |
1515
| a2.c:24:8:24:10 | Foo | 3 members | 2 locations | 0 | empty |
1616
| a2.c:24:8:24:10 | Foo | 3 members | 2 locations | 1 | nonempty |
1717
| a2.c:24:8:24:10 | Foo | 3 members | 2 locations | 2 | i |

cpp/ql/test/library-tests/structs/compatible_c/compatible_types.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
| a1.c:10:16:10:16 | struct <unnamed> | 0 | file://:0:0:0:0 | int | 1 types |
2-
| a1.c:17:16:17:16 | struct <unnamed> | 0 | file://:0:0:0:0 | int | 1 types |
1+
| a1.c:10:16:10:16 | (unnamed class/struct/union) | 0 | file://:0:0:0:0 | int | 1 types |
2+
| a1.c:17:16:17:16 | (unnamed class/struct/union) | 0 | file://:0:0:0:0 | int | 1 types |
33
| a1.c:24:8:24:10 | Foo | 0 | file://:0:0:0:0 | anon_empty_t * | 1 types |
44
| a1.c:24:8:24:10 | Foo | 1 | file://:0:0:0:0 | anon_nonempty_t * | 1 types |
55
| a1.c:24:8:24:10 | Foo | 2 | file://:0:0:0:0 | int | 1 types |
66
| a1.c:32:8:32:15 | NonEmpty | 0 | file://:0:0:0:0 | int | 1 types |
77
| a1.c:36:8:36:10 | Bar | 0 | file://:0:0:0:0 | Empty * | 1 types |
88
| a1.c:36:8:36:10 | Bar | 1 | file://:0:0:0:0 | NonEmpty * | 1 types |
99
| a1.c:36:8:36:10 | Bar | 2 | file://:0:0:0:0 | int | 1 types |
10-
| a2.c:10:16:10:16 | struct <unnamed> | 0 | file://:0:0:0:0 | int | 1 types |
11-
| a2.c:17:16:17:16 | struct <unnamed> | 0 | file://:0:0:0:0 | int | 1 types |
10+
| a2.c:10:16:10:16 | (unnamed class/struct/union) | 0 | file://:0:0:0:0 | int | 1 types |
11+
| a2.c:17:16:17:16 | (unnamed class/struct/union) | 0 | file://:0:0:0:0 | int | 1 types |
1212
| a2.c:24:8:24:10 | Foo | 0 | file://:0:0:0:0 | anon_empty_t * | 1 types |
1313
| a2.c:24:8:24:10 | Foo | 1 | file://:0:0:0:0 | anon_nonempty_t * | 1 types |
1414
| a2.c:24:8:24:10 | Foo | 2 | file://:0:0:0:0 | int | 1 types |

csharp/ql/lib/semmle/code/csharp/frameworks/Sql.qll

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,24 @@ class IDbCommandConstructionSqlExpr extends SqlExpr, ObjectCreation {
5252
class DapperCommandDefinitionMethodCallSqlExpr extends SqlExpr, ObjectCreation {
5353
DapperCommandDefinitionMethodCallSqlExpr() {
5454
this.getObjectType() instanceof Dapper::CommandDefinitionStruct and
55-
exists(Conf c | c.hasFlow(DataFlow::exprNode(this), _))
55+
DapperCommandDefinitionMethodCallSql::flow(DataFlow::exprNode(this), _)
5656
}
5757

5858
override Expr getSql() { result = this.getArgumentForName("commandText") }
5959
}
6060

61-
private class Conf extends DataFlow4::Configuration {
62-
Conf() { this = "DapperCommandDefinitionFlowConfig" }
63-
64-
override predicate isSource(DataFlow::Node node) {
61+
private module DapperCommandDefitionMethodCallSqlConfig implements DataFlow::ConfigSig {
62+
predicate isSource(DataFlow::Node node) {
6563
node.asExpr().(ObjectCreation).getObjectType() instanceof Dapper::CommandDefinitionStruct
6664
}
6765

68-
override predicate isSink(DataFlow::Node node) {
66+
predicate isSink(DataFlow::Node node) {
6967
exists(MethodCall mc |
7068
mc.getTarget() = any(Dapper::SqlMapperClass c).getAQueryMethod() and
7169
node.asExpr() = mc.getArgumentForName("command")
7270
)
7371
}
7472
}
73+
74+
private module DapperCommandDefinitionMethodCallSql =
75+
DataFlow::Global<DapperCommandDefitionMethodCallSqlConfig>;

csharp/ql/lib/semmle/code/csharp/frameworks/system/Xml.qll

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,14 @@ class XmlReaderSettingsCreation extends ObjectCreation {
162162
}
163163
}
164164

165-
private class SettingsDataFlowConfig extends DataFlow3::Configuration {
166-
SettingsDataFlowConfig() { this = "SettingsDataFlowConfig" }
165+
private module SettingsDataFlowConfig implements DataFlow::ConfigSig {
166+
predicate isSource(DataFlow::Node source) { source.asExpr() instanceof XmlReaderSettingsCreation }
167167

168-
override predicate isSource(DataFlow::Node source) {
169-
source.asExpr() instanceof XmlReaderSettingsCreation
170-
}
171-
172-
override predicate isSink(DataFlow::Node sink) {
173-
sink.asExpr() instanceof XmlReaderSettingsInstance
174-
}
168+
predicate isSink(DataFlow::Node sink) { sink.asExpr() instanceof XmlReaderSettingsInstance }
175169
}
176170

171+
private module SettingsDataFlow = DataFlow::Global<SettingsDataFlowConfig>;
172+
177173
/** A call to `XmlReader.Create`. */
178174
class XmlReaderCreateCall extends MethodCall {
179175
XmlReaderCreateCall() { this.getTarget() = any(SystemXmlXmlReaderClass r).getCreateMethod() }
@@ -190,8 +186,6 @@ class XmlReaderSettingsInstance extends Expr {
190186

191187
/** Gets a possible creation point for this instance of `XmlReaderSettings`. */
192188
XmlReaderSettingsCreation getASettingsCreation() {
193-
exists(SettingsDataFlowConfig settingsFlow |
194-
settingsFlow.hasFlow(DataFlow::exprNode(result), DataFlow::exprNode(this))
195-
)
189+
SettingsDataFlow::flow(DataFlow::exprNode(result), DataFlow::exprNode(this))
196190
}
197191
}

0 commit comments

Comments
 (0)