Manual merge main

This commit is contained in:
Josh Brown
2023-12-29 17:01:56 -08:00
139 changed files with 348 additions and 79 deletions

View File

@@ -1,3 +1,7 @@
## 0.12.2
No user-facing changes.
## 0.12.1 ## 0.12.1
### New Features ### New Features

View File

@@ -0,0 +1,3 @@
## 0.12.2
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.12.1 lastReleaseVersion: 0.12.2

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-all name: codeql/cpp-all
version: 0.12.1 version: 0.12.2
groups: cpp groups: cpp
dbscheme: semmlecode.cpp.dbscheme dbscheme: semmlecode.cpp.dbscheme
extractor: cpp extractor: cpp

View File

@@ -1,3 +1,7 @@
## 0.9.1
No user-facing changes.
## 0.9.0 ## 0.9.0
### Breaking Changes ### Breaking Changes

View File

@@ -0,0 +1,3 @@
## 0.9.1
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.9.0 lastReleaseVersion: 0.9.1

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-queries name: codeql/cpp-queries
version: 0.9.0 version: 0.9.1
groups: groups:
- cpp - cpp
- queries - queries

View File

@@ -1,3 +1,7 @@
## 1.7.5
No user-facing changes.
## 1.7.4 ## 1.7.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 1.7.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 1.7.4 lastReleaseVersion: 1.7.5

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-all name: codeql/csharp-solorigate-all
version: 1.7.4 version: 1.7.5
groups: groups:
- csharp - csharp
- solorigate - solorigate

View File

@@ -1,3 +1,7 @@
## 1.7.5
No user-facing changes.
## 1.7.4 ## 1.7.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 1.7.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 1.7.4 lastReleaseVersion: 1.7.5

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-queries name: codeql/csharp-solorigate-queries
version: 1.7.4 version: 1.7.5
groups: groups:
- csharp - csharp
- solorigate - solorigate

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-all name: codeql/csharp-all
version: 0.8.4 version: 0.8.5
groups: csharp groups: csharp
dbscheme: semmlecode.csharp.dbscheme dbscheme: semmlecode.csharp.dbscheme
extractor: csharp extractor: csharp

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
### Minor Analysis Improvements ### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-queries name: codeql/csharp-queries
version: 0.8.4 version: 0.8.5
groups: groups:
- csharp - csharp
- queries - queries

View File

@@ -1,3 +1,7 @@
## 0.0.4
No user-facing changes.
## 0.0.3 ## 0.0.3
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.0.4
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.0.3 lastReleaseVersion: 0.0.4

View File

@@ -1,5 +1,5 @@
name: codeql-go-consistency-queries name: codeql-go-consistency-queries
version: 0.0.3 version: 0.0.4
groups: groups:
- go - go
- queries - queries

View File

@@ -1,3 +1,7 @@
## 0.7.5
No user-facing changes.
## 0.7.4 ## 0.7.4
### Bug Fixes ### Bug Fixes

View File

@@ -0,0 +1,3 @@
## 0.7.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.7.4 lastReleaseVersion: 0.7.5

View File

@@ -1,5 +1,5 @@
name: codeql/go-all name: codeql/go-all
version: 0.7.4 version: 0.7.5
groups: go groups: go
dbscheme: go.dbscheme dbscheme: go.dbscheme
extractor: go extractor: go

View File

@@ -1,3 +1,7 @@
## 0.7.5
No user-facing changes.
## 0.7.4 ## 0.7.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.7.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.7.4 lastReleaseVersion: 0.7.5

View File

@@ -1,5 +1,5 @@
name: codeql/go-queries name: codeql/go-queries
version: 0.7.4 version: 0.7.5
groups: groups:
- go - go
- queries - queries

View File

@@ -1,3 +1,7 @@
## 0.0.10
No user-facing changes.
## 0.0.9 ## 0.0.9
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.0.10
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.0.9 lastReleaseVersion: 0.0.10

View File

@@ -1,5 +1,5 @@
name: codeql/java-automodel-queries name: codeql/java-automodel-queries
version: 0.0.9 version: 0.0.10
groups: groups:
- java - java
- automodel - automodel

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
### Minor Analysis Improvements ### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/java-all name: codeql/java-all
version: 0.8.4 version: 0.8.5
groups: java groups: java
dbscheme: config/semmlecode.dbscheme dbscheme: config/semmlecode.dbscheme
extractor: java extractor: java

View File

@@ -212,6 +212,9 @@ abstract class MethodCallInsecureFileCreation extends MethodCall {
* Gets the dataflow node representing the file system entity created. * Gets the dataflow node representing the file system entity created.
*/ */
DataFlow::Node getNode() { result.asExpr() = this } DataFlow::Node getNode() { result.asExpr() = this }
/** Holds if this node is a source. */
predicate isSource() { any() }
} }
/** DEPRECATED: Alias for `MethodCallInsecureFileCreation`. */ /** DEPRECATED: Alias for `MethodCallInsecureFileCreation`. */

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/java-queries name: codeql/java-queries
version: 0.8.4 version: 0.8.5
groups: groups:
- java - java
- queries - queries

View File

@@ -192,7 +192,7 @@ export function augmentAst(ast: AugmentedSourceFile, code: string, project: Proj
} }
if (typeChecker != null) { if (typeChecker != null) {
if (isTypedNode(node)) { if (isTypedNode(node) && !typeTable.skipExtractingTypes) {
let contextualType = isContextuallyTypedNode(node) let contextualType = isContextuallyTypedNode(node)
? typeChecker.getContextualType(node) ? typeChecker.getContextualType(node)
: null; : null;

View File

@@ -554,7 +554,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
let program = project.program; let program = project.program;
let typeChecker = program.getTypeChecker(); let typeChecker = program.getTypeChecker();
let shouldReportDiagnostics = getEnvironmentVariable("SEMMLE_TYPESCRIPT_REPORT_DIAGNOSTICS", Boolean, false); let shouldReportDiagnostics = getEnvironmentVariable("SEMMLE_TYPESCRIPT_REPORT_DIAGNOSTICS", v => v.trim().toLowerCase() === "true", false);
let diagnostics = shouldReportDiagnostics let diagnostics = shouldReportDiagnostics
? program.getSemanticDiagnostics().filter(d => d.category === ts.DiagnosticCategory.Error) ? program.getSemanticDiagnostics().filter(d => d.category === ts.DiagnosticCategory.Error)
: []; : [];
@@ -807,7 +807,8 @@ function handleGetMetadataCommand(command: GetMetadataCommand) {
function reset() { function reset() {
state = new State(); state = new State();
state.typeTable.restrictedExpansion = getEnvironmentVariable("SEMMLE_TYPESCRIPT_NO_EXPANSION", Boolean, true); state.typeTable.restrictedExpansion = getEnvironmentVariable("SEMMLE_TYPESCRIPT_NO_EXPANSION", v => v.trim().toLowerCase() === "true", true);
state.typeTable.skipExtractingTypes = getEnvironmentVariable("CODEQL_EXTRACTOR_JAVASCRIPT_OPTION_SKIP_TYPES", v => v.trim().toLowerCase() === "true", false);
} }
function getEnvironmentVariable<T>(name: string, parse: (x: string) => T, defaultValue: T) { function getEnvironmentVariable<T>(name: string, parse: (x: string) => T, defaultValue: T) {
@@ -886,6 +887,7 @@ if (process.argv.length > 2) {
if (argument === "--version") { if (argument === "--version") {
console.log("parser-wrapper with TypeScript " + ts.version); console.log("parser-wrapper with TypeScript " + ts.version);
} else if (pathlib.basename(argument) === "tsconfig.json") { } else if (pathlib.basename(argument) === "tsconfig.json") {
reset();
handleOpenProjectCommand({ handleOpenProjectCommand({
command: "open-project", command: "open-project",
tsConfig: argument, tsConfig: argument,
@@ -895,7 +897,7 @@ if (process.argv.length > 2) {
virtualSourceRoot: null, virtualSourceRoot: null,
}); });
for (let sf of state.project.program.getSourceFiles()) { for (let sf of state.project.program.getSourceFiles()) {
if (pathlib.basename(sf.fileName) === "lib.d.ts") continue; if (/lib\..*\.d\.ts/.test(pathlib.basename(sf.fileName)) || pathlib.basename(sf.fileName) === "lib.d.ts") continue;
handleParseCommand({ handleParseCommand({
command: "parse", command: "parse",
filename: sf.fileName, filename: sf.fileName,

View File

@@ -383,6 +383,11 @@ export class TypeTable {
*/ */
public restrictedExpansion = false; public restrictedExpansion = false;
/**
* If set to true, skip extracting types.
*/
public skipExtractingTypes = false;
private virtualSourceRoot: VirtualSourceRoot; private virtualSourceRoot: VirtualSourceRoot;
/** /**
@@ -1240,8 +1245,15 @@ export class TypeTable {
let indexOnStack = stack.length; let indexOnStack = stack.length;
stack.push(id); stack.push(id);
/** Indicates if a type contains no type variables, is a type variable, or strictly contains type variables. */
const enum TypeVarDepth {
noTypeVar = 0,
isTypeVar = 1,
containsTypeVar = 2,
}
for (let symbol of type.getProperties()) { for (let symbol of type.getProperties()) {
let propertyType = this.tryGetTypeOfSymbol(symbol); let propertyType = typeTable.tryGetTypeOfSymbol(symbol);
if (propertyType == null) continue; if (propertyType == null) continue;
traverseType(propertyType); traverseType(propertyType);
} }
@@ -1267,13 +1279,6 @@ export class TypeTable {
return lowlinkTable.get(id); return lowlinkTable.get(id);
/** Indicates if a type contains no type variables, is a type variable, or strictly contains type variables. */
const enum TypeVarDepth {
noTypeVar = 0,
isTypeVar = 1,
containsTypeVar = 2,
}
function traverseType(type: ts.Type): TypeVarDepth { function traverseType(type: ts.Type): TypeVarDepth {
if (isTypeVariable(type)) return TypeVarDepth.isTypeVar; if (isTypeVariable(type)) return TypeVarDepth.isTypeVar;
let depth = TypeVarDepth.noTypeVar; let depth = TypeVarDepth.noTypeVar;

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
### Minor Analysis Improvements ### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/javascript-all name: codeql/javascript-all
version: 0.8.4 version: 0.8.5
groups: javascript groups: javascript
dbscheme: semmlecode.javascript.dbscheme dbscheme: semmlecode.javascript.dbscheme
extractor: javascript extractor: javascript

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
### Minor Analysis Improvements ### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/javascript-queries name: codeql/javascript-queries
version: 0.8.4 version: 0.8.5
groups: groups:
- javascript - javascript
- queries - queries

View File

@@ -5,8 +5,12 @@ if (CREATE_COMPILATION_DATABASE_LINK)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1) set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
endif () endif ()
if (NOT DEFINED BAZEL_BIN)
set(BAZEL_BIN "bazelisk")
endif ()
macro(bazel) macro(bazel)
execute_process(COMMAND bazel ${ARGN} execute_process(COMMAND ${BAZEL_BIN} ${ARGN}
COMMAND_ERROR_IS_FATAL ANY COMMAND_ERROR_IS_FATAL ANY
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

View File

@@ -1,3 +1,7 @@
## 0.7.5
No user-facing changes.
## 0.7.4 ## 0.7.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.7.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.7.4 lastReleaseVersion: 0.7.5

View File

@@ -1,4 +1,4 @@
name: codeql/suite-helpers name: codeql/suite-helpers
version: 0.7.4 version: 0.7.5
groups: shared groups: shared
warnOnImplicitThis: true warnOnImplicitThis: true

View File

@@ -1,3 +1,7 @@
## 0.11.5
No user-facing changes.
## 0.11.4 ## 0.11.4
### Minor Analysis Improvements ### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 0.11.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.11.4 lastReleaseVersion: 0.11.5

View File

@@ -1,5 +1,5 @@
name: codeql/python-all name: codeql/python-all
version: 0.11.4 version: 0.11.5
groups: python groups: python
dbscheme: semmlecode.python.dbscheme dbscheme: semmlecode.python.dbscheme
extractor: python extractor: python

View File

@@ -1,3 +1,7 @@
## 0.9.5
No user-facing changes.
## 0.9.4 ## 0.9.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.9.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.9.4 lastReleaseVersion: 0.9.5

View File

@@ -1,5 +1,5 @@
name: codeql/python-queries name: codeql/python-queries
version: 0.9.4 version: 0.9.5
groups: groups:
- python - python
- queries - queries

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
### Minor Analysis Improvements ### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/ruby-all name: codeql/ruby-all
version: 0.8.4 version: 0.8.5
groups: ruby groups: ruby
extractor: ruby extractor: ruby
dbscheme: ruby.dbscheme dbscheme: ruby.dbscheme

View File

@@ -1,3 +1,7 @@
## 0.8.5
No user-facing changes.
## 0.8.4 ## 0.8.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.8.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.8.4 lastReleaseVersion: 0.8.5

View File

@@ -1,5 +1,5 @@
name: codeql/ruby-queries name: codeql/ruby-queries
version: 0.8.4 version: 0.8.5
groups: groups:
- ruby - ruby
- queries - queries

View File

@@ -1,3 +1,7 @@
## 0.1.5
No user-facing changes.
## 0.1.4 ## 0.1.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.1.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.1.4 lastReleaseVersion: 0.1.5

View File

@@ -1,5 +1,5 @@
name: codeql/controlflow name: codeql/controlflow
version: 0.1.4 version: 0.1.5
groups: shared groups: shared
library: true library: true
dependencies: dependencies:

View File

@@ -1,3 +1,7 @@
## 0.1.5
No user-facing changes.
## 0.1.4 ## 0.1.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.1.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.1.4 lastReleaseVersion: 0.1.5

View File

@@ -589,6 +589,9 @@ module DataFlowMake<InputSig Lang> {
/** Gets the underlying `Node`. */ /** Gets the underlying `Node`. */
Node getNode(); Node getNode();
/** Holds if this node is a source. */
predicate isSource();
} }
signature module PathGraphSig<PathNodeSig PathNode> { signature module PathGraphSig<PathNodeSig PathNode> {
@@ -650,6 +653,15 @@ module DataFlowMake<InputSig Lang> {
result = this.asPathNode1().getNode() or result = this.asPathNode1().getNode() or
result = this.asPathNode2().getNode() result = this.asPathNode2().getNode()
} }
predicate isSource(){
this.asPathNode1().isSource() or
this.asPathNode2().isSource()
}
PathNode getASuccessor(){
none()
}
} }
/** /**
@@ -721,6 +733,16 @@ module DataFlowMake<InputSig Lang> {
/** Gets the underlying `Node`. */ /** Gets the underlying `Node`. */
Node getNode() { result = super.getNode() } Node getNode() { result = super.getNode() }
predicate isSource(){
this.asPathNode1().isSource() or
this.asPathNode2().isSource() or
this.asPathNode3().isSource()
}
PathNode getASuccessor(){
none()
}
} }
/** /**

View File

@@ -1,5 +1,5 @@
name: codeql/dataflow name: codeql/dataflow
version: 0.1.4 version: 0.1.5
groups: shared groups: shared
library: true library: true
dependencies: dependencies:

View File

@@ -1,3 +1,7 @@
## 0.2.5
No user-facing changes.
## 0.2.4 ## 0.2.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.2.5
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.2.4 lastReleaseVersion: 0.2.5

View File

@@ -1,5 +1,5 @@
name: codeql/mad name: codeql/mad
version: 0.2.4 version: 0.2.5
groups: shared groups: shared
library: true library: true
dependencies: null dependencies: null

View File

@@ -1,3 +1,7 @@
## 0.0.4
No user-facing changes.
## 0.0.3 ## 0.0.3
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.0.4
No user-facing changes.

View File

@@ -1,2 +1,2 @@
--- ---
lastReleaseVersion: 0.0.3 lastReleaseVersion: 0.0.4

View File

@@ -1,5 +1,5 @@
name: codeql/rangeanalysis name: codeql/rangeanalysis
version: 0.0.3 version: 0.0.4
groups: shared groups: shared
library: true library: true
dependencies: dependencies:

View File

@@ -1,3 +1,7 @@
## 0.2.5
No user-facing changes.
## 0.2.4 ## 0.2.4
No user-facing changes. No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.2.5
No user-facing changes.

Some files were not shown because too many files have changed in this diff Show More