Compare commits

..

19 Commits

Author SHA1 Message Date
Alex Eyers-Taylor
07956c9ad6 Ruby: Avoid a forced CP that confused the join orderer. 2025-03-04 15:23:56 +00:00
Jami
c22b05a6f4 Merge pull request #18900 from jcogs33/jcogs33/java/unreleased-lock-fp
Java: handle lock state check stored in variable for `java/unreleased-lock`
2025-03-04 06:38:56 -05:00
Simon Friis Vindum
0d1865d718 Merge pull request #18872 from paldepind/rust-ref-mut
Rust: Allow SSA and some data flow for mutable borrows
2025-03-04 09:25:18 +01:00
Michael Nebel
96c0ca87fc Merge pull request #18865 from carldybdahl-microsoft/csharp/path-combine
Add CodeQL recommendation against Path.Combine
2025-03-04 08:51:04 +01:00
Carl Dybdahl
2f7cdf1bfa Improvements 2025-03-03 15:32:15 +01:00
Carl Dybdahl
b3447959fa Match autoformatting, add QLDoc references 2025-03-03 15:32:15 +01:00
Carl Dybdahl
d371723fe4 Fix test 2025-03-03 15:32:15 +01:00
Carl Dybdahl
d82295c54a Add QLDoc 2025-03-03 15:32:15 +01:00
Carl Dybdahl
aa6779f19f Add changelog 2025-03-03 15:32:15 +01:00
Carl Dybdahl
35fd4d226f Oops 2025-03-03 15:32:15 +01:00
Carl Dybdahl
44e6691e6d Add implementation and tests 2025-03-03 15:32:15 +01:00
Simon Friis Vindum
1225c5c828 Rust: Accept changes 2025-03-03 09:44:24 +01:00
Simon Friis Vindum
d8d882958d Merge branch 'main' into rust-ref-mut 2025-03-03 09:19:08 +01:00
Jami Cogswell
b0b95965f6 Java: add change note 2025-03-02 17:13:37 -05:00
Jami Cogswell
fbf7513f37 Java: handle lock state check stored in variable 2025-03-02 17:01:18 -05:00
Simon Friis Vindum
bc651af319 Merge branch 'main' into rust-ref-mut 2025-02-28 11:42:06 +01:00
Simon Friis Vindum
518f164c61 Rust: Address PR comments 2025-02-28 10:49:27 +01:00
Simon Friis Vindum
476fef49da Rust: Allow SSA and some data flow for mutable borrows 2025-02-26 16:00:52 +01:00
Simon Friis Vindum
51ae7c6b8c Rust: Reorganize pointers tests and add additional tests 2025-02-26 13:51:55 +01:00
202 changed files with 1312 additions and 1029 deletions

View File

@@ -1,7 +1,3 @@
## 0.4.4
No user-facing changes.
## 0.4.3
### New Features

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.4.4
lastReleaseVersion: 0.4.3

View File

@@ -1,5 +1,5 @@
name: codeql/actions-all
version: 0.4.5-dev
version: 0.4.4-dev
library: true
warnOnImplicitThis: true
dependencies:

View File

@@ -1,12 +1,3 @@
## 0.5.1
### Bug Fixes
* The `actions/unversioned-immutable-action` query will no longer report any alerts, since the
Immutable Actions feature is not yet available for customer use. The query remains in the
default Code Scanning suites for use internal to GitHub. Once the Immutable Actions feature is
available, the query will be updated to report alerts again.
## 0.5.0
### Breaking Changes

View File

@@ -1,7 +1,6 @@
## 0.5.1
### Bug Fixes
---
category: fix
---
* The `actions/unversioned-immutable-action` query will no longer report any alerts, since the
Immutable Actions feature is not yet available for customer use. The query remains in the
default Code Scanning suites for use internal to GitHub. Once the Immutable Actions feature is

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.5.1
lastReleaseVersion: 0.5.0

View File

@@ -1,5 +1,5 @@
name: codeql/actions-queries
version: 0.5.2-dev
version: 0.5.1-dev
library: false
warnOnImplicitThis: true
groups: [actions, queries]

View File

@@ -1,10 +1,3 @@
## 4.0.2
### Minor Analysis Improvements
* Modified the `getBufferSize` predicate in `commons/Buffer.qll` to be more tolerant in some cases involving member variables in a larger struct or class.
* Fixed an issue where the `getBufferSize` predicate in `commons/Buffer.qll` was returning results for references inside `offsetof` expressions, which are not accesses to a buffer.
## 4.0.1
No user-facing changes.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Fixed an issue where the `getBufferSize` predicate in `commons/Buffer.qll` was returning results for references inside `offsetof` expressions, which are not accesses to a buffer.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Modified the `getBufferSize` predicate in `commons/Buffer.qll` to be more tolerant in some cases involving member variables in a larger struct or class.

View File

@@ -1,6 +0,0 @@
## 4.0.2
### Minor Analysis Improvements
* Modified the `getBufferSize` predicate in `commons/Buffer.qll` to be more tolerant in some cases involving member variables in a larger struct or class.
* Fixed an issue where the `getBufferSize` predicate in `commons/Buffer.qll` was returning results for references inside `offsetof` expressions, which are not accesses to a buffer.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 4.0.2
lastReleaseVersion: 4.0.1

View File

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

View File

@@ -1,10 +1,3 @@
## 1.3.5
### Minor Analysis Improvements
* Due to changes in libraries the query "Static array access may cause overflow" (`cpp/static-buffer-overflow`) will no longer report cases where multiple fields of a struct or class are written with a single `memset` or similar operation.
* The query "Call to memory access function may overflow buffer" (`cpp/overflow-buffer`) has been added to the security-extended query suite. The query detects a range of buffer overflow and underflow issues.
## 1.3.4
No user-facing changes.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The query "Call to memory access function may overflow buffer" (`cpp/overflow-buffer`) has been added to the security-extended query suite. The query detects a range of buffer overflow and underflow issues.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Due to changes in libraries the query "Static array access may cause overflow" (`cpp/static-buffer-overflow`) will no longer report cases where multiple fields of a struct or class are written with a single `memset` or similar operation.

View File

@@ -1,6 +0,0 @@
## 1.3.5
### Minor Analysis Improvements
* Due to changes in libraries the query "Static array access may cause overflow" (`cpp/static-buffer-overflow`) will no longer report cases where multiple fields of a struct or class are written with a single `memset` or similar operation.
* The query "Call to memory access function may overflow buffer" (`cpp/overflow-buffer`) has been added to the security-extended query suite. The query detects a range of buffer overflow and underflow issues.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.3.5
lastReleaseVersion: 1.3.4

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-queries
version: 1.3.6-dev
version: 1.3.5-dev
groups:
- cpp
- queries

View File

@@ -1,7 +1,3 @@
## 1.7.35
No user-facing changes.
## 1.7.34
No user-facing changes.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.35
lastReleaseVersion: 1.7.34

View File

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

View File

@@ -1,7 +1,3 @@
## 1.7.35
No user-facing changes.
## 1.7.34
No user-facing changes.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.35
lastReleaseVersion: 1.7.34

View File

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

View File

@@ -1,7 +1,3 @@
## 5.1.1
No user-facing changes.
## 5.1.0
### Deprecated APIs

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 5.1.1
lastReleaseVersion: 5.1.0

View File

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

View File

@@ -0,0 +1,18 @@
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p><code>Path.Combine</code> may silently drop its earlier arguments if its later arguments are absolute paths. E.g. <code>Path.Combine("C:\\Users\\Me\\Documents", "C:\\Program Files\\") == "C:\\Program Files"</code>.</p>
</overview>
<recommendation>
<p>Use <code>Path.Join</code> instead.</p>
</recommendation>
<references>
<li>Microsoft Learn, .NET API browser, <a href="https://learn.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=net-9.0">Path.Combine</a>.</li>
<li>Microsoft Learn, .NET API browser, <a href="https://learn.microsoft.com/en-us/dotnet/api/system.io.path.join?view=net-9.0">Path.Join</a>.</li>
</references>
</qhelp>

View File

@@ -0,0 +1,16 @@
/**
* @name Call to System.IO.Path.Combine
* @description Finds calls to System.IO.Path's Combine method
* @kind problem
* @problem.severity recommendation
* @precision very-high
* @id cs/path-combine
* @tags reliability
*/
import csharp
import semmle.code.csharp.frameworks.System
from MethodCall call
where call.getTarget().hasFullyQualifiedName("System.IO", "Path", "Combine")
select call, "Call to 'System.IO.Path.Combine'."

View File

@@ -1,9 +1,3 @@
## 1.0.18
### Minor Analysis Improvements
* C#: Improve precision of the query `cs/call-to-object-tostring` for value tuples.
## 1.0.17
No user-facing changes.

View File

@@ -1,5 +1,4 @@
## 1.0.18
### Minor Analysis Improvements
---
category: minorAnalysis
---
* C#: Improve precision of the query `cs/call-to-object-tostring` for value tuples.

View File

@@ -0,0 +1,4 @@
---
category: newQuery
---
* Added a new query, `csharp/path-combine`, to recommend against the `Path.Combine` method due to it silently discarding its earlier parameters if later parameters are rooted.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.0.18
lastReleaseVersion: 1.0.17

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-queries
version: 1.0.19-dev
version: 1.0.18-dev
groups:
- csharp
- queries

View File

@@ -0,0 +1,14 @@
using System.IO;
class PathCombine
{
void bad()
{
Path.Combine(@"C:\Users", @"C:\Program Files");
}
void good()
{
Path.Join(@"C:\Users", @"C:\Program Files");
}
}

View File

@@ -0,0 +1 @@
| PathCombine.cs:7:9:7:54 | call to method Combine | Call to 'System.IO.Path.Combine'. |

View File

@@ -0,0 +1 @@
Bad Practices/PathCombine.ql

View File

@@ -0,0 +1,2 @@
semmle-extractor-options: /nostdlib /noconfig
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj

View File

@@ -117,8 +117,8 @@ Java/Kotlin
* Deleted the deprecated :code:`isLValue` and :code:`isRValue` predicates from the :code:`VarAccess` class, use :code:`isVarWrite` and :code:`isVarRead` respectively instead.
* Deleted the deprecated :code:`getRhs` predicate from the :code:`VarWrite` class, use :code:`getASource` instead.
* Deleted the deprecated :code:`LValue` and :code:`RValue` classes, use :code:`VarWrite` and :code:`VarRead` respectively instead.
* Deleted a lot of deprecated classes ending in :code:`*Access`, use the corresponding :code:`*Call` classes instead.
* Deleted a lot of deprecated predicates ending in :code:`*Access`, use the corresponding :code:`*Call` predicates instead.
* Deleted a lot of deprecated classes ending in ``*Access``, use the corresponding ``*Call`` classes instead.
* Deleted a lot of deprecated predicates ending in ``*Access``, use the corresponding ``*Call`` predicates instead.
* Deleted the deprecated :code:`EnvInput` and :code:`DatabaseInput` classes from :code:`FlowSources.qll`, use the threat models feature instead.
* Deleted some deprecated API predicates from :code:`SensitiveApi.qll`, use the Sink classes from that file instead.
@@ -144,7 +144,7 @@ Ruby
* Deleted the deprecated :code:`ModelClass` and :code:`ModelInstance` classes from :code:`ActiveResource.qll`, use :code:`ModelClassNode` and :code:`ModelClassNode.getAnInstanceReference()` instead.
* Deleted the deprecated :code:`Collection` class from :code:`ActiveResource.qll`, use :code:`CollectionSource` instead.
* Deleted the deprecated :code:`ServiceInstantiation` and :code:`ClientInstantiation` classes from :code:`Twirp.qll`.
* Deleted a lot of deprecated dataflow modules from :code:`*Query.qll` files.
* Deleted a lot of deprecated dataflow modules from ``*Query.qll`` files.
* Deleted the old deprecated TypeTracking library.
Swift

View File

@@ -109,14 +109,6 @@ Python
* Fixed a bug in the extractor where a comment inside a subscript could sometimes cause the AST to be missing nodes.
* Using the :code:`break` and :code:`continue` keywords outside of a loop, which is a syntax error but is accepted by our parser, would cause the control-flow construction to fail. This is now no longer the case.
Major Analysis Improvements
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Golang
""""""
* Go 1.24 is now supported. This includes the new language feature of generic type aliases.
Minor Analysis Improvements
~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -1,120 +0,0 @@
.. _codeql-cli-2.20.6:
==========================
CodeQL 2.20.6 (2025-03-06)
==========================
.. contents:: Contents
:depth: 2
:local:
:backlinks: none
This is an overview of changes in the CodeQL CLI and relevant CodeQL query and library packs. For additional updates on changes to the CodeQL code scanning experience, check out the `code scanning section on the GitHub blog <https://github.blog/tag/code-scanning/>`__, `relevant GitHub Changelog updates <https://github.blog/changelog/label/code-scanning/>`__, `changes in the CodeQL extension for Visual Studio Code <https://marketplace.visualstudio.com/items/GitHub.vscode-codeql/changelog>`__, and the `CodeQL Action changelog <https://github.com/github/codeql-action/blob/main/CHANGELOG.md>`__.
Security Coverage
-----------------
CodeQL 2.20.6 runs a total of 450 security queries when configured with the Default suite (covering 168 CWE). The Extended suite enables an additional 137 queries (covering 35 more CWE). 1 security query has been added with this release.
CodeQL CLI
----------
Miscellaneous
~~~~~~~~~~~~~
* The CodeQL XML extractor is now able to parse documents in a wider array of character sets.
* The build of Eclipse Temurin OpenJDK that is used to run the CodeQL CLI has been updated to version 21.0.6.
Query Packs
-----------
Bug Fixes
~~~~~~~~~
GitHub Actions
""""""""""""""
* The :code:`actions/unversioned-immutable-action` query will no longer report any alerts, since the Immutable Actions feature is not yet available for customer use. The query remains in the default Code Scanning suites for use internal to GitHub. Once the Immutable Actions feature is available, the query will be updated to report alerts again.
Major Analysis Improvements
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Java/Kotlin
"""""""""""
* Fixed false positive alerts in the java query "Cross-site scripting" (:code:`java/xss`) when :code:`javax.servlet.http.HttpServletResponse` is used with a content type which is not exploitable.
JavaScript/TypeScript
"""""""""""""""""""""
* Improved precision of data flow through arrays, fixing some spurious flows that would sometimes cause the :code:`length` property of an array to be seen as tainted.
* Improved call resolution logic to better handle calls resolving "downwards", targeting a method declared in a subclass of the enclosing class. Data flow analysis has also improved to avoid spurious flow between unrelated classes in the class hierarchy.
Minor Analysis Improvements
~~~~~~~~~~~~~~~~~~~~~~~~~~~
C/C++
"""""
* Due to changes in libraries the query "Static array access may cause overflow" (:code:`cpp/static-buffer-overflow`) will no longer report cases where multiple fields of a struct or class are written with a single :code:`memset` or similar operation.
* The query "Call to memory access function may overflow buffer" (:code:`cpp/overflow-buffer`) has been added to the security-extended query suite. The query detects a range of buffer overflow and underflow issues.
C#
""
* C#: Improve precision of the query :code:`cs/call-to-object-tostring` for value tuples.
Language Libraries
------------------
Major Analysis Improvements
~~~~~~~~~~~~~~~~~~~~~~~~~~~
JavaScript/TypeScript
"""""""""""""""""""""
* Added support for the :code:`response` threat model kind, which can enabled with `advanced setup <https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models>`__. When enabled, the response data coming back from an outgoing HTTP request is considered a source of taint.
* Added support for the :code:`useQuery` hook from :code:`@tanstack/react-query`.
Minor Analysis Improvements
~~~~~~~~~~~~~~~~~~~~~~~~~~~
C/C++
"""""
* Modified the :code:`getBufferSize` predicate in :code:`commons/Buffer.qll` to be more tolerant in some cases involving member variables in a larger struct or class.
* Fixed an issue where the :code:`getBufferSize` predicate in :code:`commons/Buffer.qll` was returning results for references inside :code:`offsetof` expressions, which are not accesses to a buffer.
Golang
""""""
* The location info for the following classes has been changed slightly to match a location that is in the database: :code:`BasicBlock`, :code:`ControlFlow::EntryNode`, :code:`ControlFlow::ExitNode`, :code:`ControlFlow::ConditionGuardNode`, :code:`IR::ImplicitLiteralElementIndexInstruction`, :code:`IR::EvalImplicitTrueInstruction`, :code:`SsaImplicitDefinition`, :code:`SsaPhiNode`.
* Added :code:`database` source models for the :code:`github.com/rqlite/gorqlite` package.
* Added :code:`database` source models for database methods from the :code:`go.mongodb.org/mongo-driver/mongo` package.
Java/Kotlin
"""""""""""
* Added a path injection sanitizer for the :code:`child` argument of a :code:`java.io.File` constructor if that argument does not contain path traversal sequences.
JavaScript/TypeScript
"""""""""""""""""""""
* The :code:`response.download()` function in :code:`express` is now recognized as a sink for path traversal attacks.
Deprecated APIs
~~~~~~~~~~~~~~~
Golang
""""""
* The member predicate :code:`hasLocationInfo` has been deprecated on the following classes: :code:`BasicBlock`, :code:`Callable`, :code:`Content`, :code:`ContentSet`, :code:`ControlFlow::Node`, :code:`DataFlowCallable`, :code:`DataFlow::Node`, :code:`Entity`, :code:`GVN`, :code:`HtmlTemplate::TemplateStmt`, :code:`IR:WriteTarget`, :code:`SourceSinkInterpretationInput::SourceOrSinkElement`, :code:`SourceSinkInterpretationInput::InterpretNode`, :code:`SsaVariable`, :code:`SsaDefinition`, :code:`SsaWithFields`, :code:`StringOps::ConcatenationElement`, :code:`Type`, and :code:`VariableWithFields`. Use :code:`getLocation()` instead.
New Features
~~~~~~~~~~~~
Java/Kotlin
"""""""""""
* The Java extractor and QL libraries now support Java 24.

View File

@@ -11,7 +11,6 @@ A list of queries for each suite and language `is available here <https://docs.g
.. toctree::
:maxdepth: 1
codeql-cli-2.20.6
codeql-cli-2.20.5
codeql-cli-2.20.4
codeql-cli-2.20.3

View File

@@ -17,7 +17,7 @@
.NET 5, .NET 6, .NET 7, .NET 8, .NET 9","``.sln``, ``.csproj``, ``.cs``, ``.cshtml``, ``.xaml``"
Go (aka Golang), "Go up to 1.24", "Go 1.11 or more recent", ``.go``
Java,"Java 7 to 24 [5]_","javac (OpenJDK and Oracle JDK),
Java,"Java 7 to 22 [5]_","javac (OpenJDK and Oracle JDK),
Eclipse compiler for Java (ECJ) [6]_",``.java``
Kotlin,"Kotlin 1.5.0 to 2.1.2\ *x*","kotlinc",``.kt``

View File

@@ -307,8 +307,5 @@ func fileExists(path string) bool {
// and contains a `modules.txt` file.
func IsGolangVendorDirectory(dirPath string) bool {
return filepath.Base(dirPath) == "vendor" &&
(fileExists(filepath.Join(dirPath, "modules.txt")) ||
fileExists(filepath.Join(dirPath, "../glide.yaml")) ||
fileExists(filepath.Join(dirPath, "../Gopkg.lock")) ||
fileExists(filepath.Join(dirPath, "../vendor.conf")))
(fileExists(filepath.Join(dirPath, "modules.txt")) || fileExists(filepath.Join(dirPath, "../glide.yaml")))
}

View File

@@ -1,7 +1,3 @@
## 1.0.18
No user-facing changes.
## 1.0.17
No user-facing changes.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.0.18
lastReleaseVersion: 1.0.17

View File

@@ -1,5 +1,5 @@
name: codeql-go-consistency-queries
version: 1.0.19-dev
version: 1.0.18-dev
groups:
- go
- queries

View File

@@ -1,19 +1,3 @@
## 4.2.0
### Deprecated APIs
* The member predicate `hasLocationInfo` has been deprecated on the following classes: `BasicBlock`, `Callable`, `Content`, `ContentSet`, `ControlFlow::Node`, `DataFlowCallable`, `DataFlow::Node`, `Entity`, `GVN`, `HtmlTemplate::TemplateStmt`, `IR:WriteTarget`, `SourceSinkInterpretationInput::SourceOrSinkElement`, `SourceSinkInterpretationInput::InterpretNode`, `SsaVariable`, `SsaDefinition`, `SsaWithFields`, `StringOps::ConcatenationElement`, `Type`, and `VariableWithFields`. Use `getLocation()` instead.
### Major Analysis Improvements
* Go 1.24 is now supported. This includes the new language feature of generic type aliases.
### Minor Analysis Improvements
* The location info for the following classes has been changed slightly to match a location that is in the database: `BasicBlock`, `ControlFlow::EntryNode`, `ControlFlow::ExitNode`, `ControlFlow::ConditionGuardNode`, `IR::ImplicitLiteralElementIndexInstruction`, `IR::EvalImplicitTrueInstruction`, `SsaImplicitDefinition`, `SsaPhiNode`.
* Added `database` source models for the `github.com/rqlite/gorqlite` package.
* Added `database` source models for database methods from the `go.mongodb.org/mongo-driver/mongo` package.
## 4.1.0
### Deprecated APIs

View File

@@ -0,0 +1,5 @@
---
category: minorAnalysis
---
* Added `database` source models for database methods from the `go.mongodb.org/mongo-driver/mongo` package.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Added `database` source models for the `github.com/rqlite/gorqlite` package.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The location info for the following classes has been changed slightly to match a location that is in the database: `BasicBlock`, `ControlFlow::EntryNode`, `ControlFlow::ExitNode`, `ControlFlow::ConditionGuardNode`, `IR::ImplicitLiteralElementIndexInstruction`, `IR::EvalImplicitTrueInstruction`, `SsaImplicitDefinition`, `SsaPhiNode`.

View File

@@ -0,0 +1,4 @@
---
category: majorAnalysis
---
* Go 1.24 is now supported. This includes the new language feature of generic type aliases.

View File

@@ -0,0 +1,4 @@
---
category: deprecated
---
* The member predicate `hasLocationInfo` has been deprecated on the following classes: `BasicBlock`, `Callable`, `Content`, `ContentSet`, `ControlFlow::Node`, `DataFlowCallable`, `DataFlow::Node`, `Entity`, `GVN`, `HtmlTemplate::TemplateStmt`, `IR:WriteTarget`, `SourceSinkInterpretationInput::SourceOrSinkElement`, `SourceSinkInterpretationInput::InterpretNode`, `SsaVariable`, `SsaDefinition`, `SsaWithFields`, `StringOps::ConcatenationElement`, `Type`, and `VariableWithFields`. Use `getLocation()` instead.

View File

@@ -1,15 +0,0 @@
## 4.2.0
### Deprecated APIs
* The member predicate `hasLocationInfo` has been deprecated on the following classes: `BasicBlock`, `Callable`, `Content`, `ContentSet`, `ControlFlow::Node`, `DataFlowCallable`, `DataFlow::Node`, `Entity`, `GVN`, `HtmlTemplate::TemplateStmt`, `IR:WriteTarget`, `SourceSinkInterpretationInput::SourceOrSinkElement`, `SourceSinkInterpretationInput::InterpretNode`, `SsaVariable`, `SsaDefinition`, `SsaWithFields`, `StringOps::ConcatenationElement`, `Type`, and `VariableWithFields`. Use `getLocation()` instead.
### Major Analysis Improvements
* Go 1.24 is now supported. This includes the new language feature of generic type aliases.
### Minor Analysis Improvements
* The location info for the following classes has been changed slightly to match a location that is in the database: `BasicBlock`, `ControlFlow::EntryNode`, `ControlFlow::ExitNode`, `ControlFlow::ConditionGuardNode`, `IR::ImplicitLiteralElementIndexInstruction`, `IR::EvalImplicitTrueInstruction`, `SsaImplicitDefinition`, `SsaPhiNode`.
* Added `database` source models for the `github.com/rqlite/gorqlite` package.
* Added `database` source models for database methods from the `go.mongodb.org/mongo-driver/mongo` package.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 4.2.0
lastReleaseVersion: 4.1.0

View File

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

View File

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

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.1.9
lastReleaseVersion: 1.1.8

View File

@@ -1,5 +1,5 @@
name: codeql/go-queries
version: 1.1.10-dev
version: 1.1.9-dev
groups:
- go
- queries

View File

@@ -1,13 +1,3 @@
## 7.1.0
### New Features
* The Java extractor and QL libraries now support Java 24.
### Minor Analysis Improvements
* Added a path injection sanitizer for the `child` argument of a `java.io.File` constructor if that argument does not contain path traversal sequences.
## 7.0.1
No user-facing changes.

View File

@@ -1,9 +1,4 @@
## 7.1.0
### New Features
* The Java extractor and QL libraries now support Java 24.
### Minor Analysis Improvements
---
category: minorAnalysis
---
* Added a path injection sanitizer for the `child` argument of a `java.io.File` constructor if that argument does not contain path traversal sequences.

View File

@@ -0,0 +1,4 @@
---
category: feature
---
* The Java extractor and QL libraries now support Java 24.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 7.1.0
lastReleaseVersion: 7.0.1

View File

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

View File

@@ -1,9 +1,3 @@
## 1.3.0
### Major Analysis Improvements
* Fixed false positive alerts in the java query "Cross-site scripting" (`java/xss`) when `javax.servlet.http.HttpServletResponse` is used with a content type which is not exploitable.
## 1.2.0
### New Queries

View File

@@ -118,6 +118,26 @@ predicate heldByCurrentThreadCheck(LockType t, BasicBlock checkblock, BasicBlock
)
}
/**
* Holds if there is a variable access in `checkblock` that has `falsesucc` as the false successor.
*
* The variable access must have an assigned value that is a lock access on `t`, and
* the true successor of `checkblock` must contain an unlock access.
*/
predicate variableLockStateCheck(LockType t, BasicBlock checkblock, BasicBlock falsesucc) {
exists(ConditionBlock conditionBlock, VarAccess v |
v.getType() instanceof BooleanType and
// Ensure that a lock access is assigned to the variable
v.getVariable().getAnAssignedValue() = t.getLockAccess() and
// Ensure that the `true` successor of the condition block contains an unlock access
conditionBlock.getTestSuccessor(true) = t.getUnlockAccess().getBasicBlock() and
conditionBlock.getCondition() = v
|
conditionBlock.getBasicBlock() = checkblock and
conditionBlock.getTestSuccessor(false) = falsesucc
)
}
/**
* A control flow path from a locking call in `src` to `b` such that the number of
* locks minus the number of unlocks along the way is positive and equal to `locks`.
@@ -131,8 +151,9 @@ predicate blockIsLocked(LockType t, BasicBlock src, BasicBlock b, int locks) {
// The number of net locks from the `src` block to the predecessor block `pred` is `predlocks`.
blockIsLocked(t, src, pred, predlocks) and
// The recursive call ensures that at least one lock is held, so do not consider the false
// successor of the `isHeldByCurrentThread()` check.
// successor of the `isHeldByCurrentThread()` check or of `variableLockStateCheck`.
not heldByCurrentThreadCheck(t, pred, b) and
not variableLockStateCheck(t, pred, b) and
// Count a failed lock as an unlock so the net is zero.
(if failedLock(t, pred, b) then failedlock = 1 else failedlock = 0) and
(

View File

@@ -1,5 +1,4 @@
## 1.3.0
### Major Analysis Improvements
---
category: majorAnalysis
---
* Fixed false positive alerts in the java query "Cross-site scripting" (`java/xss`) when `javax.servlet.http.HttpServletResponse` is used with a content type which is not exploitable.

View File

@@ -0,0 +1,4 @@
---
category: majorAnalysis
---
* Updated the `java/unreleased-lock` query so that it no longer report alerts in cases where a boolean variable is used to track lock state.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.3.0
lastReleaseVersion: 1.2.0

View File

@@ -1,5 +1,5 @@
name: codeql/java-queries
version: 1.3.1-dev
version: 1.2.1-dev
groups:
- java
- queries

View File

@@ -3,3 +3,4 @@
| UnreleasedLock.java:40:3:40:15 | lock(...) | This lock might not be unlocked or might be locked more times than it is unlocked. |
| UnreleasedLock.java:50:3:50:15 | lock(...) | This lock might not be unlocked or might be locked more times than it is unlocked. |
| UnreleasedLock.java:72:8:72:23 | tryLock(...) | This lock might not be unlocked or might be locked more times than it is unlocked. |
| UnreleasedLock.java:114:13:114:28 | tryLock(...) | This lock might not be unlocked or might be locked more times than it is unlocked. |

View File

@@ -5,18 +5,18 @@ class Test {
void unlock() { }
boolean isHeldByCurrentThread() { return true; }
}
void f() throws RuntimeException { }
void g() throws RuntimeException { }
MyLock mylock = new MyLock();
void bad1() {
mylock.lock();
f();
mylock.unlock();
}
void good2() {
mylock.lock();
try {
@@ -25,7 +25,7 @@ class Test {
mylock.unlock();
}
}
void bad3() {
mylock.lock();
f();
@@ -35,7 +35,7 @@ class Test {
mylock.unlock();
}
}
void bad4() {
mylock.lock();
try {
@@ -45,7 +45,7 @@ class Test {
mylock.unlock();
}
}
void bad5(boolean lockmore) {
mylock.lock();
try {
@@ -58,7 +58,7 @@ class Test {
mylock.unlock();
}
}
void good6() {
if (!mylock.tryLock()) { return; }
try {
@@ -67,7 +67,7 @@ class Test {
mylock.unlock();
}
}
void bad7() {
if (!mylock.tryLock()) { return; }
f();
@@ -95,4 +95,29 @@ class Test {
mylock.unlock();
}
}
void good9() {
boolean locked = false;
try {
locked = mylock.tryLock();
if (!locked) { return; }
} finally {
if (locked) {
mylock.unlock();
}
}
}
void bad10() {
boolean locked = false;
try {
locked = mylock.tryLock();
if (!locked) { return; }
} finally {
if (locked) {
g();
mylock.unlock();
}
}
}
}

View File

@@ -1,14 +1,3 @@
## 2.5.0
### Major Analysis Improvements
* Added support for the `response` threat model kind, which can enabled with [advanced setup](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models). When enabled, the response data coming back from an outgoing HTTP request is considered a source of taint.
* Added support for the `useQuery` hook from `@tanstack/react-query`.
### Minor Analysis Improvements
* The `response.download()` function in `express` is now recognized as a sink for path traversal attacks.
## 2.4.1
### Minor Analysis Improvements

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `response.download()` function in `express` is now recognized as a sink for path traversal attacks.

View File

@@ -1,10 +1,6 @@
## 2.5.0
### Major Analysis Improvements
---
category: majorAnalysis
---
---
* Added support for the `response` threat model kind, which can enabled with [advanced setup](https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-threat-models). When enabled, the response data coming back from an outgoing HTTP request is considered a source of taint.
* Added support for the `useQuery` hook from `@tanstack/react-query`.
### Minor Analysis Improvements
* The `response.download()` function in `express` is now recognized as a sink for path traversal attacks.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 2.5.0
lastReleaseVersion: 2.4.1

View File

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

View File

@@ -1,13 +1,3 @@
## 1.5.0
### Major Analysis Improvements
* Improved precision of data flow through arrays, fixing some spurious flows
that would sometimes cause the `length` property of an array to be seen as tainted.
* Improved call resolution logic to better handle calls resolving "downwards", targeting
a method declared in a subclass of the enclosing class. Data flow analysis
has also improved to avoid spurious flow between unrelated classes in the class hierarchy.
## 1.4.1
### Bug Fixes

View File

@@ -1,9 +1,6 @@
## 1.5.0
### Major Analysis Improvements
* Improved precision of data flow through arrays, fixing some spurious flows
that would sometimes cause the `length` property of an array to be seen as tainted.
---
category: majorAnalysis
---
* Improved call resolution logic to better handle calls resolving "downwards", targeting
a method declared in a subclass of the enclosing class. Data flow analysis
has also improved to avoid spurious flow between unrelated classes in the class hierarchy.

View File

@@ -0,0 +1,5 @@
---
category: majorAnalysis
---
* Improved precision of data flow through arrays, fixing some spurious flows
that would sometimes cause the `length` property of an array to be seen as tainted.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.5.0
lastReleaseVersion: 1.4.1

View File

@@ -1,5 +1,5 @@
name: codeql/javascript-queries
version: 1.5.1-dev
version: 1.4.2-dev
groups:
- javascript
- queries

View File

@@ -1,7 +1,3 @@
## 1.0.18
No user-facing changes.
## 1.0.17
No user-facing changes.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.0.18
lastReleaseVersion: 1.0.17

View File

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

View File

@@ -1,7 +1,3 @@
## 4.0.2
No user-facing changes.
## 4.0.1
### Bug Fixes

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 4.0.2
lastReleaseVersion: 4.0.1

View File

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

View File

@@ -1,7 +1,3 @@
## 1.4.4
No user-facing changes.
## 1.4.3
No user-facing changes.

View File

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

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.4.4
lastReleaseVersion: 1.4.3

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