Skip to content

Commit 67eea44

Browse files
author
james
committed
Merge branch 'rc/1.23' into jf-mergeback-123
2 parents a3efcf6 + ad2da41 commit 67eea44

File tree

8 files changed

+29
-26
lines changed

8 files changed

+29
-26
lines changed

change-notes/1.23/analysis-csharp.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@ The following changes in version 1.23 affect C# analysis in all applications.
66

77
| **Query** | **Tags** | **Purpose** |
88
|-----------------------------|-----------|--------------------------------------------------------------------|
9-
| Deserialized delegate (`cs/deserialized-delegate`) | security, external/cwe/cwe-502 | Finds unsafe deserialization of delegate types. |
10-
| Deserialization of untrusted data (`cs/unsafe-deserialization-untrusted-input`) | security, external/cwe/cwe-502 | Finds flow of untrusted input to calls to unsafe deserializers. |
11-
| Unsafe year argument for 'DateTime' constructor (`cs/unsafe-year-construction`) | reliability, date-time | Finds incorrect manipulation of `DateTime` values, which could lead to invalid dates. |
12-
| Unsafe deserializer (`cs/unsafe-deserialization`) | security, external/cwe/cwe-502 | Finds calls to unsafe deserializers. |
13-
| Mishandling the Japanese era start date (`cs/mishandling-japanese-era`) | reliability, date-time | Finds hard-coded Japanese era start dates that could be invalid. |
9+
| Deserialized delegate (`cs/deserialized-delegate`) | security, external/cwe/cwe-502 | Finds unsafe deserialization of delegate types. Results are shown on LGTM by default. |
10+
| Deserialization of untrusted data (`cs/unsafe-deserialization-untrusted-input`) | security, external/cwe/cwe-502 | Finds flow of untrusted input to calls to unsafe deserializers. Results are shown on LGTM by default. |
11+
| Mishandling the Japanese era start date (`cs/mishandling-japanese-era`) | reliability, date-time | Finds hard-coded Japanese era start dates that could be invalid. Results are not shown on LGTM by default. |
12+
| Unsafe year argument for 'DateTime' constructor (`cs/unsafe-year-construction`) | reliability, date-time | Finds incorrect manipulation of `DateTime` values, which could lead to invalid dates. Results are not shown on LGTM by default. |
13+
| Unsafe deserializer (`cs/unsafe-deserialization`) | security, external/cwe/cwe-502 | Finds calls to unsafe deserializers. By default, the query is not run on LGTM. |
1414

1515
## Changes to existing queries
1616

1717
| **Query** | **Expected impact** | **Change** |
1818
|------------------------------|------------------------|-----------------------------------|
1919
| Dereferenced variable may be null (`cs/dereferenced-value-may-be-null`) | Fewer false positive results | More `null` checks are now taken into account, including `null` checks for `dynamic` expressions and `null` checks such as `object alwaysNull = null; if (x != alwaysNull) ...`. |
20-
| Missing Dispose call on local IDisposable (`cs/local-not-disposed`) | Fewer false positive results | The query has been rewritten in order to identify more dispose patterns. For example, a local `IDisposable` that is disposed of by passing through a fluent API is no longer reported. |
21-
22-
## Removal of old queries
20+
| Missing Dispose call on local IDisposable (`cs/local-not-disposed`) | Fewer false positive results | The query has been rewritten in order to identify more dispose patterns. For example, a local `IDisposable` that is disposed of by passing through a fluent API is no longer reported as missing a dispose call. |
2321

2422
## Changes to code extraction
2523

@@ -29,22 +27,19 @@ The following changes in version 1.23 affect C# analysis in all applications.
2927

3028
* The new class `NamespaceAccess` models accesses to namespaces, for example in `nameof` expressions.
3129
* The data-flow library now makes it easier to specify barriers/sanitizers
32-
arising from guards by overriding the predicate
30+
arising from guards. You can override the predicate
3331
`isBarrierGuard`/`isSanitizerGuard` on data-flow and taint-tracking
3432
configurations respectively.
3533
* The data-flow library has been extended with a new feature to aid debugging.
36-
Instead of specifying `isSink(Node n) { any() }` on a configuration to
37-
explore the possible flow from a source, it is recommended to use the new
38-
`Configuration::hasPartialFlow` predicate, as this gives a more complete
39-
picture of the partial flow paths from a given source. The feature is
40-
disabled by default and can be enabled for individual configurations by
34+
Previously, to explore the possible flow from all sources you could specify `isSink(Node n) { any() }` on a configuration.
35+
Now you can use the new `Configuration::hasPartialFlow` predicate,
36+
which gives a more complete picture of the partial flow paths from a given source, including flow that doesn't reach any sink.
37+
The feature is disabled by default and can be enabled for individual configurations by
4138
overriding `int explorationLimit()`.
42-
* `foreach` statements where the body is guaranteed to be executed at least once, such as `foreach (var x in new string[]{ "a", "b", "c" }) { ... }`, are now recognized by all analyses based on the control flow graph (such as SSA, data flow and taint tracking).
43-
* Fixed the control flow graph for `switch` statements where the `default` case was not the last case. This had caused the remaining cases to be unreachable. `SwitchStmt.getCase(int i)` now puts the `default` case last.
39+
* `foreach` statements where the body is guaranteed to be executed at least once, such as `foreach (var x in new string[]{ "a", "b", "c" }) { ... }`, are now recognized by all analyses based on the control-flow graph (such as SSA, data flow and taint tracking).
40+
* Fixed the control-flow graph for `switch` statements where the `default` case was not the last case. This had caused the remaining cases to be unreachable. `SwitchStmt.getCase(int i)` now puts the `default` case last.
4441
* There is now a `DataFlow::localExprFlow` predicate and a
4542
`TaintTracking::localExprTaint` predicate to make it easy to use the most
4643
common case of local data flow and taint: from one `Expr` to another.
4744
* Data is now tracked through null-coalescing expressions (`??`).
4845
* A new library `semmle.code.csharp.Unification` has been added. This library exposes two predicates `unifiable` and `subsumes` for calculating type unification and type subsumption, respectively.
49-
50-
## Changes to autobuilder
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as IR
2-
import semmle.code.cpp.ir.implementation.unaliased_ssa.constant.ConstantAnalysis as ConstantAnalysis
1+
import semmle.code.csharp.ir.implementation.unaliased_ssa.IR as IR
2+
import semmle.code.csharp.ir.implementation.unaliased_ssa.constant.ConstantAnalysis as ConstantAnalysis

csharp/ql/src/semmle/code/csharp/ir/internal/TIRVariable.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ newtype TIRVariable =
99
Construction::functionHasIR(callable) and
1010
var.getCallable() = callable
1111
} or
12-
TIRTempVariable(Callable callable, Language::AST ast, TempVariableTag tag, Type type) {
12+
TIRTempVariable(
13+
Callable callable, Language::AST ast, TempVariableTag tag, Language::LanguageType type
14+
) {
1315
Construction::hasTempVariable(callable, ast, tag, type)
1416
}

docs/language/learn-ql/cobol/introduce-libraries-cobol.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,3 @@ What next?
149149
----------
150150

151151
- Find out more about QL in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__ and `QL language specification <https://help.semmle.com/QL/ql-spec/language.html>`__.
152-
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__.

docs/language/learn-ql/cobol/ql-for-cobol.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ CodeQL for COBOL
66
:hidden:
77

88
introduce-libraries-cobol
9-
9+
10+
.. include:: ../../support/cobol-note.rst
11+
1012
This page provides an overview of the CodeQL for COBOL documentation that is currently available.
1113

12-
- `Basic COBOL query <https://lgtm.com/help/lgtm/console/ql-cobol-basic-example>`__ describes how to write and run queries using LGTM.
1314
- :doc:`Introducing the CodeQL libraries for COBOL <introduce-libraries-cobol>` introduces the standard libraries used to write queries for COBOL code.
1415

1516

1617
Other resources
1718
---------------
1819

19-
- For the queries used in LGTM, display a `COBOL query <https://lgtm.com/search?q=language%3Acobol&t=rules>`__ and click **Open in query console** to see the code used to find alerts.
2020
- For more information about the library for COBOL see the `CodeQL library for COBOL <https://help.semmle.com/qldoc/cobol/>`__.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. pull-quote:: Important
2+
3+
CodeQL for COBOL is being deprecated after the 1.23 release of CodeQL.
4+
Future releases, starting with 1.24, will no longer contain support for analyzing COBOL source code.
5+
We are not aware of any customers who will be affected by this change. If you do have any concerns, please contact your account manager.

docs/language/support/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@
8080

8181
# List of patterns, relative to source directory, that match files and
8282
# directories to ignore when looking for source files.
83-
exclude_patterns = ['read-me-project.rst']
83+
exclude_patterns = ['read-me-project.rst', 'cobol-note.rst']

docs/language/support/language-support.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Customers with any questions should contact their usual Semmle contact with any
1010
If you're not a customer yet, contact us at info@semmle.com
1111
with any questions you have about language and compiler support.
1212

13+
.. include:: cobol-note.rst
14+
1315
.. csv-table::
1416
:file: versions-compilers.csv
1517
:header-rows: 1

0 commit comments

Comments
 (0)