Compare commits

..

36 Commits

Author SHA1 Message Date
github-actions[bot]
2c9f478f43 Post-release preparation for criemen/codeql-cli-2.91.0 2023-12-18 11:48:37 +00:00
Cornelius Riemenschneider
333a893518 Merge pull request #15133 from github/criemen/release-prep/2.91.0
Release preparation for version 2.91.0 - TESTING IGNORE
2023-12-18 12:38:16 +01:00
github-actions[bot]
2f7aa31a44 Release preparation for version 2.91.0 2023-12-18 11:37:00 +00:00
Erik Krogh Kristensen
9543c23aba Merge pull request #15111 from erik-krogh/mergeback-ts-extractor
JS: TypeScript extractor fixes into rc/3.12
2023-12-15 09:21:20 +01:00
erik-krogh
c752f26f91 use direct string comparison instead, that doesn't crash on invalid values 2023-12-14 20:43:16 +01:00
erik-krogh
5bbf79bf26 fix the parsing of boolean environment variables in the TypeScript extractor 2023-12-14 20:43:16 +01:00
erik-krogh
1a0d29ba8a rename extractor environment variable to CODEQL_EXTRACTOR_JAVASCRIPT_OPTION_SKIP_TYPES 2023-12-14 20:43:16 +01:00
erik-krogh
62205f6a7f add environment variable to skip extraction of types in TypeScript 2023-12-14 20:43:16 +01:00
erik-krogh
b5fe0e5709 make sure reset() is called when manually invoking the TS extractor, so environment-variables are read 2023-12-14 20:43:16 +01:00
erik-krogh
96d1573978 move TypeVarDepth further up, so its declared before it's used 2023-12-14 20:43:15 +01:00
erik-krogh
10cf53b8d3 fix a this reference
`this` didn't refer to anything specific, and it was in fact `undefined` in the context it was invoked. There was already a  `let typeTable = this;` further up (where `this` refers to the class instance), so I used `typeTable`.
2023-12-14 20:43:15 +01:00
erik-krogh
43b228dbb4 exclude all the lib.d.ts files when running the TS extractor directly
e.g. the `lib.es5.d.ts` file was not excluded
2023-12-14 20:43:15 +01:00
Chuan-kai Lin
96b793a877 Merge pull request #15032 from github/post-release-prep/codeql-cli-2.15.4
Post-release preparation for codeql-cli-2.15.4
2023-12-07 09:23:32 -08:00
github-actions[bot]
92af5f5386 Post-release preparation for codeql-cli-2.15.4 2023-12-06 22:59:22 +00:00
Chuan-kai Lin
ff0c1ca2d6 Merge pull request #15031 from github/release-prep/2.15.4
Release preparation for version 2.15.4
2023-12-06 13:35:26 -08:00
github-actions[bot]
c04457e9e7 Release preparation for version 2.15.4 2023-12-06 21:11:50 +00:00
Chuan-kai Lin
4a7e816a30 Merge pull request #15029 from github/copy-alexdenisov/update-docs
docs: update supported Swift version
2023-12-06 13:08:54 -08:00
Alex Denisov
7923c33a7b docs: update supported Swift version 2023-12-06 12:25:31 -08:00
Sarita Iyer
5a4ea7781e Merge pull request #14976 from github/saritai/docs-update-12431
Document threat models
2023-12-04 10:10:00 -05:00
Sarita Iyer
c4b6f44dff fix punctuation 2023-12-04 09:47:09 -05:00
Sarita Iyer
52a0a8333f Update customizing-library-models-for-java-and-kotlin.rst 2023-12-04 09:21:22 -05:00
Sarita Iyer
5bf93d096b Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-12-04 09:13:33 -05:00
Sarita Iyer
05c67756ef fix beta note problem 2023-12-01 15:00:44 -05:00
Sarita Iyer
54daf8cacc Apply suggestions from code review
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-12-01 12:06:43 -05:00
Sarita Iyer
b5084ccf7f move beta ntoe 2023-12-01 11:59:57 -05:00
Sarita Iyer
6f87b1d622 test 2023-12-01 11:44:06 -05:00
Sarita Iyer
9e69e02d04 fix error 2023-12-01 11:32:13 -05:00
Sarita Iyer
2ab960428a Update customizing-library-models-for-java-and-kotlin.rst 2023-12-01 10:26:42 -05:00
Sarita Iyer
d96d71384d Update customizing-library-models-for-java-and-kotlin.rst 2023-12-01 09:57:11 -05:00
Sarita Iyer
848293470a Update customizing-library-models-for-java-and-kotlin.rst 2023-12-01 09:41:03 -05:00
james
7f3ff7f9a5 update threat models section 2023-12-01 11:19:00 +00:00
james
fe126c450b threat model suggestions 2023-12-01 10:54:11 +00:00
Sarita Iyer
e1b5530602 Merge branch 'main' into saritai/docs-update-12431 2023-11-30 17:40:25 -05:00
Sarita Iyer
2bea328a5b Update customizing-library-models-for-java-and-kotlin.rst 2023-11-30 17:39:55 -05:00
Sarita Iyer
849ec72728 Update customizing-library-models-for-java-and-kotlin.rst 2023-11-30 17:21:59 -05:00
Sarita Iyer
48e23e68c1 add info 2023-11-30 17:17:18 -05:00
185 changed files with 640 additions and 166 deletions

View File

@@ -1,3 +1,13 @@
## 0.12.2
No user-facing changes.
## 0.12.1
### New Features
* Added an `isPrototyped` predicate to `Function` that holds when the function has a prototype.
## 0.12.0
### Breaking Changes

View File

@@ -1,4 +1,5 @@
---
category: feature
---
## 0.12.1
### New Features
* Added an `isPrototyped` predicate to `Function` that holds when the function has a prototype.

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,17 @@
## 0.9.1
No user-facing changes.
## 0.9.0
### Breaking Changes
* The `cpp/tainted-format-string-through-global` query has been deleted. This does not lead to a loss of relevant alerts, as the query duplicated a subset of the alerts from `cpp/tainted-format-string`.
### New Queries
* Added a new query, `cpp/use-of-string-after-lifetime-ends`, to detect calls to `c_str` on strings that will be destroyed immediately.
## 0.8.3
### Minor Analysis Improvements

View File

@@ -1,4 +0,0 @@
---
category: newQuery
---
* Added a new query, `cpp/use-of-string-after-lifetime-ends`, to detect calls to `c_str` on strings that will be destroyed immediately.

View File

@@ -1,4 +1,9 @@
---
category: breaking
---
## 0.9.0
### Breaking Changes
* The `cpp/tainted-format-string-through-global` query has been deleted. This does not lead to a loss of relevant alerts, as the query duplicated a subset of the alerts from `cpp/tainted-format-string`.
### New Queries
* Added a new query, `cpp/use-of-string-after-lifetime-ends`, to detect calls to `c_str` on strings that will be destroyed immediately.

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-queries
version: 0.8.4-dev
version: 0.9.2-dev
groups:
- cpp
- queries

View File

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

View File

@@ -0,0 +1,3 @@
## 1.7.4
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.3
lastReleaseVersion: 1.7.5

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
## 1.7.4
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.3
lastReleaseVersion: 1.7.5

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
## 0.8.4
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.3
lastReleaseVersion: 0.8.5

View File

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

View File

@@ -1,3 +1,13 @@
## 0.8.5
No user-facing changes.
## 0.8.4
### Minor Analysis Improvements
* Modelled additional flow steps to track flow from a `View` call in an MVC controller to the corresponding Razor View (`.cshtml`) file, which may result in additional results for queries such as `cs/web/xss`.
## 0.8.3
### Minor Analysis Improvements

View File

@@ -1,4 +1,5 @@
---
category: minorAnalysis
---
* Modelled additional flow steps to track flow from a `View` call in an MVC controller to the corresponding Razor View (`.cshtml`) file, which may result in additional results for queries such as `cs/web/xss`.
## 0.8.4
### Minor Analysis Improvements
* Modelled additional flow steps to track flow from a `View` call in an MVC controller to the corresponding Razor View (`.cshtml`) file, which may result in additional results for queries such as `cs/web/xss`.

View File

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

View File

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

View File

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

View File

@@ -54,14 +54,14 @@ Data extensions use union semantics, which means that the tuples of all extensio
Publish data extension files in a CodeQL model pack to share
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can group one or more data extention files into a CodeQL model pack and publish it to the GitHub Container Registry. This makes it easy for anyone to download the model pack and use it to extend their analysis. For more information, see "`Creating a CodeQL model pack <https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack/>`__ and `Publishing and using CodeQL packs <https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/publishing-and-using-codeql-packs/>`__ in the CodeQL CLI documentation.
You can group one or more data extension files into a CodeQL model pack and publish it to the GitHub Container Registry. This makes it easy for anyone to download the model pack and use it to extend their analysis. For more information, see `Creating a CodeQL model pack <https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack>`__ and `Publishing and using CodeQL packs <https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/publishing-and-using-codeql-packs/>`__ in the CodeQL CLI documentation.
Extensible predicates used to create custom models in Java and Kotlin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The CodeQL library for Java and Kotlin analysis exposes the following extensible predicates:
- ``sourceModel(package, type, subtypes, name, signature, ext, output, kind, provenance)``. This is used to model sources of potentially tainted data.
- ``sourceModel(package, type, subtypes, name, signature, ext, output, kind, provenance)``. This is used to model sources of potentially tainted data. The ``kind`` of the sources defined using this predicate determine which threat model they are associated with. Different threat models can be used to customize the sources used in an analysis. For more information, see ":ref:`Threat models <threat-models>`."
- ``sinkModel(package, type, subtypes, name, signature, ext, input, kind, provenance)``. This is used to model sinks where tainted data maybe used in a way that makes the code vulnerable.
- ``summaryModel(package, type, subtypes, name, signature, ext, input, output, kind, provenance)``. This is used to model flow through elements.
- ``neutralModel(package, type, name, signature, kind, provenance)``. This is similar to a summary model but used to model the flow of values that have only a minor impact on the dataflow analysis.
@@ -151,7 +151,7 @@ The sixth value should be left empty and is out of scope for this documentation.
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the source.
- The seventh value ``ReturnValue`` is the access path to the return of the method, which means that it is the return value that should be considered a source of tainted input.
- The eighth value ``remote`` is the kind of the source. The source kind is used to define the queries where the source is in scope. ``remote`` applies to many of the security related queries as it means a remote source of untrusted data. As an example the SQL injection query uses ``remote`` sources.
- The eighth value ``remote`` is the kind of the source. The source kind is used to define the threat model where the source is in scope. ``remote`` applies to many of the security related queries as it means a remote source of untrusted data. As an example the SQL injection query uses ``remote`` sources. For more information, see ":ref:`Threat models <threat-models>`."
- The ninth value ``manual`` is the provenance of the source, which is used to identify the origin of the source.
Example: Add flow through the ``concat`` method
@@ -291,3 +291,19 @@ The first four values identify the callable (in this case a method) to be modele
- The fourth value ``()`` is the method input type signature.
- The fifth value ``summary`` is the kind of the neutral.
- The sixth value ``manual`` is the provenance of the neutral.
.. _threat-models:
Threat models
-------------
.. include:: ../reusables/beta-note-threat-models-java.rst
A threat model is a named class of dataflow sources that can be enabled or disabled independently. Threat models allow you to control the set of dataflow sources that you want to consider unsafe. For example, one codebase may only consider remote HTTP requests to be tainted, whereas another may also consider data from local files to be unsafe. You can use threat models to ensure that the relevant taint sources are used in a CodeQL analysis.
The ``kind`` property of the ``sourceModel`` determines which threat model a source is associated with. There are two main categories:
- ``remote`` which represents requests and responses from the network.
- ``local`` which represents data from local files (``file``), command-line arguments (``commandargs``), database reads (``database``), and environment variables(``environment``).
When running a CodeQL analysis, the ``remote`` threat model is included by default. You can optionally include other threat models as appropriate when using the CodeQL CLI and in GitHub code scanning. For more information, see `Analyzing your code with CodeQL queries <https://docs.github.com/code-security/codeql-cli/getting-started-with-the-codeql-cli/analyzing-your-code-with-codeql-queries#including-model-packs-to-add-potential-sources-of-tainted-data>`__ and `Customizing your advanced setup for code scanning <https://docs.github.com/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models>`__.

View File

@@ -0,0 +1,5 @@
.. pull-quote::
Note
Threat models are currently in beta and subject to change. During the beta, threat models are supported only by Java analysis.

View File

@@ -24,7 +24,7 @@
JavaScript,ECMAScript 2022 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhtm``, ``.xhtml``, ``.vue``, ``.hbs``, ``.ejs``, ``.njk``, ``.json``, ``.yaml``, ``.yml``, ``.raml``, ``.xml`` [8]_"
Python [9]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12",Not applicable,``.py``
Ruby [10]_,"up to 3.2",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``"
Swift [11]_,"Swift 5.4-5.8.1","Swift compiler","``.swift``"
Swift [11]_,"Swift 5.4-5.9.1","Swift compiler","``.swift``"
TypeScript [12]_,"2.6-5.3",Standard TypeScript compiler,"``.ts``, ``.tsx``, ``.mts``, ``.cts``"
.. container:: footnote-group

View File

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

View File

@@ -0,0 +1,3 @@
## 0.0.3
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.2
lastReleaseVersion: 0.0.4

View File

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

View File

@@ -1,8 +1,18 @@
## 0.7.5
No user-facing changes.
## 0.7.4
### Bug Fixes
* A bug has been fixed that meant that value flow through a slice expression was not tracked correctly. Taint flow was tracked correctly.
## 0.7.3
### Minor Analysis Improvements
* Added the [gin cors](https://github.com/gin-contrib/cors) library to the CorsMisconfiguration.ql query
* Added the [gin-contrib/cors](https://github.com/gin-contrib/cors) library to the experimental query "CORS misconfiguration" (`go/cors-misconfiguration`).
### Bug Fixes

View File

@@ -1,4 +1,5 @@
---
category: fix
---
## 0.7.4
### Bug Fixes
* A bug has been fixed that meant that value flow through a slice expression was not tracked correctly. Taint flow was tracked correctly.

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
## 0.7.4
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.3
lastReleaseVersion: 0.7.5

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,16 @@
## 0.8.5
No user-facing changes.
## 0.8.4
### Minor Analysis Improvements
* The diagnostic query `java/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Java files, now considers any Java file seen during extraction, even one with some errors, to be extracted / scanned.
* Switch cases using binding patterns and `case null[, default]` are now supported. Classes `PatternCase` and `NullDefaultCase` are introduced to represent new kinds of case statement.
* Both switch cases and instanceof expressions using record patterns are now supported. The new class `RecordPatternExpr` is introduced to represent record patterns, and `InstanceOfExpr` gains `getPattern` to replace `getLocalVariableDeclExpr`.
* The control-flow graph and therefore dominance information regarding switch blocks in statement context but with an expression rule (e.g. `switch(...) { case 1 -> System.out.println("Hello world!") }`) has been fixed. This reduces false positives and negatives from various queries relating to functions featuring such statements.
## 0.8.3
### Deprecated APIs

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* The diagnostic query `java/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Java files, now considers any Java file seen during extraction, even one with some errors, to be extracted / scanned.

View File

@@ -1,6 +1,8 @@
---
category: minorAnalysis
---
## 0.8.4
### Minor Analysis Improvements
* The diagnostic query `java/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Java files, now considers any Java file seen during extraction, even one with some errors, to be extracted / scanned.
* Switch cases using binding patterns and `case null[, default]` are now supported. Classes `PatternCase` and `NullDefaultCase` are introduced to represent new kinds of case statement.
* Both switch cases and instanceof expressions using record patterns are now supported. The new class `RecordPatternExpr` is introduced to represent record patterns, and `InstanceOfExpr` gains `getPattern` to replace `getLocalVariableDeclExpr`.
* The control-flow graph and therefore dominance information regarding switch blocks in statement context but with an expression rule (e.g. `switch(...) { case 1 -> System.out.println("Hello world!") }`) has been fixed. This reduces false positives and negatives from various queries relating to functions featuring such statements.

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
## 0.8.4
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.3
lastReleaseVersion: 0.8.5

View File

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

View File

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

View File

@@ -554,7 +554,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
let program = project.program;
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
? program.getSemanticDiagnostics().filter(d => d.category === ts.DiagnosticCategory.Error)
: [];
@@ -807,7 +807,8 @@ function handleGetMetadataCommand(command: GetMetadataCommand) {
function reset() {
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) {
@@ -886,6 +887,7 @@ if (process.argv.length > 2) {
if (argument === "--version") {
console.log("parser-wrapper with TypeScript " + ts.version);
} else if (pathlib.basename(argument) === "tsconfig.json") {
reset();
handleOpenProjectCommand({
command: "open-project",
tsConfig: argument,
@@ -895,7 +897,7 @@ if (process.argv.length > 2) {
virtualSourceRoot: null,
});
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({
command: "parse",
filename: sf.fileName,

View File

@@ -383,6 +383,11 @@ export class TypeTable {
*/
public restrictedExpansion = false;
/**
* If set to true, skip extracting types.
*/
public skipExtractingTypes = false;
private virtualSourceRoot: VirtualSourceRoot;
/**
@@ -1240,8 +1245,15 @@ export class TypeTable {
let indexOnStack = stack.length;
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()) {
let propertyType = this.tryGetTypeOfSymbol(symbol);
let propertyType = typeTable.tryGetTypeOfSymbol(symbol);
if (propertyType == null) continue;
traverseType(propertyType);
}
@@ -1267,13 +1279,6 @@ export class TypeTable {
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 {
if (isTypeVariable(type)) return TypeVarDepth.isTypeVar;
let depth = TypeVarDepth.noTypeVar;

View File

@@ -1,3 +1,14 @@
## 0.8.5
No user-facing changes.
## 0.8.4
### Minor Analysis Improvements
* Added models for the `sqlite` and `better-sqlite3` npm packages.
* TypeScript 5.3 is now supported.
## 0.8.3
No user-facing changes.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* TypeScript 5.3 is now supported.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* Added models for the `sqlite` and `better-sqlite3` npm packages.

View File

@@ -0,0 +1,6 @@
## 0.8.4
### Minor Analysis Improvements
* Added models for the `sqlite` and `better-sqlite3` npm packages.
* TypeScript 5.3 is now supported.

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,13 @@
## 0.8.5
No user-facing changes.
## 0.8.4
### Minor Analysis Improvements
* Added django URLs to detected "safe" URL patterns in `js/unsafe-external-link`.
## 0.8.3
### Query Metadata Changes

View File

@@ -1,4 +1,5 @@
---
category: minorAnalysis
---
## 0.8.4
### Minor Analysis Improvements
* Added django URLs to detected "safe" URL patterns in `js/unsafe-external-link`.

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
## 0.7.4
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.3
lastReleaseVersion: 0.7.5

View File

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

View File

@@ -1,3 +1,16 @@
## 0.11.5
No user-facing changes.
## 0.11.4
### Minor Analysis Improvements
- Added support for tarfile extraction filters as defined in [PEP-706](https://peps.python.org/pep-0706). In particular, calls to `TarFile.extract`, and `TarFile.extractall` are no longer considered to be sinks for the `py/tarslip` query if a sufficiently safe filter is provided.
* Added modeling of `*args` and `**kwargs` as routed-parameters in request handlers for django/flask/FastAPI/tornado.
- Added support for type parameters in function and class definitions, as well as the new Python 3.12 type alias statement.
* Added taint-flow modeling for regular expressions with `re` module from the standard library.
## 0.11.3
### Minor Analysis Improvements

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* Added taint-flow modeling for regular expressions with `re` module from the standard library.

View File

@@ -1,5 +0,0 @@
---
category: minorAnalysis
---
- Added support for type parameters in function and class definitions, as well as the new Python 3.12 type alias statement.

View File

@@ -1,4 +0,0 @@
---
category: minorAnalysis
---
* Added modeling of `*args` and `**kwargs` as routed-parameters in request handlers for django/flask/FastAPI/tornado.

View File

@@ -1,5 +0,0 @@
---
category: minorAnalysis
---
- Added support for tarfile extraction filters as defined in [PEP-706](https://peps.python.org/pep-0706). In particular, calls to `TarFile.extract`, and `TarFile.extractall` are no longer considered to be sinks for the `py/tarslip` query if a sufficiently safe filter is provided.

View File

@@ -0,0 +1,8 @@
## 0.11.4
### Minor Analysis Improvements
- Added support for tarfile extraction filters as defined in [PEP-706](https://peps.python.org/pep-0706). In particular, calls to `TarFile.extract`, and `TarFile.extractall` are no longer considered to be sinks for the `py/tarslip` query if a sufficiently safe filter is provided.
* Added modeling of `*args` and `**kwargs` as routed-parameters in request handlers for django/flask/FastAPI/tornado.
- Added support for type parameters in function and class definitions, as well as the new Python 3.12 type alias statement.
* Added taint-flow modeling for regular expressions with `re` module from the standard library.

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,11 @@
## 0.9.5
No user-facing changes.
## 0.9.4
No user-facing changes.
## 0.9.3
### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 0.9.4
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.3
lastReleaseVersion: 0.9.5

View File

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

View File

@@ -1,3 +1,13 @@
## 0.8.5
No user-facing changes.
## 0.8.4
### Minor Analysis Improvements
* Improved modeling for `ActiveRecord`s `update_all` method
## 0.8.3
No user-facing changes.

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