Skip to content

Commit e5dc14a

Browse files
authored
Merge pull request github#3271 from jbj/1.24-change-note
C++: Tidy up 1.24 change notes
2 parents 6eba338 + 7dab89e commit e5dc14a

File tree

1 file changed

+37
-15
lines changed

1 file changed

+37
-15
lines changed

change-notes/1.24/analysis-cpp.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,46 @@ The following changes in version 1.24 affect C/C++ analysis in all applications.
2424
| No space for zero terminator (`cpp/no-space-for-terminator`) | More correct results | String arguments to formatting functions are now (usually) expected to be null terminated strings. |
2525
| Hard-coded Japanese era start date (`cpp/japanese-era/exact-era-date`) | | This query is no longer run on LGTM. |
2626
| No space for zero terminator (`cpp/no-space-for-terminator`) | Fewer false positive results | This query has been modified to be more conservative when identifying which pointers point to null-terminated strings. This approach produces fewer, more accurate results. |
27-
| Overflow in uncontrolled allocation size (`cpp/uncontrolled-allocation-size`) | Fewer false positive results | Cases where the tainted allocation size is range checked are now more reliably excluded. |
28-
| Overflow in uncontrolled allocation size (`cpp/uncontrolled-allocation-size`) | Fewer false positive results | The query now produces fewer, more accurate results. |
27+
| Overflow in uncontrolled allocation size (`cpp/uncontrolled-allocation-size`) | Fewer false positive results | The query now produces fewer, more accurate results. Cases where the tainted allocation size is range checked are more reliably excluded. |
2928
| Overloaded assignment does not return 'this' (`cpp/assignment-does-not-return-this`) | Fewer false positive results | This query no longer reports incorrect results in template classes. |
3029
| Unsafe array for days of the year (`cpp/leap-year/unsafe-array-for-days-of-the-year`) | | This query is no longer run on LGTM. |
30+
| Boost\_asio TLS Settings Misconfiguration (`cpp/boost/tls-settings-misconfiguration`) | Query id change | Query id renamed from `cpp/boost/tls_settings_misconfiguration` (underscores to dashes) |
3131
| Unsigned comparison to zero (`cpp/unsigned-comparison-zero`) | More correct results | This query now also looks for comparisons of the form `0 <= x`. |
32+
| Signed overflow check (`cpp/signed-overflow-check`), Pointer overflow check (`cpp/pointer-overflow-check`), Possibly wrong buffer size in string copy (`cpp/bad-strncpy-size`) | More correct results | A new library is used for determining which expressions have identical value, giving more precise results. There is a performance cost to this, and the LGTM suite will overall run slower than before. |
33+
| All CWE-specific queries using taint tracking (`cpp/path-injection`, `cpp/cgi-xss`, `cpp/sql-injection`, `cpp/uncontrolled-process-operation`, `cpp/unbounded-write`, `cpp/tainted-format-string`, `cpp/tainted-format-string-through-global`, `cpp/uncontrolled-arithmetic`, `cpp/uncontrolled-allocation-size`, `cpp/user-controlled-bypass`, `cpp/cleartext-storage-buffer`, `cpp/tainted-permissions-check`) | More correct results | A new taint-tracking library is used, giving more precise results and offering _path explanations_ for results. There is a performance cost to this, and the LGTM suite will overall run slower than before. |
34+
3235

3336
## Changes to libraries
3437

35-
* The data-flow library has been improved, which affects and improves some security queries. The improvements are:
38+
* The built-in C++20 "spaceship operator" (`<=>`) is now supported via the QL
39+
class `SpaceshipExpr`. Overloaded forms are modeled as calls to functions
40+
named `operator<=>`.
41+
* The data-flow library (`semmle.code.cpp.dataflow.DataFlow` and
42+
`semmle.code.cpp.dataflow.TaintTracking`) has been improved, which affects
43+
and improves some security queries. The improvements are:
3644
- Track flow through functions that combine taint tracking with flow through fields.
3745
- Track flow through clone-like functions, that is, functions that read contents of a field from a
3846
parameter and stores the value in the field of a returned object.
39-
* Created the `semmle.code.cpp.models.interfaces.Allocation` library to model allocation such as `new` expressions and calls to `malloc`. This in intended to replace the functionality in `semmle.code.cpp.commons.Alloc` with a more consistent and useful interface.
40-
* Created the `semmle.code.cpp.models.interfaces.Deallocation` library to model deallocation such as `delete` expressions and calls to `free`. This in intended to replace the functionality in `semmle.code.cpp.commons.Alloc` with a more consistent and useful interface.
47+
* The security pack taint tracking library
48+
(`semmle.code.cpp.security.TaintTracking`) uses a new intermediate
49+
representation. This provides a more precise analysis of flow through
50+
parameters and pointers. For new queries, however, we continue to recommend
51+
using `semmle.code.cpp.dataflow.TaintTracking`.
52+
* The global value numbering library
53+
(`semmle.code.cpp.valuenumbering.GlobalValueNumbering`) uses a new
54+
intermediate representation to provide a more precise analysis of
55+
heap-allocated memory and pointers to stack variables.
56+
* Created the `semmle.code.cpp.models.interfaces.Allocation` library to model
57+
allocation such as `new` expressions and calls to `malloc`. This in intended
58+
to replace the functionality in `semmle.code.cpp.commons.Alloc` with a more
59+
consistent and useful interface.
60+
* The predicate `freeCall` in `semmle.code.cpp.commons.Alloc` has been
61+
deprecated. The`Allocation` and `Deallocation` models in
62+
`semmle.code.cpp.models.interfaces` should be used instead.
63+
* Created the `semmle.code.cpp.models.interfaces.Deallocation` library to
64+
model deallocation such as `delete` expressions and calls to `free`. This
65+
in intended to replace the functionality in `semmle.code.cpp.commons.Alloc`
66+
with a more consistent and useful interface.
4167
* The new class `StackVariable` should be used in place of `LocalScopeVariable`
4268
in most cases. The difference is that `StackVariable` does not include
4369
variables declared with `static` or `thread_local`.
@@ -46,13 +72,9 @@ The following changes in version 1.24 affect C/C++ analysis in all applications.
4672
about the _name or scope_ of variables should remain unchanged.
4773
* The `LocalScopeVariableReachability` library is deprecated in favor of
4874
`StackVariableReachability`. The functionality is the same.
49-
* The models library models `strlen` in more detail, and includes common variations such as `wcslen`.
50-
* The models library models `gets` and similar functions.
51-
* The models library now partially models `std::string`.
52-
* The taint tracking library (`semmle.code.cpp.dataflow.TaintTracking`) has had
53-
the following improvements:
54-
* The library now models data flow through `strdup` and similar functions.
55-
* The library now models data flow through formatting functions such as `sprintf`.
56-
* The security pack taint tracking library (`semmle.code.cpp.security.TaintTracking`) uses a new intermediate representation. This provides a more precise analysis of pointers to stack variables and flow through parameters, improving the results of many security queries.
57-
* The global value numbering library (`semmle.code.cpp.valuenumbering.GlobalValueNumbering`) uses a new intermediate representation to provide a more precise analysis of heap allocated memory and pointers to stack variables.
58-
* `freeCall` in `semmle.code.cpp.commons.Alloc` has been deprecated. The`Allocation` and `Deallocation` models in `semmle.code.cpp.models.interfaces` should be used instead.
75+
* Taint tracking and data flow now features better modeling of commonly-used
76+
library functions:
77+
* `gets` and similar functions,
78+
* the most common operations on `std::string`,
79+
* `strdup` and similar functions, and
80+
* formatting functions such as `sprintf`.

0 commit comments

Comments
 (0)