Compare commits

..

1548 Commits

Author SHA1 Message Date
Alex Ford
2aba24da0c Merge pull request #12831 from github/release-prep/2.13.0
Release preparation for version 2.13.0
2023-04-14 14:59:39 +01:00
Jeroen Ketema
0c7346707b Fix minor issues with change notes 2023-04-14 15:37:04 +02:00
github-actions[bot]
075d063370 Release preparation for version 2.13.0 2023-04-14 13:31:30 +00:00
Alex Ford
9169ddb9c1 Merge pull request #12823 from alexet/alexet/bump-version
Bump all qlpacks major versions
2023-04-14 12:18:27 +01:00
Mathias Vorreiter Pedersen
15d5ad7a66 Merge pull request #12822 from MathiasVP/promote-redundant-null-check-simple
C++: Promote `cpp/redundant-null-check-simple` to Code Scanning
2023-04-13 22:01:28 +01:00
Geoffrey White
3f8ac1a12b Merge pull request #12794 from geoffw0/modernsec2
Swift: Add CSV extension points to the encryption queries.
2023-04-13 19:43:05 +01:00
Alex Eyers-Taylor
c6a482819a Bump all qlpacks major versions 2023-04-13 19:15:27 +01:00
Mathias Vorreiter Pedersen
b7bbdb76ba Update cpp/ql/src/Likely Bugs/RedundantNullCheckSimple.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-04-13 18:42:12 +01:00
Geoffrey White
8c415f3988 Swift: getName() -> getFullName(). 2023-04-13 17:56:07 +01:00
Mathias Vorreiter Pedersen
f1a7b1a853 C++: Add change note. 2023-04-13 17:35:28 +01:00
Mathias Vorreiter Pedersen
c230de86b4 C++: Accept test changes. 2023-04-13 17:28:07 +01:00
Mathias Vorreiter Pedersen
b8d2896d5d C++: Convert 'cpp/redundant-null-check-simple' to a path-problem query and assigned it precision high. 2023-04-13 17:28:07 +01:00
Jami
0442072a59 Merge pull request #12820 from jcogs33/jcogs33/update-hq-manual-provenance
Java: update provenance of `Connection#nativeSQL` sink to "hq-manual"
2023-04-13 11:59:39 -04:00
Edward Minnix III
aeff6d3b85 Merge pull request #12808 from egregius313/egregius313/java/dataflow/refactor-experimental
Java: Refactor experimental queries to new DataFlow API
2023-04-13 10:58:34 -04:00
Jami Cogswell
108b7a38aa Java: update provenance to hq-manual 2023-04-13 10:24:24 -04:00
Michael Nebel
52bc43b22b Merge pull request #12595 from michaelnebel/enhanceprovenance
Java/C# : Enhance provenance.
2023-04-13 14:27:53 +02:00
Alex Ford
8c46bfd051 Merge pull request #12816 from github/rc/3.9
Merge `rc/3.9` into `main`
2023-04-13 12:35:41 +01:00
Tony Torralba
4c6df3fdb9 Merge pull request #12813 from atorralba/atorralba/java/sensitive-expr-fix-and-tests
Java: Add tests for SensitiveActions and fix getCommonSensitiveInfoRegex
2023-04-13 13:13:37 +02:00
Taus
6968de2ccc Merge pull request #12796 from github/tausbn/python-clarify-version-data
Python: Clarify version data
2023-04-13 13:05:10 +02:00
Michael Nebel
72e0235718 Merge pull request #12723 from michaelnebel/csharp/refactordataflow2
C#: Re-factor queries to use the new API.
2023-04-13 12:32:22 +02:00
Tony Torralba
7d0680a280 Update JsonpInjection test expectations 2023-04-13 12:06:54 +02:00
Tony Torralba
d7feaf4098 Merge pull request #12685 from atorralba/atorralba/java/command-injection-mad
Java: Add command-injection sink kind and refactor command injection queries
2023-04-13 11:38:14 +02:00
Michael Nebel
2d2d32a3f6 Merge pull request #12732 from michaelnebel/csharp/refactorunittests
C#: Re-factor data flow unit tests to use the new API.
2023-04-13 11:30:44 +02:00
Henry Mercer
afd577ca9d Merge pull request #12814 from github/henrymercer/remove-legacy-atm-checks
ATM: Remove legacy model integration PR checks
2023-04-13 10:17:28 +01:00
Tony Torralba
4f2ffccc20 Improve change note 2023-04-13 11:14:57 +02:00
Henry Mercer
94f996f23f ATM: Remove legacy model integration PR checks 2023-04-13 10:00:52 +01:00
Tony Torralba
99b0624e8b Add change note 2023-04-13 10:35:59 +02:00
Tony Torralba
485709a133 Fix getCommonSensitiveInfoRegex 2023-04-13 10:33:03 +02:00
Tony Torralba
84971c8687 Add SensitiveActions tests 2023-04-13 10:32:23 +02:00
Erik Krogh Kristensen
9853241425 Merge pull request #12810 from asgerf/ql/missing-noinline-cached
QL: Don't warn about cached predicates possibly being inlined
2023-04-13 10:16:15 +02:00
Michael Nebel
3a316f17cc C#: Re-factor SqlInjection to use the new API. 2023-04-13 10:08:40 +02:00
Michael Nebel
60a0917ced C#: Re-factor ResourceInjection to use the new API. 2023-04-13 10:08:40 +02:00
Michael Nebel
80e8b6928d C#: Re-factor RegexInjection to use the new API. 2023-04-13 10:08:40 +02:00
Michael Nebel
377b2d7515 C#: Re-factor ReDoS to use the new API. 2023-04-13 10:08:40 +02:00
Michael Nebel
8d17a45dd0 C#: Re-factor MissingXmlValidation to use the new API. 2023-04-13 10:08:40 +02:00
Michael Nebel
8e3bfda7be C#: Re-factor LogForging to use the new API. 2023-04-13 10:08:40 +02:00
Michael Nebel
8284487407 C#: Explicitly add QL Doc for the LdapInjectionConfig predicates. 2023-04-13 10:08:40 +02:00
Michael Nebel
73cd7519a2 C#: Re-factor LdapInjection to use the new API. 2023-04-13 10:08:40 +02:00
Michael Nebel
91150af11e C#: Re-factor HardcodedConnectionString to use the new API. 2023-04-13 10:08:39 +02:00
Michael Nebel
3bda0b9e8c C#: Re-factor HardcodedCredentials to use the new API. 2023-04-13 10:08:39 +02:00
Michael Nebel
d94b11b001 C#: Re-factor ExtertalApisQuery to use the new API. 2023-04-13 10:08:39 +02:00
Michael Nebel
169d8d5cf9 Java: All ai-generated models have been manually verified. 2023-04-13 09:21:06 +02:00
Michael Nebel
dc8a31f2c5 C#/Java: Update dataflow model generator related comments to include provenance. 2023-04-13 09:21:06 +02:00
Michael Nebel
de7f486cb1 C#/Java: Update model converter queries. 2023-04-13 09:21:06 +02:00
Michael Nebel
574f568c26 Java: Update model generator expected output. 2023-04-13 09:21:06 +02:00
Michael Nebel
24c525935f C#: Update model generator expected output. 2023-04-13 09:21:06 +02:00
Michael Nebel
df7d58d101 Java: Adjust model generator printing to the new provenance. 2023-04-13 09:21:06 +02:00
Michael Nebel
df6d9e1e64 Java: Add printing param module to sync files. 2023-04-13 09:21:05 +02:00
Michael Nebel
6a7092dc63 C#: Make a parameterized module for model printing and adjust the model generator printing to the new provenance. 2023-04-13 09:21:05 +02:00
Michael Nebel
dab4a61159 C#: Update flowsummaries expected test output. 2023-04-13 09:21:05 +02:00
Michael Nebel
6593991c13 Java/C#: Update generated models to have provenance df-generated. 2023-04-13 09:21:05 +02:00
Michael Nebel
03482e5e59 Java/C#: Update the internal documentation. 2023-04-13 09:21:05 +02:00
Michael Nebel
917cf7bfee Go: Update provenance validation. 2023-04-13 09:21:05 +02:00
Michael Nebel
37abdc7a51 C#: Adjust the implementation to use the new predicates and Provenance. 2023-04-13 09:21:05 +02:00
Michael Nebel
1d82b09ec1 Sync files. 2023-04-13 09:21:05 +02:00
Michael Nebel
54e55e2262 Java: Introduce more provenance values. 2023-04-13 09:21:04 +02:00
Michael Nebel
efc0650b86 Java: Set the provenance default to manual. 2023-04-13 09:21:04 +02:00
Ed Minnix
2edad6ec71 Remove unused import 2023-04-12 20:42:26 -04:00
Ed Minnix
c756bdbc30 Fix naming in SensitiveCookieNotHttpOnly 2023-04-12 20:39:18 -04:00
Ed Minnix
c49bf01dc8 Refactor PermissiveDotRegex.ql 2023-04-12 20:37:36 -04:00
Ed Minnix
5164c2480f Refactor SensitiveCookieNotHttpOnly 2023-04-12 20:37:36 -04:00
Ed Minnix
8f7d8cbcea Refactor timing attack queries 2023-04-12 20:37:36 -04:00
Ed Minnix
597949dbfe Refactor PermissiveDotRegexQuery 2023-04-12 20:37:36 -04:00
Ed Minnix
157b7ceaff Refactor TimingAttackAgainstHeader 2023-04-12 20:37:36 -04:00
Ed Minnix
a186b771ba Refactor JxBrowserWithoutCertValidation 2023-04-12 20:37:35 -04:00
Ed Minnix
ccdd9bce33 Refactor Revocation checking 2023-04-12 20:37:35 -04:00
Ed Minnix
380888e446 Refactor ClientSuppliedIpUsedInSecurityCheck 2023-04-12 20:37:35 -04:00
Ed Minnix
3c85ca9740 Refactor ThreadResourceAbuse 2023-04-12 20:37:35 -04:00
Ed Minnix
da5a719ffc Refactor UnsafeUsageOfClientSideEncryptionVersion 2023-04-12 20:37:35 -04:00
Ed Minnix
e880a5f187 Refactor UnsafeTlsVersion 2023-04-12 20:37:35 -04:00
Ed Minnix
e3f6bc043d Refactor InsecureWebResourceResponse 2023-04-12 20:37:35 -04:00
Ed Minnix
074745315c Refactor SensitiveAndroidFileLeak 2023-04-12 20:37:35 -04:00
Ed Minnix
685a2043a8 Refactor UnsafeReflection 2023-04-12 20:37:35 -04:00
Ed Minnix
13e1cc50c8 Add SpringUrlRedirect 2023-04-12 20:37:35 -04:00
Ed Minnix
30cfbb83b3 Add UncaughtServletException 2023-04-12 20:37:35 -04:00
Ed Minnix
5594e7f6d2 Add SensitiveGetQuery 2023-04-12 20:37:35 -04:00
Ed Minnix
478309c90b Add UnsafeDeserializationRmi 2023-04-12 20:37:35 -04:00
Ed Minnix
e2cfea19b5 Add UnsafeUrlForward 2023-04-12 20:37:35 -04:00
Ed Minnix
d48adbd175 Refactor JsonpInjection 2023-04-12 20:37:35 -04:00
Ed Minnix
8cb5e78832 Refactor XXE files 2023-04-12 20:37:35 -04:00
Ed Minnix
4c80ff03de Refactor UnvalidatedCors 2023-04-12 20:37:35 -04:00
Ed Minnix
d254d91f57 Refactor Injection queries 2023-04-12 20:37:35 -04:00
Ed Minnix
7002ed5303 Refactor InsecureRmiJmxEnvironmentConfiguration 2023-04-12 20:37:35 -04:00
Ed Minnix
6e4e1e52c0 Refactor NFEAndroidDoS 2023-04-12 20:37:35 -04:00
Ed Minnix
94768f425f Refactor HashWithoutSalt 2023-04-12 20:37:35 -04:00
Ed Minnix
cb7391177d Refactor MyBatis queries 2023-04-12 20:37:35 -04:00
Ed Minnix
d528c8461f Refactor XQueryInjection.ql 2023-04-12 20:37:35 -04:00
Ed Minnix
e7cbd493d7 Refactor FilePathInjection 2023-04-12 20:37:35 -04:00
Ed Minnix
47c5db03ab Refactor OpenStream.ql 2023-04-12 20:37:34 -04:00
Ed Minnix
5bd9aae072 Refactor Log4jJndiInjection.ql 2023-04-12 20:37:34 -04:00
Asger F
2f82f4338a QL: Dont ask me to inline cached predicates 2023-04-12 20:33:21 +02:00
Chris Smowton
d049b112a9 Merge pull request #12750 from smowton/smowton/admin/add-dataflow-viableParamArgSpecific-hook
Go: mass-convert taint-flow models to models-as-data format (with `viableParamArgSpecific` hook)
2023-04-12 17:11:18 +01:00
Chris Smowton
d648b34037 Accept test changes
These are caused by nodes being hidden by https://github.com/github/codeql/pull/12783
2023-04-12 15:05:04 +01:00
Mathias Vorreiter Pedersen
566513e927 Merge pull request #12800 from MathiasVP/fix-joins-in-constant-array-overflow
C++: Fix joins in `cpp/constant-array-overflow`
2023-04-12 14:57:17 +01:00
Chris Smowton
7eefa43f5a Rename and document viableArgParamSpecific to make clear it is a temporary hook. 2023-04-12 14:33:46 +01:00
Chris Smowton
1706367b34 Document DataFlowCallable 2023-04-12 14:24:21 +01:00
Chris Smowton
9f4b77e851 Accept test changes 2023-04-12 14:19:06 +01:00
Chris Smowton
4d8ca3d759 Add dataflow callback to filter out receiver argument flow to Golang interface dispatch candidates.
Other langauges stub the callback.
2023-04-12 14:19:06 +01:00
Chris Smowton
7ffe863ba6 Remove addressed FIXME
This was addressed by adding `getAPackageWithSummarizedCallables`
2023-04-12 14:19:06 +01:00
Chris Smowton
985e07d902 pragma[nomagic] hasQualifiedName
These are cheap and frequently-used, and magicking them with respect to `interpretPackage` was yielding expensive, unnecessary regex operations.
2023-04-12 14:19:06 +01:00
Chris Smowton
0129167cc4 Convert Beego's MapGet method to MaD 2023-04-12 14:19:06 +01:00
Chris Smowton
b86f0cf268 Sort models 2023-04-12 14:19:06 +01:00
Chris Smowton
12527e406b Remove unnecessary model
This referred to a private type
2023-04-12 14:19:05 +01:00
Chris Smowton
2abffccded Accept test changes 2023-04-12 14:19:05 +01:00
Chris Smowton
3cea01b6c8 Fix functions with multiple models
In some cases multiple return value outputs can be coalesced, and in others we had accidentally conflated two independent flows (e.g. Arg1 -> Arg2 | Arg3 -> Arg4 led to accidentally introducing Arg1 -> Arg4 and Arg3 -> Arg2)
2023-04-12 14:19:05 +01:00
Chris Smowton
4a89dbc498 Revert "Remove unnecessary models"
This reverts commit 12eaedc188487275e8cd6bed4a4318fed4d4b752.

We can't do this now, because there is nothing to guarantee an interface has actually been extracted, and therefore whether a model will get applied. Therefore explicitly modelling methods that may be interface implementations where the interface is in a different package may still make a difference to behaviour.
2023-04-12 14:19:05 +01:00
Chris Smowton
3f6ceccbe8 US spelling 2023-04-12 14:19:05 +01:00
Chris Smowton
8c553ec0fc Autoformat go 2023-04-12 14:19:05 +01:00
Chris Smowton
ac4dcc6c4b Add ioutil usage to TaintSteps test
It appears at present the Go standard library imports the deprecated io/ioutil package internally on some platforms but not others. Therefore I add a test explicitly using it to make the test behave more uniformly.
2023-04-12 14:19:05 +01:00
Chris Smowton
3c48609635 Accept test changes 2023-04-12 14:19:05 +01:00
Chris Smowton
ed56461ed7 Remove unnecessary models
These are inherited from Stringer, Reader, Writer and BinaryMarshaler
2023-04-12 14:19:05 +01:00
Chris Smowton
19e8974766 Fix comment 2023-04-12 14:19:05 +01:00
Chris Smowton
140505222f Update test expectations 2023-04-12 14:19:04 +01:00
Chris Smowton
1a7927d3a1 Fix x/net/html.EscapeString modelling
This had never worked due to accidentally extending non-abstract class HtmlEscapeFunction; consequently it was neither a taint propagator in general, nor an HTML escape function. Added tests to ensure it is now behaving as intended.
2023-04-12 14:19:04 +01:00
Chris Smowton
fa4145b5e4 Remove dead code 2023-04-12 14:19:04 +01:00
Chris Smowton
141d6b8d7b Accept paths test changes 2023-04-12 14:19:04 +01:00
Chris Smowton
8a06ca5a43 Allow $ANYVERSION token in Go package names 2023-04-12 14:19:04 +01:00
Chris Smowton
477341dd3b Remove unnecessary variable 2023-04-12 14:19:04 +01:00
Chris Smowton
952bc8458f Use explicit this 2023-04-12 14:19:04 +01:00
Chris Smowton
affe42b079 Use US spelling 2023-04-12 14:19:04 +01:00
Chris Smowton
aaa7f34386 Fix mixing of source and summary models 2023-04-12 14:19:04 +01:00
Chris Smowton
18d00c1116 Autoformat QL 2023-04-12 14:19:03 +01:00
Chris Smowton
54d08e11ca Autoformat Go 2023-04-12 14:19:03 +01:00
Chris Smowton
6b9b4c8da0 Remove binary file 2023-04-12 14:19:03 +01:00
Chris Smowton
8fb75f412a Consider MaD models ref whether a package should be considered an unknown external. 2023-04-12 14:19:03 +01:00
Chris Smowton
9447dfd636 Combine net/http models 2023-04-12 14:19:03 +01:00
Chris Smowton
0d306e6189 Restore versioning to one more protobuf model 2023-04-12 14:19:03 +01:00
Chris Smowton
2658a47f21 Remove another protobuf instance now handled in Protobuf.qll 2023-04-12 14:19:03 +01:00
Chris Smowton
a16d56258f Clean up protobuf models 2023-04-12 14:19:03 +01:00
Chris Smowton
95a9fcae47 Remove spurious model
This referenced a test-specific package; these protobuf models are more than MaD can specify, so they have already moved back into Protobuf.qll.
2023-04-12 14:19:03 +01:00
Chris Smowton
0d66b68a56 Restore more package / subpackage boundaries and alternate package names
Note none of these alternate names are apparently tested, either before or afterwards.
2023-04-12 14:19:03 +01:00
Chris Smowton
5e121fb4fd Restore Couchbase alternate package names 2023-04-12 14:19:03 +01:00
Chris Smowton
fd16c03fcf Add Beego v2 models 2023-04-12 14:19:02 +01:00
Chris Smowton
172ff082d3 Default to tolerating multiple package versions
Subpackages still need to use the $ANYVERSION trick
2023-04-12 14:19:02 +01:00
Chris Smowton
12f35bc6ac Add missing tests for RevelHeader mutators 2023-04-12 14:19:02 +01:00
Chris Smowton
2024747827 Add missing tests for html.Node taint propagators
The TaintTracking::FunctionModels for these appeared broken, so I suspect they had never worked.
2023-04-12 14:19:02 +01:00
Chris Smowton
8f4567349d Add missing NewTokenizerFragment model and test 2023-04-12 14:19:02 +01:00
Chris Smowton
e6718322bb Restore query-specific FunctionModels
MaD can't be used to introduce query-specific sumamries at the moment.
2023-04-12 14:19:02 +01:00
Chris Smowton
ed7f351be7 Add missing tests for mime/multipart.Part 2023-04-12 14:19:02 +01:00
Chris Smowton
405a56326c Add missing tests for CertStorage 2023-04-12 14:19:02 +01:00
Chris Smowton
803b9d38cc Add missing tests and models for json-patch 2023-04-12 14:19:02 +01:00
Chris Smowton
5e74930881 Add missing tests and models for go-pg/pg/orm.Formatter 2023-04-12 14:19:02 +01:00
Chris Smowton
3c8182b521 Format and reorder 2023-04-12 14:19:02 +01:00
Chris Smowton
9e38e8d675 Restore model of builtin copy function.
This is another with no real signature type.
2023-04-12 14:19:01 +01:00
Chris Smowton
0249669299 Accept test changes 2023-04-12 14:19:01 +01:00
Chris Smowton
c752777022 Accept test changes 2023-04-12 14:19:01 +01:00
Chris Smowton
c011e013e1 fixup restoration of variadic models 2023-04-12 14:19:01 +01:00
Chris Smowton
7c8db6eace Restore QL modelling for the built-in append function. 2023-04-12 14:19:01 +01:00
Chris Smowton
a796ddb95b Accept paths-only test changes 2023-04-12 14:19:01 +01:00
Chris Smowton
77b8103cc1 Adapt tests not to depend on TaintTracking::FunctionModel 2023-04-12 14:19:01 +01:00
Chris Smowton
2e70fada8d Bump Go version on test referencing go 1.20 methods
This turned out not to matter for the extractor, but it means we can check the build using `go build`.
2023-04-12 14:19:01 +01:00
Chris Smowton
a673610e18 Adapt query not to depend on TaintTracking::FunctionModel 2023-04-12 14:19:01 +01:00
Chris Smowton
c8407ba323 Revert variadic functions to use non-MaD models 2023-04-12 14:19:01 +01:00
Chris Smowton
16e3acf592 Restore old-style taint models for the unsafe package
These functions don't have proper signature types, so are not suited to MaD models
2023-04-12 14:19:00 +01:00
Chris Smowton
2c65e68c5f Adapt HTTP response body association to MaD models 2023-04-12 14:19:00 +01:00
Chris Smowton
2677a945f3 Autoformat 2023-04-12 14:19:00 +01:00
Chris Smowton
53723479c8 Enable model inheritence by subinterfaces
Previously only a concrete (non-interface) method could inherit such a model
2023-04-12 14:19:00 +01:00
Chris Smowton
9c45192a4e Remove spurious duplicate models 2023-04-12 14:19:00 +01:00
Chris Smowton
c242c28af9 Use $ANYVERSION to allow applying a model to all versions of a given package 2023-04-12 14:19:00 +01:00
Chris Smowton
f36a2143f5 Accept more test changes; add some missing models 2023-04-12 14:19:00 +01:00
Chris Smowton
bfc8db90af Accept test changes
This is 1x path changes without result changes, and 1x expected change since the Encode function is no longer modelled using TaintTracking::FunctionModel
2023-04-12 14:19:00 +01:00
Chris Smowton
d49840ee8e Restore mistakenly-deleted models 2023-04-12 14:19:00 +01:00
Chris Smowton
11b457d5bf Allow - character in Go package names 2023-04-12 14:19:00 +01:00
Chris Smowton
e98c70c482 Restore mistakenly deleted model 2023-04-12 14:19:00 +01:00
Chris Smowton
1b7f529949 Restore reverse-flow models 2023-04-12 14:19:00 +01:00
Chris Smowton
de0caf2445 Go: mass-convert taint-flow models to models-as-data format 2023-04-12 14:18:44 +01:00
Chris Smowton
51ebc0bef2 Amend test now that DataFlowCallable != Callable 2023-04-12 14:15:54 +01:00
Chris Smowton
a5e5a5780d Use FlowSummaryImpl::Private::summaryParameterNodeRange 2023-04-12 14:15:54 +01:00
Chris Smowton
4ea4e0dcca Go: seperate real and synthetic callables
This means that when a function has a real body and a summary (usually because it has a real definition in source, and implements an interface that has a model), two callables are created and dispatch considers both possible paths.

This specifically overcomes the difficulty with ParameterNodes when the real callable, if any, may or may not define an SsaNode, either because the real parameter is unused or because it is anonymous. Now the synthetic callable will always have parameter nodes, while the real one may or may not depending on whether a definition is present and
whether or not it names or uses its parameter.
2023-04-12 14:15:54 +01:00
Erik Krogh Kristensen
cfb273ae01 Merge pull request #12799 from erik-krogh/oneColumn
JS: use 1-based column locations for diagnostics
2023-04-12 14:48:20 +02:00
Alexandre Boulgakov
f4b79ea07d Merge pull request #12784 from github/sashabu/keypaths
Swift: Extract structured keypath components.
2023-04-12 13:12:22 +01:00
Asger F
b819f55203 Merge pull request #12792 from asgerf/js/redux-model-perf
JS: add getForwardingFunction and use to sharpen useSelector model
2023-04-12 14:09:59 +02:00
Taus
beae3e9187 Python: Clarify version data 2023-04-12 11:53:16 +00:00
Alexandre Boulgakov
b890e2ef96 Swift: Use camelCase in KeyPathComponent predicates. 2023-04-12 12:50:50 +01:00
erik-krogh
d3cc1d6991 update expected output of diagnostics test 2023-04-12 13:42:05 +02:00
Erik Krogh Kristensen
8cb54b748b Merge pull request #12787 from tyage/add-router-sink
JS: Add New XSS sink - Next.js router.push/replace
2023-04-12 13:30:21 +02:00
Alexandre Boulgakov
64443dfdcf Swift: Add named predicates for known KeyPathComponent kinds. 2023-04-12 12:06:14 +01:00
Mathias Vorreiter Pedersen
d1e3c1b407 C++: Fix joins in 'select' of 'cpp/constant-array-overflow'. 2023-04-12 11:39:35 +01:00
Michael Nebel
c787bb2ff9 C#: Re-factor the callablereturnarg tests. 2023-04-12 11:47:42 +02:00
Michael Nebel
9c5b8e2894 C#: Update expected output of tests using the inline flow test framework. 2023-04-12 11:15:15 +02:00
Michael Nebel
5c586c3afd C#: Re-factor the InlineFlowTest framework. 2023-04-12 11:15:15 +02:00
Michael Nebel
61b8f97b75 C#: Re-factor the flowsources test. 2023-04-12 11:15:15 +02:00
Michael Nebel
f00c97810a C#: Re-factor the NHibernate test. 2023-04-12 11:15:14 +02:00
Michael Nebel
9c60c4b3d9 C#: Re-factor the JsonNet test. 2023-04-12 11:15:14 +02:00
Michael Nebel
1f0fbfaef0 C#: Re-factor the EntityFramework test. 2023-04-12 11:15:14 +02:00
Michael Nebel
4023cd3b4c C#: Re-factor the dataflow/global tests. 2023-04-12 11:15:14 +02:00
Michael Nebel
a2c7388282 C#: Re-factor the ExternalFlow test. 2023-04-12 11:15:14 +02:00
Michael Nebel
bd886202f6 C#: Re-factor the Async test. 2023-04-12 11:15:14 +02:00
Michael Nebel
a98cf0ae45 C#: Re-factor the GlobalTaintTracking test. 2023-04-12 11:15:14 +02:00
Michael Nebel
0dc612f23f C#: Re-factor the TaintTracking test. 2023-04-12 11:15:14 +02:00
Michael Nebel
b5b0d60074 Merge pull request #12731 from michaelnebel/csharp/refactorcleatextstorage
C#: Re-factor CleartextStorage to use the new API.
2023-04-12 09:32:56 +02:00
Tony Torralba
cc6a923eef Merge pull request #12798 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-04-12 09:04:53 +02:00
erik-krogh
fe5e4845b1 use 1-based column locations for diagnostics 2023-04-12 08:14:15 +02:00
github-actions[bot]
a55f5ed933 Add changed framework coverage reports 2023-04-12 00:15:16 +00:00
Geoffrey White
03a4084c11 Swift: Update some sinks to CSV format. 2023-04-11 18:10:54 +01:00
Geoffrey White
256c3f66ca Swift: Various minor fixes / consistency improvements to sinks. 2023-04-11 17:04:09 +01:00
Alexandre Boulgakov
b900185ae3 Swift: Add db upgrade/downgrade scripts for key-path component extraction.
I've marked both scripts as "partial" since we're extracting different AST components for key-paths and don't have a good way to convert between them in QL. Each deletes the corresponding tables, but leaves non-key-path functionality intact.
2023-04-11 14:00:13 +01:00
Alexandre Boulgakov
35a2d55d18 Swift: Extract structured keypath components.
Changes in swift/ql/lib are generated by swift/codegen without manual intervention.
2023-04-11 13:34:17 +01:00
Alexandre Boulgakov
2b1dea56b5 Swift: Add error query to AST tests.
Preexisting errors are left to be fixed later.
2023-04-11 13:34:16 +01:00
Jami
b7c7449b08 Merge pull request #12739 from jcogs33/jcogs33/add-one-more-top500-model
Java: add summary model for `UnsupportedOperationException(String)` constructor
2023-04-11 08:25:36 -04:00
Asger F
aef0fa3c8a JS: Expand QLDoc 2023-04-11 14:16:36 +02:00
Asger F
d702c7b990 Merge pull request #12759 from asgerf/js/getset-in-pattern
JS: Fix parsing of 'get' or 'set' pattern with a default value
2023-04-11 14:03:00 +02:00
Asger F
2c65a49d7c JS: Add getForwardingFunction() to API graphs 2023-04-11 14:00:30 +02:00
Asger F
4ce03d4dc4 JS: Restrict useSelector steps to local callbacks 2023-04-11 13:33:46 +02:00
Asger F
3cc931306f JS: Add test for selector nodes with multiple access paths 2023-04-11 13:33:27 +02:00
Geoffrey White
7ddfcb28e5 Swift: Rename DefaultConstantPasswordSink -> CryptoSwiftPasswordSink. 2023-04-11 11:49:21 +01:00
Chris Smowton
f6f22c0cec Merge pull request #12783 from smowton/smowton/feature/golang-hide-summary-nodes
Go: hide summary nodes from path explanations
2023-04-11 10:47:25 +01:00
Henry Mercer
227aee84fe Merge pull request #12768 from github/henrymercer/merge-back-3.9
Merge `rc/3.9` back to `main`
2023-04-11 10:44:29 +01:00
Tony Torralba
075c0f94ac Merge pull request #12785 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-04-11 11:34:37 +02:00
Tony Torralba
3b11b7c9fd Merge pull request #12726 from github/java/update-mad-decls-after-triage-2023-03-31T08-30-31
Java: Update MaD Declarations after Triage
2023-04-11 11:33:36 +02:00
Tony Torralba
944bdfde45 Apply suggestions from code review 2023-04-11 09:47:47 +02:00
Stephan Brandauer
cb8506d51a Update MaD Declarations after Triage 2023-04-11 09:25:39 +02:00
github-actions[bot]
bfdfa0b93e Add changed framework coverage reports 2023-04-11 00:15:35 +00:00
tyage
40d475863d Add change note 2023-04-08 18:36:50 +09:00
tyage
320cb99dbf Add replace method test 2023-04-08 18:31:48 +09:00
tyage
668e1accaa Remove unnecessary whiteline 2023-04-08 18:24:31 +09:00
tyage
7f9b8557ac Add Next.js router push as XSS sink 2023-04-08 18:18:34 +09:00
Geoffrey White
d4cc86cd05 Swift: Make the RNCryptor sources wider (actual usage seems to vary). 2023-04-06 20:36:12 +01:00
Jeroen Ketema
5ee9711f03 Merge pull request #12615 from jketema/product-configsig
C++: Refactor `ProductFlow` to have a `DataFlow::ConfigSig`-like interface
2023-04-06 19:41:46 +02:00
Aditya Sharad
e2cb209f95 Merge pull request #12771 from adityasharad/actions/fast-forward
Actions: Add workflow to fast-forward tracking branch for latest CodeQL release
2023-04-06 09:29:25 -07:00
Aditya Sharad
ad8d4ac79f Actions: Address comments on fast-forward workflow 2023-04-06 08:51:27 -07:00
Chris Smowton
939a025e11 Go: hide summary nodes from path explanations
This mirrors behaviours in other languages with MaD summaries
2023-04-06 16:41:44 +01:00
Jeroen Ketema
12702b59d3 C++: Fix deprecation warning 2023-04-06 17:13:15 +02:00
Jeroen Ketema
9123657fd2 C++: Update product flow to match data flow naming 2023-04-06 17:13:12 +02:00
Jeroen Ketema
a38c3171dd C++: Use Unit instead of string in product flow 2023-04-06 17:11:56 +02:00
Jeroen Ketema
9b89a303ef C++: Simplify the flow-state-less product flow module 2023-04-06 17:11:32 +02:00
Jeroen Ketema
886abd1231 C++: Fix typo 2023-04-06 17:11:03 +02:00
Jeroen Ketema
39272def2d C++: Clean up the ProductFlow FlowStates 2023-04-06 17:10:44 +02:00
Jeroen Ketema
4e12924521 C++: Refactor ProductFlow to have a DataFlow::ConfigSig-like interface 2023-04-06 17:10:40 +02:00
Jeroen Ketema
c8798637fa Merge pull request #12777 from jketema/mctv-join
C++: Fix number of join order problems in memory corruption queries
2023-04-06 16:55:42 +02:00
Jami Cogswell
6a103f5070 Java: add change note 2023-04-06 10:22:03 -04:00
Jami Cogswell
c4f8a9a2eb Java: update genVsMan query test case; resolve conflict 2023-04-06 10:21:53 -04:00
Jami Cogswell
01dd2647d4 Java: add test case for yml model 2023-04-06 10:19:33 -04:00
Jami Cogswell
6b695434b7 Java: add yml model for UnsupportedOperationException; resolve conflict 2023-04-06 10:19:19 -04:00
Jami Cogswell
8b0eba78aa Java: add UnsupportedOperationException to topJdkApiName 2023-04-06 10:14:36 -04:00
Jami
c55c9f50c9 Merge pull request #12680 from jcogs33/jcogs33/metrics-query-refactor-top500
Java: test GeneratedVsManualCoverage query on top 500 JDK APIs
2023-04-06 10:07:35 -04:00
Tony Torralba
b0daceb4c3 Merge pull request #12727 from github/java/update-mad-decls-after-triage-2023-03-31T08-31-04
Java: Update MaD Declarations after Triage
2023-04-06 15:47:36 +02:00
Tony Torralba
8686036346 Update java/ql/lib/change-notes/2023-03-31-new-models.md 2023-04-06 15:25:33 +02:00
Arthur Baars
70ad7dcf79 Merge pull request #12775 from github/dependabot/cargo/ql/tree-sitter-0.20.10
Bump tree-sitter from 0.20.9 to 0.20.10 in /ql
2023-04-06 15:13:50 +02:00
Geoffrey White
81b0dbffbd Swift: Add CSV extension points to the encryption queries. 2023-04-06 14:07:41 +01:00
Jami Cogswell
cc92936f6a Java: rename stubs directory 2023-04-06 08:32:09 -04:00
Geoffrey White
3baba70903 Merge pull request #12764 from geoffw0/modernsec
Swift: Modernize the encryption queries
2023-04-06 13:26:32 +01:00
Jami Cogswell
b534f40b26 Java: move TopJdkApis.qll to src directory 2023-04-06 08:23:22 -04:00
Mathias Vorreiter Pedersen
d6b53ab2a5 Merge pull request #12779 from MathiasVP/fix-missing-result-in-arith-tainted
C++: Fix FN in `cpp/tainted-arithmetic`
2023-04-06 13:07:02 +01:00
Tony Torralba
d58d6fe6be Update java/ql/lib/ext/java.net.model.yml 2023-04-06 13:58:13 +02:00
dependabot[bot]
841d91fddb Bump tree-sitter from 0.20.9 to 0.20.10 in /ql
Bumps [tree-sitter](https://github.com/tree-sitter/tree-sitter) from 0.20.9 to 0.20.10.
- [Release notes](https://github.com/tree-sitter/tree-sitter/releases)
- [Commits](https://github.com/tree-sitter/tree-sitter/commits)

---
updated-dependencies:
- dependency-name: tree-sitter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-06 11:22:51 +00:00
Harry Maclean
e2f64de621 Merge pull request #12774 from hmac/merge-extractor-binaries 2023-04-06 19:21:54 +08:00
Arthur Baars
f1246af7da Merge pull request #12776 from aibaars/update-tree-sitter
Ruby: update tree-sitter to 0.20.10
2023-04-06 13:11:12 +02:00
Jeroen Ketema
8e7eec173b C++: inline isInvalidPointerDerefSink 2023-04-06 12:49:10 +02:00
Tony Torralba
cdb3d9ea5a Apply suggestions from code review 2023-04-06 12:23:50 +02:00
Stephan Brandauer
18801b39c6 Update MaD Declarations after Triage 2023-04-06 12:23:50 +02:00
Mathias Vorreiter Pedersen
025081e223 C++: Add change note. 2023-04-06 10:54:16 +01:00
Mathias Vorreiter Pedersen
8fef101432 C++: Fix missing result and accept test changes. 2023-04-06 10:41:08 +01:00
Mathias Vorreiter Pedersen
8014bdc993 C++: Add failing test for 'cpp/tainted-arithmetic'. 2023-04-06 10:39:49 +01:00
Jeroen Ketema
f98576bcb4 C++: Fix number of join order problems in memory corruption queries 2023-04-06 10:53:18 +02:00
Tony Torralba
dec4207af9 Merge pull request #12773 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-04-06 09:36:16 +02:00
Arthur Baars
144a748388 Ruby: update tree-sitter to 0.20.10 2023-04-06 09:10:56 +02:00
Harry Maclean
8ffb81f63f QL: Bump clap to 4.2 2023-04-06 08:19:58 +08:00
github-actions[bot]
a707772222 Add changed framework coverage reports 2023-04-06 00:15:35 +00:00
Harry Maclean
d8a2ba9e00 Ruby: Bump clap to 4.2 2023-04-06 07:56:10 +08:00
Harry Maclean
60580efb16 Merge pull request #12765 from hmac/hmac-extractor-refactor
Ruby/QL: Share dbscheme generation code
2023-04-06 07:37:26 +08:00
Aditya Sharad
65988f49b7 Actions: Add workflow to fast-forward tracking branch for latest CodeQL release 2023-04-05 15:21:58 -07:00
Alex Ford
ba91485471 Merge pull request #12762 from github/post-release-prep/codeql-cli-2.12.6
Post-release preparation for codeql-cli-2.12.6
2023-04-05 16:41:58 +01:00
Tony Torralba
4a11ae95b3 Merge pull request #12691 from github/java/update-mad-decls-after-triage-2023-03-28T12-09-18
Java: Update MaD Declarations after Triage
2023-04-05 17:21:34 +02:00
Geoffrey White
3af2fd0e02 Merge pull request #12769 from geoffw0/configsig
Swift: Convert dataflow / taint tests to DataFlow::ConfigSig.
2023-04-05 16:20:08 +01:00
Geoffrey White
fa23d9c1e4 Swift: Clean up and autoformat. 2023-04-05 15:18:40 +01:00
Geoffrey White
501848bd46 Swift: Convert dataflow / taint tests to DataFlow::ConfigSig. 2023-04-05 15:07:02 +01:00
Henry Mercer
e1b3807dfc Merge remote-tracking branch 'origin/rc/3.9' into henrymercer/merge-back-3.9 2023-04-05 14:57:57 +01:00
Tony Torralba
3f2840bb1b Remove com.hippo models 2023-04-05 15:32:53 +02:00
Tony Torralba
bced2d692b Apply suggestions from code review 2023-04-05 15:19:21 +02:00
Stephan Brandauer
f87618238f Review suggestions 2023-04-05 15:15:03 +02:00
Stephan Brandauer
edf7ba09e7 try different change note name 2023-04-05 15:15:02 +02:00
Stephan Brandauer
0a5d19fc71 Update MaD Declarations after Triage 2023-04-05 15:15:02 +02:00
Jeroen Ketema
be6af4b3f9 Merge pull request #12763 from jketema/swift-configsig-3
Swift: Update final two queries to use `DataFlow::ConfigSig`
2023-04-05 12:49:00 +02:00
Harry Maclean
2107533822 Shared: Clippy fixes
Use clearer methods where appropriate.
2023-04-05 18:46:57 +08:00
Harry Maclean
6a8d417588 Shared: Clippy fixes
Remove unnecessary borrows and lifetime specifiers.
2023-04-05 18:46:57 +08:00
Harry Maclean
77ce6e7122 QL: Clippy fixes 2023-04-05 18:46:57 +08:00
Harry Maclean
a59215f3b9 Shared: Clippy fixes 2023-04-05 18:46:57 +08:00
Harry Maclean
109ca0dc20 Ruby: Clippy fixes 2023-04-05 18:46:57 +08:00
Harry Maclean
b6c071a10b Shared: Further consolidate generators 2023-04-05 18:46:57 +08:00
Harry Maclean
5335ec03b5 QL: Remove db generation functions
These now live in the shared extractor library.
2023-04-05 18:46:57 +08:00
Harry Maclean
c4bee299e5 Ruby: Remove db generation functions
These now live in the shared extractor library.
2023-04-05 18:46:56 +08:00
Harry Maclean
f74d13cf06 Shared: Add db generation functions
These are currently duplicated across the Ruby and QL extractors. Adding
them to the shared extractor library will get rid of this duplication.
2023-04-05 18:46:56 +08:00
Geoffrey White
07cae40985 Swift: More autoformatting. 2023-04-05 11:32:26 +01:00
Geoffrey White
a7038017da Swift: Improve QLDoc. 2023-04-05 11:08:27 +01:00
Geoffrey White
1c75729598 Swift: Autoformat. 2023-04-05 11:08:27 +01:00
Geoffrey White
0d14835feb Swift: Clean up sources / make some of them extendable as well. 2023-04-05 11:08:26 +01:00
Geoffrey White
fc5e958c8d Swift: Add extendible sinks, sanitizers etc and use them. 2023-04-05 11:08:26 +01:00
Jeroen Ketema
cae1892ab4 Swift: Update StringLengthConflation to use DataFlow::StateConfigSig 2023-04-05 09:12:15 +02:00
Jeroen Ketema
3bd6fd0f51 Swift: Update CleartextStorageDatabase to use DataFlow::ConfigSig 2023-04-04 21:53:29 +02:00
Jeroen Ketema
21f9527444 Merge pull request #12758 from MathiasVP/deprecate-after-repeated-initializers
C++: Deprecate single-parameter `getFieldExpr` and `getElementExpr`
2023-04-04 20:26:45 +02:00
github-actions[bot]
ac426b1302 Post-release preparation for codeql-cli-2.12.6 2023-04-04 16:49:26 +00:00
Mathias Vorreiter Pedersen
32d16b6d8a Merge branch 'main' into deprecate-after-repeated-initializers 2023-04-04 16:28:00 +01:00
Mathias Vorreiter Pedersen
f257e85511 C++: Accept test changes in PrintAST. 2023-04-04 16:21:35 +01:00
Mathias Vorreiter Pedersen
03c283781b Merge pull request #12749 from jketema/swift-config
Swift: Rewrite more queries to use `DataFlow::ConfigSig`
2023-04-04 16:18:54 +01:00
Asger F
5cc7380bcd JS: Change note 2023-04-04 16:49:14 +02:00
Asger F
621e2e71c8 JS: Don't try to parse "get=" as a method prop 2023-04-04 16:37:28 +02:00
Asger F
eb8046daef JS: Add trap test showing parse error 2023-04-04 16:33:13 +02:00
Mathias Vorreiter Pedersen
7a32299f34 C++: Oops. Forgot to replace one use of a deprecated predicate. 2023-04-04 15:30:02 +01:00
Mathias Vorreiter Pedersen
6467ba4324 C++: Add change note. 2023-04-04 15:19:14 +01:00
Mathias Vorreiter Pedersen
f2197e67f5 C++: Deprecate single-parameter 'getFieldExpr' and 'getElementExpr'. 2023-04-04 15:14:27 +01:00
Mathias Vorreiter Pedersen
f28cf25ba2 Merge pull request #12755 from MathiasVP/aggregate-initialization-ir
C++: IR generation for repeated initializers
2023-04-04 15:04:55 +01:00
Mathias Vorreiter Pedersen
6c26ad7c2d C++: Expand QLDoc. 2023-04-04 14:02:31 +01:00
Mathias Vorreiter Pedersen
4033ed33d8 C++: Add evil testcase. 2023-04-04 13:50:24 +01:00
Owen Mansel-Chan
00fd23d7b9 Merge pull request #12396 from porcupineyhairs/GoJwtSignImprovements
Go: Add more JWT sinks
2023-04-04 13:28:38 +01:00
Mathias Vorreiter Pedersen
86fd2d5309 Merge pull request #12747 from MathiasVP/promote-new-range-analysis-out-of-experimental
C++: Promote IR-based range-analysis library out of experimental
2023-04-04 11:17:48 +01:00
Mathias Vorreiter Pedersen
52682e2ccb C++: Replace the word 'repetition' with 'position' to properly reflect the semantics of the dbscheme. 2023-04-04 11:02:55 +01:00
Mathias Vorreiter Pedersen
3daefa8b9e C++: Add more tests. 2023-04-04 10:54:12 +01:00
Owen Mansel-Chan
9612bb9e55 Merge pull request #12246 from owen-mc/go/fix/misc
Fix miscellaneous errors highlighted by QL-for-QL
2023-04-04 10:35:42 +01:00
Mathias Vorreiter Pedersen
6dd6488437 C++: Introduce 'getAnElementExpr' and 'getAnExpr'. 2023-04-04 10:12:25 +01:00
Mathias Vorreiter Pedersen
ea180c07e4 C++: Accept test changes. 2023-04-04 10:12:03 +01:00
Mathias Vorreiter Pedersen
bef0a159c0 C++: IR generation for repeated initializers. 2023-04-04 10:08:32 +01:00
Mathias Vorreiter Pedersen
a0df7d22cd C++: Add tests for designated initializers with repetitions. 2023-04-04 10:08:18 +01:00
Mathias Vorreiter Pedersen
f007083ef0 C++: Switch back to a 'Bound' instead of a 'SemBound'. 2023-04-04 09:43:23 +01:00
Asger F
7c9100c782 Merge pull request #12730 from asgerf/rb/net-http
Ruby: Minor fix in NetHttpRequest
2023-04-04 09:44:11 +02:00
Jeroen Ketema
dd85d00579 Swift: Fix formatting 2023-04-04 09:10:21 +02:00
Jeroen Ketema
cb8568f6fd Swift: Rewrite PathInjection to use DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
97575807df Swift: Rewrite CleartextTransmission to use DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
e8bfb87f67 Swift: Rewrite CleartextStoragePreferences to use DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
a45f381ab9 Swift: Rewrite CleartextLogging to use DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
5deafeaf9e Swift: Rewrite UnsafeWebViewFetch to use DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
56156cfa36 Swift: Rewrite UnsafeJsEval to use `DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
db641e508a Swift: Rewrite UncontrolledFormatString to use DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
0ff607c930 Swift: Rewrite XXEQuery to use DataFlow::ConfigSig 2023-04-04 09:10:21 +02:00
Jeroen Ketema
9220bea3ec Swift: Rewrite SqlInjectionQuery to use DataFlow::ConfigSig 2023-04-04 09:10:15 +02:00
Mathias Vorreiter Pedersen
f6e774ed2e C++: Alias the experimental 'Bound.qll' with the non-experimental one. 2023-04-03 18:18:33 +01:00
Geoffrey White
e62a6a037c Swift: Split encryption queries into three parts (trivial re-organization of existing code). 2023-04-03 17:20:34 +01:00
Andrew Eisenberg
1df3b017f2 Merge pull request #12728 from asgerf/js/extension-docs-fixlink
JS: Use RST syntax for link in docs
2023-04-03 08:51:59 -07:00
Jeroen Ketema
70d0e987c4 Swift: Rewrite PredicateInjection to use DataFlow::ConfigSig 2023-04-03 16:19:30 +02:00
Mathias Vorreiter Pedersen
c19edc5f0b C++: Fix Code Scanning errors. 2023-04-03 15:17:37 +01:00
Mathias Vorreiter Pedersen
aa337c72c2 C++: Update import paths in tests and experimental queries. 2023-04-03 15:17:37 +01:00
Alex Ford
0e1d2ad67f Merge pull request #12746 from alexrford/diagnostics-nullptr-rc-3.9
JS: only set the file in the diagnostics message if the file is within the source root (base rc/3.9)
2023-04-03 14:47:07 +01:00
Alexandre Boulgakov
0aa39c0ca0 Merge pull request #12712 from github/sashabu/repeated-initializers
C++: Support repeated initializers in dbscheme.
2023-04-03 14:46:17 +01:00
Geoffrey White
4d3fc02d7e Merge pull request #11965 from geoffw0/realmfix
Swift: Test and fix missing swift/cleartext-storage-database results
2023-04-03 14:02:18 +01:00
Mathias Vorreiter Pedersen
4c5ca082ce C++: Delete the experimental range-analysis library. 2023-04-03 13:53:43 +01:00
Mathias Vorreiter Pedersen
e8800a6dba C++: Move the new range-analysis library out of experimental and into an 'internal' directory. 2023-04-03 13:53:43 +01:00
erik-krogh
0b4f239ab5 only set the file in the diagnostics message if the file is within the source root 2023-04-03 13:49:29 +01:00
Erik Krogh Kristensen
1a0e3c8907 Merge pull request #12743 from erik-krogh/null-ptr-2
JS: only set the file in the diagnostics message if the file is within the source root
2023-04-03 14:04:19 +02:00
erik-krogh
a7c2892af4 only set the file in the diagnostics message if the file is within the source root 2023-04-03 12:38:10 +02:00
Asger F
53de9ae580 Merge pull request #12729 from asgerf/js/crypto-modernize
JS: Modernize crypto libraries
2023-04-03 12:16:22 +02:00
Tony Torralba
6331c37b46 Merge pull request #12735 from JLLeitschuh/doc/JLL/fix-partial-path-documentation
Fix partial path traversal Java example Again
2023-04-03 11:18:02 +02:00
Jeroen Ketema
e5c7c88588 Merge pull request #12737 from MathiasVP/speed-up-gvn
C++: Speed up non-linear recursion in GVN library
2023-04-03 10:46:37 +02:00
Jeroen Ketema
1d9fc8a581 Merge branch 'main' into sashabu/repeated-initializers 2023-04-03 09:48:23 +02:00
Jeroen Ketema
ecf92f0c5d Merge pull request #12741 from jketema/js-qhelp-example-fix
JS: Fix qhelp after file rename
2023-04-03 09:47:38 +02:00
Asger F
e5d090c640 Merge pull request #12671 from asgerf/ql/class-type
QL: Make Class.getType() only return ClassType
2023-04-03 09:43:14 +02:00
Mathias Vorreiter Pedersen
9a34a7b7cc Merge pull request #12719 from jketema/typebound-size 2023-04-03 08:31:41 +01:00
Jeroen Ketema
17bd9c12d7 JS: Fix qhelp after file rename 2023-04-03 09:25:19 +02:00
Paolo Tranquilli
5e45377ad7 Merge pull request #12725 from github/redsun82/swift-successfully-extracted-lines
Swift: add `SuccessfullyExtractedLines` query
2023-04-03 09:12:41 +02:00
Jeroen Ketema
69619f1fbc Merge pull request #12738 from MathiasVP/fix-join-in-suspecious-call-to-strncat
C++: Fix join order in `cpp/unsafe-strncat`
2023-04-01 20:10:17 +02:00
Jonathan Leitschuh
0d774a647c Fix partial path traversal Java example Again
The original wouldn't compile, and the fix made by #11899 is sub-optimal.
This keeps the entire comparision using the Java `Path` object, which is optimal.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2023-03-31 23:36:07 -04:00
Jonathan Leitschuh
b9d409279b Update java/ql/src/Security/CWE/CWE-023/PartialPathTraversalRemainder.inc.qhelp
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-31 23:36:07 -04:00
Jonathan Leitschuh
e641505361 Fix partial path traversal Java example Again
The original wouldn't compile, and the fix made by #11899 is sub-optimal.
This keeps the entire comparision using the Java `Path` object, which is optimal.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2023-03-31 23:36:07 -04:00
Jami Cogswell
0688fa6ed1 Java: update expected file for results without interface members 2023-03-31 18:02:09 -04:00
Jami Cogswell
c69745a6f8 Java: fix stubs 2023-03-31 18:02:09 -04:00
Jami Cogswell
266939840d Java: update expected file with results that include interface members 2023-03-31 18:02:09 -04:00
Jami Cogswell
aca538310f Java: update some qldocs 2023-03-31 18:02:09 -04:00
Jami Cogswell
8b18df0987 Java: update top jdk apis test case with stubs 2023-03-31 18:02:09 -04:00
Jami Cogswell
e0524a1177 Java: add test case for top jdk apis 2023-03-31 18:02:09 -04:00
Jami Cogswell
8501a16cac Java: move TopJdkApis.qll to lib directory for better importing 2023-03-31 18:02:09 -04:00
Jami Cogswell
fea55e910e Java: move query logic to qll file and add subset restriction for top500 jdk apis 2023-03-31 18:02:08 -04:00
Mathias Vorreiter Pedersen
e5700e07c7 C++: Fix join order in 'cpp/unsafe-strncat'. 2023-03-31 21:33:28 +01:00
Porcupiney Hairs
e9615c57e9 Go: Add more JWT sinks
This pull requests adds modelling for `katras/iris/v12/middleware/jwt`, `katras/jwt` and `gogf/gf-jwt` frameworks.
2023-03-31 23:11:24 +05:30
Mathias Vorreiter Pedersen
6638df1578 C++: Sync identical files. 2023-03-31 18:25:34 +01:00
Mathias Vorreiter Pedersen
0b33d26852 C++: Speed up non-linear recursion in GVN. 2023-03-31 18:25:19 +01:00
Alexandre Boulgakov
ddd44b4c13 C++: Correct repeated initializers downgrade script compatibility to full. 2023-03-31 17:53:12 +01:00
Alexandre Boulgakov
e593f0f7b3 C++: Update database stats. 2023-03-31 17:53:12 +01:00
Alexandre Boulgakov
b5932debc0 C++: Add db upgrade and downgrade scripts for repeated initializers. 2023-03-31 17:53:12 +01:00
Alexandre Boulgakov
d0a77a8433 C++: Support repeated initializers in dbscheme. 2023-03-31 17:53:12 +01:00
Edward Minnix III
2b9daed26a Merge pull request #12563 from egregius313/egregius313/refactor-java-libs-to-dataflow-modules
Java: Refactor Java query libraries to use dataflow modules
2023-03-31 12:38:14 -04:00
Owen Mansel-Chan
8e8ffb20a3 Accept test changes caused by alert message change 2023-03-31 16:48:01 +01:00
Owen Mansel-Chan
4fa57bfb2d Use set literal instead of regex comparison 2023-03-31 16:48:00 +01:00
Owen Mansel-Chan
a9f297c031 Use set literal instead of a conjunction 2023-03-31 16:47:59 +01:00
Owen Mansel-Chan
5d93ed5f52 Remove redundant term
It's hard to tell what the original intention was, but I don't think
the location of qs should be the same as the location of q, so this
term is redundant.
2023-03-31 16:47:59 +01:00
Owen Mansel-Chan
34bca0612b Use _ for exists-variable that is only used once 2023-03-31 16:47:58 +01:00
Owen Mansel-Chan
607e2817e5 Use not A and B instead of if A then none() else B 2023-03-31 16:47:58 +01:00
Owen Mansel-Chan
9ac0c57a3e Fix alert message to match style guide 2023-03-31 16:47:57 +01:00
Owen Mansel-Chan
cf89b00f47 Fix variable names in QLDocs 2023-03-31 16:47:57 +01:00
Owen Mansel-Chan
513409e082 Fix formatting of QLDocs 2023-03-31 16:47:56 +01:00
Owen Mansel-Chan
7a25200962 Remove fields which are only used in char pred 2023-03-31 16:47:55 +01:00
Owen Mansel-Chan
a113b8e8a4 No need for singleton set 2023-03-31 16:47:55 +01:00
Owen Mansel-Chan
f6dc9e2a35 Fix accidental over-modelling of k8s Secret DeepCopy 2023-03-31 16:47:53 +01:00
Geoffrey White
7f69fe6e8c Swift: Autoformat. 2023-03-31 16:32:49 +01:00
Ed Minnix
800411cd81 More replacing of single-predicate classes to predicate 2023-03-31 10:55:17 -04:00
Geoffrey White
91f6b0ba4f Swift: Correct test expectations. 2023-03-31 15:50:59 +01:00
Geoffrey White
c88bea7080 Update swift/ql/lib/codeql/swift/elements/type/TypeAliasType.qll
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-03-31 15:29:49 +01:00
Ian Lynagh
c1a7d7f825 Merge pull request #12646 from igfoo/igfoo/expanded_args
Java: Store expanded args in the database
2023-03-31 15:27:02 +01:00
Geoffrey White
b3e0c49435 Swift: Remove unnecessary imports. 2023-03-31 15:03:01 +01:00
Geoffrey White
8a805bb7a3 Swift: Replace getABaseOrAliasedType with slightly more sophisticated getABaseType. 2023-03-31 14:16:42 +01:00
Erik Krogh Kristensen
1e1a692ee6 Merge pull request #12686 from erik-krogh/backtick-parse-error
JS: add backticks around the concrete parse error
2023-03-31 14:56:38 +02:00
Asger F
64cf27ab87 JS: Modernize crypto libraries 2023-03-31 14:49:23 +02:00
Jeroen Ketema
8d9b96b776 C++: Drop the bit size restriction in typeBound and use float 2023-03-31 14:36:11 +02:00
Geoffrey White
cc841a68f6 Merge pull request #11921 from gsingh93/range-node
C++: Add RangeNode class
2023-03-31 13:22:19 +01:00
Ian Lynagh
3d85c4f19c Java: Add another change note 2023-03-31 12:46:10 +01:00
Ian Lynagh
04c09a73a9 Java: Add .md extension to changenote file 2023-03-31 12:40:19 +01:00
Michael Nebel
fc43a4e569 C#: Re-factor CleartextStorage to use the new API. 2023-03-31 13:10:42 +02:00
Asger F
c699afd07f Ruby: instantiate NetHttpRequest even if body is not accessed 2023-03-31 12:56:09 +02:00
Asger F
504a0f8112 Ruby: Add test where response body is not referenced 2023-03-31 12:55:49 +02:00
Asger F
40530ae14d JS: Simplfy with set literal 2023-03-31 12:04:56 +02:00
Asger F
4a06b81429 JS: Use API graphs in CryptoJS 2023-03-31 12:03:14 +02:00
Asger F
dec1e4dfd6 Merge pull request #12666 from smiddy007/improve-insufficient-pw-hash-query
JS: Improve insufficient pw hash query
2023-03-31 11:58:41 +02:00
Geoffrey White
302013a7fd Swift: Add a test for Type.getABaseOrAliasedType. 2023-03-31 10:44:01 +01:00
Geoffrey White
33b041242d Swift: Recognize Core Data + Realm sources via type aliases. 2023-03-31 10:44:01 +01:00
Asger F
e366ba1d7c JS: Use RST syntax for link in docs 2023-03-31 11:33:39 +02:00
Asger F
209aebad61 Ruby: Update HttpClients.ql not assume all predicates have results 2023-03-31 11:12:45 +02:00
Alex Ford
571c3f3fba Merge pull request #12720 from github/release-prep/2.12.6
Release preparation for version 2.12.6
2023-03-31 10:02:13 +01:00
Geoffrey White
ddb27e5525 Merge pull request #12724 from geoffw0/modernstring2
Swift: Add missing import.
2023-03-31 09:48:46 +01:00
Michael Nebel
014e3e40bb Merge pull request #12707 from michaelnebel/csharp/dataflowstaticoperators
C#: Data flow tests for virtual and abstract operators.
2023-03-31 10:43:21 +02:00
Paolo Tranquilli
bc698546e5 Swift: specify treatment for multi-line things 2023-03-31 10:32:40 +02:00
Asger F
008ffea94f Merge pull request #12703 from asgerf/rb/api-graphs-trackdef
Ruby: do not depend on trackDefNode in isDef
2023-03-31 10:30:18 +02:00
Michael Nebel
f792bf09d3 C#: Update expected test output. 2023-03-31 10:13:20 +02:00
Michael Nebel
6f86cb1c1b C#: Add interface definition and add more testcases. 2023-03-31 10:13:20 +02:00
Michael Nebel
fc21f01cb9 Merge pull request #12690 from michaelnebel/csharp/checkedlocalflow
C#: Dataflow via checked and unchecked expressions.
2023-03-31 10:12:01 +02:00
Paolo Tranquilli
33b4d2d653 Swift: add SuccessfullyExtractedLines query
This counts how many lines we have extracted some entity in. If we test
changes in this, we can have a more fine grained look into how much we
actually extract than looking at the extracted files.
2023-03-31 10:02:19 +02:00
Geoffrey White
01280aee67 Swift: Add missing import. 2023-03-31 08:48:57 +01:00
Paolo Tranquilli
3e703802b1 Merge pull request #12710 from github/redsun82/swift-imported-modules-as-set
Swift: make imported and exported modules a set
2023-03-31 09:46:44 +02:00
Ed Minnix
ac218ba08b Replace private classes with one method to predicates 2023-03-30 22:03:05 -04:00
github-actions[bot]
0a3218676c Release preparation for version 2.12.6 2023-03-30 19:25:06 +00:00
Edward Minnix III
8e54328315 Merge pull request #12681 from egregius313/egregius313/java/move-configurations-to-libraries
Java: Move dataflow configurations in queries to `*Query.qll` libraries (part 1)
2023-03-30 14:33:21 -04:00
AlexDenisov
3cd0af6622 Merge pull request #12700 from github/redsun82/swift-fix-wmo
Swift: extract all source files in WMO mode
2023-03-30 18:01:48 +02:00
Ed Minnix
03078603bf Reinstate private markers on additional predicates 2023-03-30 11:24:33 -04:00
Ed Minnix
684408a493 Fix StringFormat import 2023-03-30 11:20:35 -04:00
Geoffrey White
daa8141414 Swift: Add test case. 2023-03-30 16:16:40 +01:00
Geoffrey White
beb7d9d7a1 Swift: Test layout change. 2023-03-30 16:13:42 +01:00
Ed Minnix
ecbd3be5e9 Remove private marker
This class is used in the actual query, so it needs to be exposed.
2023-03-30 11:08:41 -04:00
Ed Minnix
dba5e9e9e2 Updates to imports
Make some imports private
Remove unnecessary imports
2023-03-30 11:03:48 -04:00
Edward Minnix III
c7a049a867 Mark things which can be private as private
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-30 11:00:00 -04:00
Edward Minnix III
8250e4393c Typos and rewording
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-30 10:59:12 -04:00
Ian Lynagh
5c50ddce3d Java: Add up/downgrade scripts 2023-03-30 15:53:34 +01:00
Ian Lynagh
69567449de Java: Update stats 2023-03-30 15:53:34 +01:00
Ian Lynagh
b381f00a73 Java: Add changenote for expanded arguments 2023-03-30 15:53:34 +01:00
Ian Lynagh
81a26f0396 Java: Add expanded arguments 2023-03-30 15:53:34 +01:00
Alex Ford
62fcea030a Merge pull request #12718 from github/post-release-prep/codeql-cli-2.12.5
Post-release preparation for codeql-cli-2.12.5
2023-03-30 15:50:56 +01:00
Paolo Tranquilli
3d6916eb72 Swift: add upgrade/downgrade scripts 2023-03-30 16:44:28 +02:00
Paolo Tranquilli
6f6d3f1262 Merge branch 'main' into redsun82/swift-imported-modules-as-set 2023-03-30 16:42:35 +02:00
Paolo Tranquilli
06ad5b3949 Revert "Swift: add upgrade/downgrade scripts"
This reverts commit 48c2303391.

This is done to merge main and readd the scripts in another commit.
2023-03-30 16:41:04 +02:00
Erik Krogh Kristensen
b382465078 Merge pull request #12679 from ctbellanti/improved-certificate-validation
JS: Improved coverage for disabled certificate validation
2023-03-30 16:24:33 +02:00
Robert Marsh
d03dd49904 Merge pull request #12622 from MathiasVP/skip-safe-conversions-in-range-analysis
C++: Range analysis on `EquivalenceClass`es
2023-03-30 10:08:59 -04:00
github-actions[bot]
e87ce62f95 Post-release preparation for codeql-cli-2.12.5 2023-03-30 13:48:58 +00:00
Ian Lynagh
f5a2853ab9 Merge pull request #12705 from igfoo/igfoo/integ-extractor-info
Java: Allow keys to be omitted from ExtractorInformation.ql
2023-03-30 14:06:41 +01:00
Jeroen Ketema
9173e08805 Merge pull request #12714 from jketema/rem-cleanup
C++: Match `SemZeroBound` handling of mul case in rem case
2023-03-30 14:25:20 +02:00
erik-krogh
47783326c2 add test for https.createServer in DisablingCertificateValidation.ql 2023-03-30 14:15:25 +02:00
Asger F
43174cfe3a Merge pull request #12668 from asgerf/js/jquery-callback-sinks
JS: fix handling of jQuery sinks involving callback
2023-03-30 12:42:53 +02:00
Mathias Vorreiter Pedersen
4043aa976d Merge branch 'main' into skip-safe-conversions-in-range-analysis 2023-03-30 11:24:27 +01:00
Mathias Vorreiter Pedersen
d9b2a72232 C++: Ensure that equiv instructions are in the same block. 2023-03-30 11:22:24 +01:00
Mathias Vorreiter Pedersen
4602a8ae4a C++: Simplify 'converts'. 2023-03-30 11:16:54 +01:00
Calum Grant
928a5632ed Merge pull request #12711 from aibaars/ruby-version-docs
Ruby: update supported version to 3.2
2023-03-30 11:15:35 +01:00
Geoffrey White
7729a6bdbf Merge pull request #12509 from geoffw0/typealiasimpl
Swift: Extract type aliases
2023-03-30 11:06:14 +01:00
Mathias Vorreiter Pedersen
62bc8074ba Merge pull request #12626 from gsingh93/buffer-access-size-expr
C++: Add getSizeExpr and getSizeMult predicates to BufferAccess
2023-03-30 10:49:12 +01:00
Rasmus Wriedt Larsen
decd51b65d Merge pull request #12604 from raulgarciamsft/main
Python: Update `py/azure-storage/unsafe-client-side-encryption-in-use`
2023-03-30 11:48:26 +02:00
Mathias Vorreiter Pedersen
0202bafc35 Merge pull request #12709 from MathiasVP/disable-rounding-2
C++: Disable floating point rounding in range analysis
2023-03-30 10:05:47 +01:00
Michael Nebel
dde37c64ac Merge pull request #12675 from michaelnebel/csharp/refactorflowapi
C#: Re-factor tainttracking configurations to use the new API.
2023-03-30 10:54:11 +02:00
Mathias Vorreiter Pedersen
64a08cefd7 C++: Add change note. 2023-03-30 09:37:27 +01:00
Tony Torralba
3102199a69 Make LocalUserInputToArgumentToExecFlowConfig and LocalUserInputToArgumentToExecFlow importable 2023-03-30 10:24:23 +02:00
Tony Torralba
534725f9eb Add command injection sink kind 2023-03-30 10:17:35 +02:00
Rasmus Wriedt Larsen
f3937a4a12 Python: Update .expected from PostUpdateNode commit 2023-03-30 10:17:33 +02:00
Mathias Vorreiter Pedersen
6275a015a4 Merge pull request #12708 from MathiasVP/dont-break-ir-cfg-on-vla
C++: Don't produce partial CFGs when using VLAs
2023-03-30 09:16:10 +01:00
Michael Nebel
31e352afb0 C#: Actually add the deprecated keyword to the deprecated classes. 2023-03-30 09:45:49 +02:00
Jeroen Ketema
ade02d80cf C++: Match SemZeroBound handling of mul case in rem case 2023-03-30 09:10:55 +02:00
Paolo Tranquilli
aeaeade75e Merge pull request #12706 from github/alexdenisov/consider-non-swift-modules-as-lazy
Swift: consider declarations from non-swift modules as lazy
2023-03-30 08:40:53 +02:00
Raul Garcia
cf8a683d7d Merge branch 'main' into main 2023-03-29 20:27:03 -07:00
Raul Garcia
05137d0c54 Merge pull request #32 from RasmusWL/azure-blob-client
`py/azure-storage/unsafe-client-side-encryption-in-use` updates
2023-03-29 20:26:25 -07:00
Ed Minnix
58ad8e4292 ExternallyControlledFormatString change note 2023-03-29 22:43:26 -04:00
Ed Minnix
312508e279 Documentation for IntentUriPermissionManipulationQuery 2023-03-29 22:33:10 -04:00
Ed Minnix
cf7aa2e420 Documentation UnsafeDeserializationQuery 2023-03-29 22:33:10 -04:00
Ed Minnix
1a89c3fa7c Documentation for AndroidSensitiveCommunicationQuery 2023-03-29 22:33:10 -04:00
Ed Minnix
1016b7323f Documentation for ConditionalBypassQuery 2023-03-29 22:33:10 -04:00
Ed Minnix
96cf4f16fa Documentation for ExternalAPIs 2023-03-29 22:33:10 -04:00
Ed Minnix
c7fd216c3c Documentation for RsaWithoutOaepQuery 2023-03-29 22:33:10 -04:00
Ed Minnix
11d72ffc1f Documentation for UnsafeContentUriResolutionQuery 2023-03-29 22:33:10 -04:00
Ed Minnix
59b1460c49 Documentation for UnsafeCertTrustQuery 2023-03-29 22:33:09 -04:00
Ed Minnix
a798b1959f Replace flow(_, sink) with flowTo(sink) 2023-03-29 22:33:09 -04:00
Ed Minnix
d24c5071d8 Move private helper method out of module 2023-03-29 22:33:09 -04:00
Ed Minnix
a119b99f92 Documentation additions 2023-03-29 22:33:09 -04:00
Ed Minnix
6a3eadf6cb Refactor ImplicitPendingIntents 2023-03-29 22:33:09 -04:00
Ed Minnix
8621a49645 Remove unnecessary private markers 2023-03-29 22:33:09 -04:00
Ed Minnix
42b582da2f Refactor StaticInitializationVector 2023-03-29 22:33:09 -04:00
Ed Minnix
469ac80d40 Refactor PartialPathTraversal 2023-03-29 22:33:09 -04:00
Ed Minnix
f8e26f1571 Refactor MissingJWTSignatureCheck 2023-03-29 22:33:09 -04:00
Ed Minnix
cae5637d8d Refactor InsufficientKeySize 2023-03-29 22:33:09 -04:00
Ed Minnix
fa2f0dbc3b Refactor InsecureBasicAuth 2023-03-29 22:33:09 -04:00
Ed Minnix
dcd46c2236 Refactor InsecureTrustManager 2023-03-29 22:33:09 -04:00
Ed Minnix
3b2eea2d44 Refactor XxeQuery 2023-03-29 22:33:09 -04:00
Ed Minnix
7262c6a097 Refactor XmlParsers.qll 2023-03-29 22:33:09 -04:00
Ed Minnix
da718610e8 Refactor HttpsUrlsQuery.qll 2023-03-29 22:33:09 -04:00
Ed Minnix
c67b984fff Refactor RandomQuery.qll 2023-03-29 22:33:09 -04:00
Ed Minnix
2698b61514 Refactor HardcodedCredentialsApiCall.qll 2023-03-29 22:33:08 -04:00
Ed Minnix
e8f7e3fcf1 Refactor ExternalAPIs.qll 2023-03-29 22:33:08 -04:00
Ed Minnix
ac8dec740a Refactor UnsafeCertTrustQuery 2023-03-29 22:33:08 -04:00
Ed Minnix
a040ff6997 Refactor ConditionalBypass 2023-03-29 22:33:08 -04:00
Ed Minnix
aa7934161a Refactor CleartextStorage libraries 2023-03-29 22:33:08 -04:00
Ed Minnix
b4130e650d Refactor RegexFlowConfigs.qll 2023-03-29 22:33:08 -04:00
Ed Minnix
6681c1a3a8 Refactor SnakeYaml.qll 2023-03-29 22:33:08 -04:00
Ed Minnix
e5f11d00a7 Refactor CWE-502/UnsafeDeserialization 2023-03-29 22:33:08 -04:00
Ed Minnix
9afa051621 Move ExternallyControlledFormatStringFlow to Query.qll 2023-03-29 17:59:34 -04:00
Ed Minnix
7d9fad5733 Add change note 2023-03-29 17:59:33 -04:00
Ed Minnix
3eaa94a5d2 Move ResponseSplitting configuration to ResponseSplittingQuery.qll 2023-03-29 17:59:33 -04:00
Ed Minnix
e3af8b2c7f Move LdapInjectionLib to LdapInjectionQuery.qll 2023-03-29 17:59:33 -04:00
Ed Minnix
1add692643 Move XssConfig to XssQuery.qll 2023-03-29 17:59:33 -04:00
Ed Minnix
19a94a5c13 Move InsecureBeanValidation configuration to Query.qll 2023-03-29 17:59:33 -04:00
Ed Minnix
367042bcff Move ZipSlip configurations to Query.qll library 2023-03-29 17:59:33 -04:00
Ed Minnix
ce2cab0d2e Move TaintedPath configurations to Query.qll 2023-03-29 17:59:33 -04:00
Edward Minnix III
434b1b35d8 Merge pull request #12698 from egregius313/egregius313/java/refactor-commandline-query-and-request-forgery
Java: Refactor CommandLineQuery.qll and RequestForgeryConfig.qll
2023-03-29 17:49:51 -04:00
Tom Hvitved
6af973a8a6 Merge pull request #12704 from github/hvitved-patch-1 2023-03-29 21:18:23 +02:00
Ed Minnix
744f2653f0 Add QLdoc for RemoteUserInputToArgumentToExecFlow 2023-03-29 11:45:09 -04:00
Ed Minnix
a3c1d08a59 Fix ExecUnescaped 2023-03-29 11:45:09 -04:00
Ed Minnix
25359d2218 Deprecate execTainted 2023-03-29 11:45:09 -04:00
Ed Minnix
dcd703f1a9 Update to the TaintTracking::Global api 2023-03-29 11:45:09 -04:00
Ed Minnix
bbf7c67f9b Remove unnecessary private markers (CommandLine and Request forgery) 2023-03-29 11:45:09 -04:00
Ed Minnix
0249890747 Refactor CommandLineQuery.qll 2023-03-29 11:45:09 -04:00
Gulshan Singh
abec99badb C++: Add getSizeExpr and getSizeMult predicates to BufferAccess 2023-03-29 08:26:00 -07:00
Edward Minnix III
117a983423 Merge pull request #12639 from egregius313/egregius313/java/refactor-injection-queries
Java: Refactor injection queries to new dataflow API
2023-03-29 11:02:18 -04:00
Geoffrey White
fcefd03b14 Swift: Fill out the upgrade/downgrade scripts. 2023-03-29 15:54:08 +01:00
Geoffrey White
d5928e150d Swift: Prepare upgrade/downgrade scripts. 2023-03-29 15:51:42 +01:00
Geoffrey White
704e42cf22 Swift: Accept integration test changes (not sure what caused this exactly but it looks OK to me). 2023-03-29 15:49:44 +01:00
Geoffrey White
8e4c7a9d89 Swift: Test expectations. 2023-03-29 15:49:36 +01:00
Geoffrey White
4ba8de4802 Swift: Update codegen. 2023-03-29 15:49:26 +01:00
Geoffrey White
f042195e5c Swift: Connect it up. 2023-03-29 15:49:17 +01:00
Geoffrey White
d8703210dd Swift: Extract type aliases. 2023-03-29 15:49:12 +01:00
Arthur Baars
cc100ea746 Ruby: update supported version to 3.2 2023-03-29 16:15:41 +02:00
Mathias Vorreiter Pedersen
65c7a504b2 C++: Accept test changes. 2023-03-29 15:08:50 +01:00
Jeroen Ketema
edfd8715c8 Merge pull request #12695 from jketema/swift-configsig
Swift: Refactor a number of queries to use `DataFlow::ConfigSig`
2023-03-29 16:07:47 +02:00
Paolo Tranquilli
92197bf9f2 Codegen: fix autopep8 pre-commit hook 2023-03-29 15:57:45 +02:00
Mathias Vorreiter Pedersen
e3e68b7753 Merge pull request #12642 from geoffw0/modernstring
Swift: Modernize the swift/string-length-conflation query
2023-03-29 14:55:40 +01:00
Paolo Tranquilli
48c2303391 Swift: add upgrade/downgrade scripts 2023-03-29 15:44:07 +02:00
Paolo Tranquilli
20128adee4 Swift: make imported and exported modules a set 2023-03-29 15:44:07 +02:00
Paolo Tranquilli
d7a3cb2d01 Codegen: implement set in ql test generation 2023-03-29 15:44:07 +02:00
Paolo Tranquilli
d5ee728657 Codegen: implement set in qlgen (excluding QL tests) 2023-03-29 15:44:07 +02:00
Paolo Tranquilli
00b59f83f2 Codegen: disallow child on set properties 2023-03-29 15:44:06 +02:00
Paolo Tranquilli
442e85099b Codegen: implement set in cppgen 2023-03-29 15:44:06 +02:00
Paolo Tranquilli
eef140c3fc Codegen: implement set in dbschemegen 2023-03-29 15:44:06 +02:00
Paolo Tranquilli
bba5d9dbd6 Codegen: add set to schema definitions 2023-03-29 15:44:06 +02:00
Mathias Vorreiter Pedersen
27d8f98418 C++: Replace 'int' with 'float' in tests and accept test changes. 2023-03-29 14:27:37 +01:00
Mathias Vorreiter Pedersen
a2c0e36062 C++: Accept test changes. 2023-03-29 14:25:05 +01:00
Mathias Vorreiter Pedersen
4d8159c581 C++: Disable rounding. 2023-03-29 14:23:05 +01:00
Mathias Vorreiter Pedersen
6dd45b31e1 Merge pull request #12696 from MathiasVP/range-analysis-of-mul-expr
C++: IR-based range analysis of multiplication
2023-03-29 14:05:55 +01:00
Mathias Vorreiter Pedersen
3bd193f721 C++: Fix Code Scanning errors. 2023-03-29 14:02:34 +01:00
Mathias Vorreiter Pedersen
0e9ed989e0 C++: Accept test changes. 2023-03-29 14:01:01 +01:00
Mathias Vorreiter Pedersen
fb6e45b6f4 C++: Emit a NoOp during CFG construction for VLAs. 2023-03-29 13:58:39 +01:00
Mathias Vorreiter Pedersen
d4746e0508 C++: Add test with VLA. 2023-03-29 13:58:24 +01:00
Ian Lynagh
4fa1bbf018 Java: Allow keys to be omitted from ExtractorInformation.ql
This is useful in tests, as some keys contain unstable information.
2023-03-29 13:10:17 +01:00
Alex Denisov
069598c9e1 Swift: consider declarations from non-swift modules as lazy
This change fixes all of the VALUE_NOT_IN_TYPE errors I'm seeing with
the integration tests on macOS.
2023-03-29 14:02:56 +02:00
Mathias Vorreiter Pedersen
9d5c785d89 C++: Even more fix'ing QLDoc. 2023-03-29 12:45:27 +01:00
Mathias Vorreiter Pedersen
09d0385f0f C++: Fix QLDoc. 2023-03-29 12:42:32 +01:00
Mathias Vorreiter Pedersen
c14bccf7eb C++: Fix QLDoc. 2023-03-29 12:41:04 +01:00
Anders Schack-Mulligen
d0fa7c7ff8 Merge pull request #12683 from aschackmull/java/rangeanalysis-add
Java: Support double-recursive range analysis bounds for addition.
2023-03-29 13:39:59 +02:00
Paolo Tranquilli
f938fde6eb Merge branch 'main' into redsun82/swift-fix-wmo 2023-03-29 13:33:11 +02:00
Mathias Vorreiter Pedersen
fe487a1ae8 C++: Respond to PR reviews. 2023-03-29 12:30:24 +01:00
Tom Hvitved
e91b5de875 Run Ruby QL tests on changes to shared 2023-03-29 13:27:06 +02:00
Ed Minnix
c8579d8c26 RegexInjection docs 2023-03-29 07:24:32 -04:00
Ed Minnix
17cdd16c19 Fix miscopied isBarrier in JndiInjectionQuery 2023-03-29 07:23:13 -04:00
Rasmus Wriedt Larsen
34cbaf10c2 Python: Use PostUpdateNode in py/azure-storage/unsafe-client-side-encryption-in-use 2023-03-29 13:22:21 +02:00
Michael Nebel
483e5c5264 C#: Re-factor ExposureOfPrivateInformation to use the new API. 2023-03-29 13:19:56 +02:00
Michael Nebel
cc4f3f6234 C#: Re-factor CodeInjection to use the new API. 2023-03-29 13:19:56 +02:00
Michael Nebel
60c5bbde0f C#: Re-factor ConditionalBypass to use the new API. 2023-03-29 13:19:56 +02:00
Michael Nebel
cab976cf8f C#: Re-factor CommandInjection to use the new API. 2023-03-29 13:19:56 +02:00
Michael Nebel
c03ce2f63b C#: Re-factor HardCodedSymmetricEncryptionKey to use the new API. 2023-03-29 13:19:56 +02:00
Michael Nebel
5278bbcaaa C#: Re-factor SymmetricKeyTaintTrackingConfiguration to use the new API. 2023-03-29 13:19:56 +02:00
Paolo Tranquilli
2cfecac545 Swift: remove debug prints 2023-03-29 13:14:44 +02:00
Jeroen Ketema
0acca2ba76 Merge pull request #12687 from jketema/unit-2
Make imports of `codeql.util.Unit` private
2023-03-29 13:07:12 +02:00
Mathias Vorreiter Pedersen
1dd3e385ab Merge pull request #12133 from d10c/swift/case-let-dataflow
Swift: `case let` dataflow
2023-03-29 11:31:48 +01:00
Nora Dimitrijević
d0de4a5d93 Merge branch 'main' into swift/case-let-dataflow 2023-03-29 11:55:34 +02:00
Nora Dimitrijević
70ed8c6e8f Swift: add QLdoc to Pattern 2023-03-29 11:52:50 +02:00
Nora Dimitrijević
3fbf90cbd7 Swift: add ConstructorDecl.isFailable/0 2023-03-29 11:52:50 +02:00
Tamás Vajk
08d2d3b96b Merge pull request #12699 from tamasvajk/fix/ruby-makefile
Ruby: Adjust Makefile after shared library refactoring
2023-03-29 11:48:24 +02:00
Rasmus Wriedt Larsen
86333e3ba5 Python: Remove duplicate results from azure blob query 2023-03-29 11:47:29 +02:00
Rasmus Wriedt Larsen
32d52c023e Python: Allow any order for azure blob query
By only allowing the sink in the state where encryption v1 is used, we
can handle the new case where the order of attribute assignment is
flipped.

However, we get a few too many paths because we can have multiple
sources reaching the same sink... let's fix in next commit.
2023-03-29 11:42:01 +02:00
Anders Schack-Mulligen
7844384768 Java: Add change note. 2023-03-29 11:39:07 +02:00
Rasmus Wriedt Larsen
480f171d9b Python: Add azure blob tests with swapped order
Just shows we need to use some state in the query to get the correct
behavior.
2023-03-29 11:25:37 +02:00
Rasmus Wriedt Larsen
683985a00a Python: Expand azure blob modeling
Now we can differentiate between the classes
2023-03-29 11:24:36 +02:00
Paolo Tranquilli
f3f17791c3 Swift: extract all source files in WMO mode
WMO stands for whole module optimization. It's a compilation mode where
all sources of a module are compiled together, e.g.
```
swift-frontend -emit-module A.swift B.swift -o Module.swiftmodule
```
This is opposed to incremental mode, where one would do something like
```
swift-frontend -emit-module -primary-file A.swift B.swift -module-name Module -o Module~A.swiftmodule
swift-frontend -emit-module A.swift -primary-file B.swift -module-name Module -o Module~B.swiftmodule
swift-frontend -merge-modules Module~A.swiftmodule Module~B.swiftmodule -o Module.swiftmodule
```

In WMO mode we were skipping extraction of all files after the first
one, because we were filtering in only files with an associated output,
and internally swift only assigns the output to the first input file in
WMO mode (which is just an implementation detail).

This patch refines that filter, by getting all input source files in
case there are no primary inputs.
2023-03-29 10:39:58 +02:00
Asger F
f8e76b5347 Ruby: do not depend on trackDefNode in isDef 2023-03-29 10:31:42 +02:00
Asger F
2ef1743bf4 Merge pull request #11615 from asgerf/js/extension-docs
JS: docs for customizing library models with data extensions
2023-03-29 10:20:53 +02:00
Tamas Vajk
85d824b96b Ruby: Adjust Makefile after shared library refactoring 2023-03-29 10:12:10 +02:00
Edward Minnix III
e39318853f Merge pull request #12693 from atorralba/atorralba/java/insecure-ldap-auth-tag
Java: Fix InsecureLdapAuth tags
2023-03-28 14:56:56 -04:00
Nora Dimitrijević
55ce9760e1 Merge branch 'main' into swift/case-let-dataflow 2023-03-28 18:20:33 +02:00
Nora Dimitrijević
2a5f29cd0f Swift: remove getIdentityPreservingEnclosingPattern
The Pattern public interface doesn't really need it.
2023-03-28 18:18:32 +02:00
Mathias Vorreiter Pedersen
8021958ac5 C++: Accept test changes. 2023-03-28 16:50:18 +01:00
Mathias Vorreiter Pedersen
6699a0cb1a C++: Add range analysis for binary multiplication. 2023-03-28 16:50:18 +01:00
Jeroen Ketema
a381aa4d37 Swift: Use DataFlow::ConfigSig in InsufficientHashIterations.ql 2023-03-28 17:39:58 +02:00
Jeroen Ketema
60f033f10c Swift: Use DataFlow::ConfigSig in ConstantSalt.ql 2023-03-28 17:39:18 +02:00
Jeroen Ketema
b97b3d9975 Swift: Use DtatFlow::ConfigSig in InsecureTLS.ql 2023-03-28 17:38:46 +02:00
Jeroen Ketema
42248220b4 Swift: Use DataFlow::ConfigSig in WeakSensitiveDataHashing.ql 2023-03-28 17:38:11 +02:00
Jeroen Ketema
a8599eb689 Swift: Use DataFlow::ConfigSig in ECBEncryption.ql 2023-03-28 17:37:37 +02:00
Jeroen Ketema
cc23ba3698 Swift: Use DataFlow::ConfigSig in HardcodedEncryptionKey.ql 2023-03-28 17:37:05 +02:00
Jeroen Ketema
1592b578d9 Swift: Use DataFlow::ConfigSig in ConstantPassword.ql 2023-03-28 17:36:37 +02:00
Jeroen Ketema
31512b8627 Swift: Use DataFlow::ConfigSig in StaticInitializationVector.ql 2023-03-28 17:36:00 +02:00
Asger F
080acdbfff JS: remove links to docs file... again 2023-03-28 17:29:26 +02:00
smiddy007
0eb61d39d3 formatting 2023-03-28 11:28:32 -04:00
smiddy007
fe3b0a56ca Removed unnecessary field 2023-03-28 11:27:23 -04:00
smiddy007
8e9f2185c8 Merge branch 'main' into improve-insufficient-pw-hash-query 2023-03-28 11:15:10 -04:00
smiddy007
123eb1e57b Update javascript/ql/lib/semmle/javascript/frameworks/CryptoLibraries.qll
Co-authored-by: Asger F <asgerf@github.com>
2023-03-28 11:14:28 -04:00
Tony Torralba
ce191e1f9f Fix InsecureLdapAuth tags 2023-03-28 17:10:33 +02:00
Edward Minnix III
b00104ebe3 Merge pull request #12458 from egregius313/egregius313/promote-insecure-ldap-authentication
Java: Promote LDAP Authentication Query
2023-03-28 10:39:17 -04:00
Edward Minnix III
97ec808a6f Make configuration public
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-28 10:28:15 -04:00
Erik Krogh Kristensen
13c0effbd2 change to minor change 2023-03-28 15:27:16 +02:00
erik-krogh
4b3a419509 just use quoteWithBackticks 2023-03-28 15:23:15 +02:00
Erik Krogh Kristensen
451f6f01bb Merge pull request #12633 from erik-krogh/more-global-flow
JS: better callgraph support for global variables
2023-03-28 15:19:50 +02:00
Nora Dimitrijević
94614320b5 Swift: refactor OptionalSomeDecl -> OptionalSomeContentSet 2023-03-28 15:15:16 +02:00
Anders Schack-Mulligen
7c74fd07e9 Merge pull request #12684 from aschackmull/dataflow/remove-footgun
Dataflow: Remove accidentally exposed predicates.
2023-03-28 15:14:58 +02:00
Michael Nebel
9966e09fd7 C#: Add operator dataflow test case with checked and unchecked examples. 2023-03-28 15:05:48 +02:00
Michael Nebel
50c3c159a9 C#: Make checked and unchecked as a local flow step. 2023-03-28 15:03:33 +02:00
Nora Dimitrijević
ea9e8e7ddb Swift: fix bad join order in Pattern.getImmediateMatchingExpr
On Signal-iOS, this snippet:

```codeql
class Pattern extends Generated::Pattern {
  ...
  Expr getImmediateMatchingExpr() {
    ...
    exists(PatternBindingDecl v, int i |
      v.getPattern(i) = this and
      result = v.getInit(i)
    )
    ...
  }
  ...
}
```

Had the following join order:

```
             33926   ~0%    {3} r8 = SCAN PatternBindingDecl#ab5153b9::Generated::PatternBindingDecl::getImmediateInit#1#dispred#fff OUTPUT In.1, In.0, In.2
        2565045964   ~0%    {4} r9 = JOIN r8 WITH pattern_binding_decl_patterns_102#join_rhs ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2, Rhs.2
             33926   ~0%    {2} r10 = JOIN r9 WITH Synth#5f134a93::Synth::convertPatternBindingDeclToRaw#1#ff ON FIRST 2 OUTPUT Lhs.3, Lhs.2
             33926   ~2%    {2} r11 = JOIN r10 WITH Synth#5f134a93::Synth::convertPatternFromRaw#1#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1
             33926   ~1%    {2} r12 = JOIN r11 WITH Element#e67432df::Generated::Element::resolve#ff ON FIRST 1 OUTPUT Lhs.1, Rhs.1
             33926   ~4%    {2} r13 = JOIN r12 WITH Element#e67432df::Generated::Element::resolve#ff ON FIRST 1 OUTPUT Lhs.1, Rhs.1
```

After applying `pragma[only_bind_out]` to `this`:

```
        198815   ~1%    {2} r4 = SCAN Synth#5f134a93::Synth::TPattern#f OUTPUT In.0, In.0
        198815   ~0%    {2} r5 = JOIN r4 WITH Element#e67432df::Generated::Element::resolve#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1
         75626   ~0%    {3} r6 = JOIN r5 WITH PatternBindingDecl#ab5153b9::Generated::PatternBindingDecl::getImmediatePattern#1#dispred#fff_201#join_rhs ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.1
         33926   ~1%    {2} r7 = JOIN r6 WITH PatternBindingDecl#ab5153b9::Generated::PatternBindingDecl::getImmediateInit#1#dispred#fff ON FIRST 2 OUTPUT Rhs.2, Lhs.2
         33926   ~4%    {2} r8 = JOIN r7 WITH Element#e67432df::Generated::Element::resolve#ff ON FIRST 1 OUTPUT Lhs.1, Rhs.1

```
2023-03-28 14:57:05 +02:00
Jeroen Ketema
3b8ad087eb Make imports of codeql.util.Unit private 2023-03-28 14:14:13 +02:00
Michael Nebel
042e53aa4a Merge pull request #12688 from michaelnebel/csharp/documentation
C#: Claim support for C# 11 / .NET 7 in external documentation.
2023-03-28 14:02:51 +02:00
Anders Schack-Mulligen
3b0095725c Java: Adjust test expectation. 2023-03-28 14:00:25 +02:00
Anders Schack-Mulligen
47e7aa9566 Dataflow: Add change note. 2023-03-28 13:17:48 +02:00
Michael Nebel
e38196a3a8 C#: Claim support for C# 11 / .NET 7 in external documentation. 2023-03-28 13:04:30 +02:00
Asger F
61a7ee9387 JS: Use getABoundFunctionValue instead of type-tracking 2023-03-28 12:56:03 +02:00
erik-krogh
70dfa6e15c use StringUtil.quoteWithBackticks instead of manually quoting with a single backtick 2023-03-28 12:34:44 +02:00
Asger F
02da09c7d8 Update docs/codeql/codeql-language-guides/customizing-library-models-for-javascript.rst
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-28 11:36:24 +02:00
Mathias Vorreiter Pedersen
4b2758f1b5 Merge branch 'main' into skip-safe-conversions-in-range-analysis 2023-03-28 10:32:13 +01:00
Tony Torralba
12b236f6f1 Merge pull request #12682 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-28 11:27:19 +02:00
erik-krogh
e5e20ab42c add backticks around the concrete parse error 2023-03-28 10:57:13 +02:00
Asger F
d62b944b93 JS: Explain difference between type and member 2023-03-28 10:49:28 +02:00
Arthur Baars
cd53c77e23 Merge pull request #12670 from alexrford/mergeback-rc/3.9
Merge `rc/3.9` back into `main`
2023-03-28 10:49:08 +02:00
Asger F
aec82f6ef8 Update docs/codeql/codeql-language-guides/customizing-library-models-for-javascript.rst
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-03-28 10:12:38 +02:00
Asger F
04b28c5118 Merge branch 'main' into js/extension-docs 2023-03-28 10:12:22 +02:00
Rasmus Wriedt Larsen
8ea6b6f256 Python: Update py/azure-storage/unsafe-client-side-encryption-in-use to use datafow 2023-03-28 10:09:22 +02:00
Rasmus Wriedt Larsen
7a17cd2a9e Python: Rewrite azure query to more idiomatic ql 2023-03-28 10:06:00 +02:00
Rasmus Wriedt Larsen
691ffcd3a4 Python: Add tests of py/azure-storage/unsafe-client-side-encryption-in-use
Notice that it doesn't find the potentially unsafe version, or the vuln that spans calls.
2023-03-28 10:05:09 +02:00
Anders Schack-Mulligen
d406b051fc Dataflow: Remove accidentally exposed predicates. 2023-03-28 10:04:21 +02:00
Asger F
a5b1677cca Update docs/codeql/codeql-language-guides/customizing-library-models-for-javascript.rst
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-03-28 10:03:07 +02:00
Asger F
32bab0b8b2 Merge pull request #12654 from asgerf/rb/always-resolve-toplevel-namespace
RB: always resolve toplevel namespaces to their locally qualified name
2023-03-28 09:54:59 +02:00
Anders Schack-Mulligen
b5c66c514e Java: Support double-recursive range analysis bounds for addition. 2023-03-28 09:52:05 +02:00
yoff
a1a2eb356c Merge pull request #11515 from yoff/py/port-comparison-using-is
python: port `py/comparison-using-is`
2023-03-28 09:42:34 +02:00
Michael Nebel
730848cee8 Merge pull request #12648 from michaelnebel/csharp/cs-web-debug-binary
C#: Improve cs/web/debug-binary to repect the RemoveAttributes transformation.
2023-03-28 09:40:46 +02:00
yoff
a034f89d9d Merge pull request #12517 from yoff/python/fix-documentation-redirect-type-inference
python: Fix link to type inference
2023-03-28 09:38:55 +02:00
Michael Nebel
7283002dfa Merge pull request #12410 from michaelnebel/java/docs-models-as-data
Java: Docs MaD using extensions.
2023-03-28 09:21:07 +02:00
Tom Hvitved
e3799adbe0 Merge pull request #12612 from hvitved/ruby/print-ast-desugar-reorder
Ruby: Order synthetic children in PrintAST based on their index instead of location
2023-03-28 09:13:03 +02:00
Mathias Vorreiter Pedersen
58c7148669 Merge pull request #12655 from jketema/range-rem 2023-03-28 08:01:16 +01:00
github-actions[bot]
2573efa358 Add changed framework coverage reports 2023-03-28 00:17:02 +00:00
Jeroen Ketema
12da4f7814 C++: Address review comment 2023-03-28 00:33:46 +02:00
Jeroen Ketema
9303055013 C++: Address review comment 2023-03-28 00:33:46 +02:00
Jeroen Ketema
99c6111b05 C++: Add support for bounded modulus operations 2023-03-28 00:33:43 +02:00
Mathias Vorreiter Pedersen
724d97eabb C++: Make sign analysis aware of unsigned'ness and accept test changes. 2023-03-27 23:08:12 +01:00
Nora Dimitrijević
239e14b71a Swift: fix QLdoc check for EnumElementExpr.qll 2023-03-27 23:48:37 +02:00
Nora Dimitrijević
41b283c07c Swift: add .some enum content to init? calls
Again, this is hacky; we don't distinguish rigorously between an
optional value and its content (similar to how it was before enum
content flow).
2023-03-27 23:01:25 +02:00
Nora Dimitrijević
03122d76ce Swift: fix a bunch of MISSING dataflow test cases
Optional content flow through constructors remains.
2023-03-27 23:01:25 +02:00
Nora Dimitrijević
6a127264af Swift: distinguish between Pattern.get(Immediate)IdentityPreservingEnclosingPattern 2023-03-27 23:01:25 +02:00
Nora Dimitrijević
7dc793855b Swift: introduce Node.asPattern() 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
a715ebe826 Swift: distinguish Pattern.get(Immediate)EnclosingPattern 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
9353549629 Swift: fixes responding to comments 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
052a008926 Swift: Content-based dataflow through case let 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
5c795632db Swift: add Pattern.getEnclosingPattern() 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
c2e9ffab63 Swift: add EnumElementExpr + Pattern.getMatchingExpr() 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
5419e65e01 Swift: add NamedPattern.getVarDecl() 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
feb8243d5f Swift: move BindingPattern to the hidden AST 2023-03-27 23:01:24 +02:00
Nora Dimitrijević
9e8867aa96 Swift: update enum dataflow test with more cases 2023-03-27 23:01:23 +02:00
Mathias Vorreiter Pedersen
cbd4662696 Merge branch 'main' into skip-safe-conversions-in-range-analysis 2023-03-27 21:18:49 +01:00
smiddy007
82f8090e91 Merge branch 'main' into improve-insufficient-pw-hash-query 2023-03-27 15:37:02 -04:00
Robert Marsh
62d2f23904 Merge pull request #12673 from MathiasVP/range-analysis-of-add-expr
C++: IR-based range analysis of addition
2023-03-27 15:31:11 -04:00
smiddy007
55bcad5363 Merge branch 'main' into improve-insufficient-pw-hash-query 2023-03-27 15:21:57 -04:00
smiddy007
2caab8748e Merge branch 'improve-insufficient-pw-hash-query' of https://github.com/smiddy007/codeql into improve-insufficient-pw-hash-query 2023-03-27 15:20:24 -04:00
smiddy007
57ab5a06ae autoformatted 2023-03-27 15:20:08 -04:00
Ed Minnix
3d033fd727 Fix SqlConcatenated 2023-03-27 13:06:31 -04:00
Ed Minnix
9bfb13b942 Update to the Global/flow* api 2023-03-27 12:26:18 -04:00
Edward Minnix III
106e5e7145 Docs review suggestion
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
2023-03-27 12:16:44 -04:00
Edward Minnix III
43d79dc5b8 Apply docs review suggestions
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
2023-03-27 12:16:44 -04:00
Ed Minnix
0eaf222b54 Move public classes/predicates to top of library file 2023-03-27 12:16:44 -04:00
Ed Minnix
f28f1af5a4 Add InsecureLdapUrlSink 2023-03-27 12:16:44 -04:00
Edward Minnix III
24d4859149 Import changes
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-27 12:16:44 -04:00
Edward Minnix III
151357d02d Make classes/predicates not used outside of query private
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-27 12:16:44 -04:00
Ed Minnix
658c54a18f Change names of configuration to fit new naming convention 2023-03-27 12:16:44 -04:00
Ed Minnix
cb58936c08 Documentation changes 2023-03-27 12:16:44 -04:00
Ed Minnix
752620a34d Rename SSL configuration and fix PathGraph 2023-03-27 12:16:44 -04:00
Ed Minnix
efdfc2d0c3 Change version of PathNode used to appropriate module 2023-03-27 12:16:44 -04:00
Ed Minnix
59ce0d7682 Documentation changes 2023-03-27 12:16:44 -04:00
Ed Minnix
0f4709e769 Add change note 2023-03-27 12:16:44 -04:00
Ed Minnix
db60c08de7 Add security severity 2023-03-27 12:16:44 -04:00
Ed Minnix
6a0167fa7f Convert to using the new DataFlow modules 2023-03-27 12:16:44 -04:00
Ed Minnix
05da1dc4a3 Merge concatInsecureLdapString into InsecureLdapUrl constructor 2023-03-27 12:16:44 -04:00
Ed Minnix
98b445c6b7 Convert test to InlineExpectationsTest 2023-03-27 12:16:43 -04:00
Ed Minnix
3936aea690 Split Ldap query file into libraries 2023-03-27 12:16:43 -04:00
Ed Minnix
9275b54e97 Refactoring the InsecureLdapUrl constructor 2023-03-27 12:16:43 -04:00
Ed Minnix
938d953789 Refactor getLeftmostOperand method 2023-03-27 12:16:43 -04:00
Ed Minnix
5ff4fcbc76 Replace exists with any 2023-03-27 12:16:43 -04:00
Ed Minnix
57886e1713 Moved files from experimental to src/ 2023-03-27 12:16:43 -04:00
Chris Bellanti
6bf94e800b Added check to disabling certificate validation query 2023-03-27 12:16:20 -04:00
Taus
df192383b2 Merge pull request #9722 from ahmed-farid-dev/timing-attack-py 2023-03-27 18:09:35 +02:00
smiddy007
64b56ef107 Merge branch 'main' into improve-insufficient-pw-hash-query 2023-03-27 12:07:21 -04:00
smiddy007
3ef5f3070f small change 2023-03-27 12:02:35 -04:00
Mathias Vorreiter Pedersen
889dcfe2b2 Merge pull request #12674 from jketema/overrunning-join
C++: Fix join-order problem in cpp/overrun-write
2023-03-27 15:36:33 +01:00
Taus
a3c40a3ae4 Python: Add experimental tags 2023-03-27 14:23:36 +00:00
Rasmus Wriedt Larsen
0b9d16a43e Merge pull request #12636 from RasmusWL/sql-modeling
Python: Some more SQL modeling
2023-03-27 15:52:30 +02:00
Mathias Vorreiter Pedersen
9a57536f9f Merge branch 'main' into range-analysis-of-add-expr 2023-03-27 14:49:01 +01:00
Taus
af060e8c6b Merge branch 'main' into timing-attack-py 2023-03-27 15:27:13 +02:00
Erik Krogh Kristensen
d3c3f2dc90 Merge pull request #12628 from erik-krogh/betterReDoS
ReDoS: better super-linear algorithm
2023-03-27 15:26:49 +02:00
Asger F
32d7a80221 JS: Change note 2023-03-27 14:56:57 +02:00
Jeroen Ketema
213c4b0818 C++: Fix join-order problem in cpp/overrun-write
Before on Wireshark:
```
[2023-03-27 12:59:25] Evaluated non-recursive predicate OverrunWriteProductFlow#fb5ce006::isSinkPairImpl#5#fffff@2ba90584 in 99742ms (size: 52640).
Evaluated relational algebra for predicate OverrunWriteProductFlow#fb5ce006::isSinkPairImpl#5#fffff@2ba90584 with tuple counts:
        1047588019  ~1%    {3} r1 = JOIN DataFlowUtil#47741e1f::InstructionNode#fff_20#join_rhs WITH OverrunWriteProductFlow#fb5ce006::bounded#3#fff_102#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Rhs.2
          67558965  ~0%    {4} r2 = JOIN r1 WITH Instruction#577b6a83::CallInstruction::getArgument#fbf_201#join_rhs ON FIRST 1 OUTPUT Rhs.2, Lhs.1, Lhs.2, Rhs.1
         613572640  ~0%    {5} r3 = JOIN r2 WITH ArrayFunction#ca0b6b68::ArrayFunction::hasArrayWithVariableSize#2#dispred#fff_201#join_rhs ON FIRST 1 OUTPUT Lhs.3, Rhs.1, Lhs.1, Lhs.2, Rhs.2
             52640  ~0%    {4} r4 = JOIN r3 WITH Instruction#577b6a83::CallInstruction::getStaticCallTarget#0#dispred#ff ON FIRST 2 OUTPUT Lhs.0, Lhs.4, Lhs.2, Lhs.3
             52640  ~0%    {4} r5 = JOIN r4 WITH Instruction#577b6a83::CallInstruction::getArgument#fbf ON FIRST 2 OUTPUT Rhs.2, Lhs.2, Lhs.3, Lhs.0
             52640  ~0%    {5} r6 = JOIN r5 WITH DataFlowUtil#47741e1f::InstructionNode#fff_20#join_rhs ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Lhs.3, Rhs.1
             52640  ~0%    {5} r7 = JOIN r6 WITH Instruction#577b6a83::Instruction::getUnconvertedResultExpression#0#dispred#ff ON FIRST 1 OUTPUT Lhs.3, Lhs.4, Lhs.1, Lhs.2, Rhs.1
                           return r7
```

After:
```
[2023-03-27 13:56:36] Evaluated non-recursive predicate OverrunWriteProductFlow#fb5ce006::isSinkPairImpl#5#fffff@f936aapd in 777ms (size: 52640).
Evaluated relational algebra for predicate OverrunWriteProductFlow#fb5ce006::isSinkPairImpl#5#fffff@f936aapd with tuple counts:
        565480  ~5%    {2} r1 = SCAN Instruction#577b6a83::CallInstruction::getStaticCallTarget#0#dispred#ff OUTPUT In.1, In.0
          4420  ~1%    {3} r2 = JOIN r1 WITH ArrayFunction#ca0b6b68::ArrayFunction::hasArrayWithVariableSize#2#dispred#fff ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Rhs.2
          4420  ~0%    {3} r3 = JOIN r2 WITH Instruction#577b6a83::CallInstruction::getArgument#fff ON FIRST 2 OUTPUT Rhs.2, Lhs.2, Lhs.0
          4420  ~0%    {4} r4 = JOIN r3 WITH DataFlowUtil#47741e1f::InstructionNode#fff_20#join_rhs ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, Rhs.1
          4420  ~0%    {4} r5 = JOIN r4 WITH Instruction#577b6a83::Instruction::getUnconvertedResultExpression#0#dispred#ff ON FIRST 1 OUTPUT Lhs.2, Lhs.1, Lhs.3, Rhs.1
          4420  ~3%    {4} r6 = JOIN r5 WITH Instruction#577b6a83::CallInstruction::getArgument#fff ON FIRST 2 OUTPUT Rhs.2, Lhs.0, Lhs.2, Lhs.3
         52825  ~0%    {5} r7 = JOIN r6 WITH OverrunWriteProductFlow#fb5ce006::bounded#3#fff ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Rhs.2
         52640  ~0%    {5} r8 = JOIN r7 WITH DataFlowUtil#47741e1f::InstructionNode#fff_20#join_rhs ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1, Lhs.4, Lhs.3
                       return r8
```
2023-03-27 14:28:22 +02:00
Taus
700eb04487 Python: Lower precision of non-header queries
cf. https://github.com/github/securitylab/issues/691#issuecomment-1387391014
2023-03-27 12:22:17 +00:00
Mathias Vorreiter Pedersen
1a6186496f C++: Accept test changes. 2023-03-27 13:20:17 +01:00
Mathias Vorreiter Pedersen
87c144d33b C++: Throw away the sign analysis when analyzing add expressions: instead, we now recursively analyze both operands. 2023-03-27 13:19:47 +01:00
Taus
eaf2930205 Python: Accept test changes
(These look like they were the result of changes elsewhere in the
analysis.)
2023-03-27 12:17:13 +00:00
Taus
0b4c85f8d2 Python: Autoformat and fix broken module reference 2023-03-27 12:16:44 +00:00
Erik Krogh Kristensen
af8e44186c Merge pull request #12667 from github/dependabot/cargo/ql/regex-1.7.3
Bump regex from 1.7.2 to 1.7.3 in /ql
2023-03-27 13:59:18 +02:00
Geoffrey White
28998ccafe Merge pull request #12471 from geoffw0/dbsinks2
Swift: Better sinks for swift/cleartext-storage-database
2023-03-27 12:51:13 +01:00
Asger F
7b4951005b QL: Update test expectations 2023-03-27 13:47:29 +02:00
Asger F
0aceedac78 QL: Make Class.getType() only return ClassType
Previously this would return both the ClassCharType and ClassType
2023-03-27 13:39:01 +02:00
Tony Torralba
907053f281 Merge pull request #12591 from github/java/update-mad-decls-after-triage-2023-03-20T12-45-37
Java: Update MaD Declarations after Triage
2023-03-27 13:23:55 +02:00
Alex Ford
181e5d588d Merge remote-tracking branch 'origin/rc/3.9' into main 2023-03-27 12:16:03 +01:00
Alex Ford
ee6fa93007 Merge pull request #12657 from alexrford/rb/sensitive-get-no-path-problem
Ruby: convert `rb/sensitive-get-query` into a `@kind problem`
2023-03-27 12:08:27 +01:00
Joe Farebrother
489ce3d40a Merge pull request #12049 from joefarebrother/netty-models
Java: Model the Netty framework
2023-03-27 11:38:11 +01:00
Stephan Brandauer
6d91458586 Merge pull request #12506 from github/java/update-mad-decls-after-triage-2023-03-13T13-21-27
Java: Update MaD Declarations after Triage
2023-03-27 12:30:21 +02:00
Tony Torralba
7a9f1a5705 Add change note 2023-03-27 11:51:59 +02:00
Tony Torralba
95cc99c625 Apply suggestions from code review 2023-03-27 11:50:27 +02:00
Rasmus Wriedt Larsen
dab0abb563 Merge pull request #12428 from yoff/python/rewrite-InsecureContextConfiguration
Python: Clean up insecure context query
2023-03-27 11:46:01 +02:00
Tom Hvitved
f8c28bee6a Ruby: Order synthetic children in PrintAST based on their index instead of location 2023-03-27 11:38:30 +02:00
dependabot[bot]
f92f390457 Bump regex from 1.7.2 to 1.7.3 in /ql
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 09:34:18 +00:00
Arthur Baars
7e7cd54793 Merge pull request #12546 from hmac/extractor-shared-library
Introduce a shared extractor library
2023-03-27 11:32:33 +02:00
Arthur Baars
4964f86df5 Merge pull request #12540 from aibaars/destructured-assign
Ruby: change evaluation order of destructured assignments
2023-03-27 11:30:44 +02:00
Asger F
92a681213d JS: Step through jQuery callback return values 2023-03-27 11:17:27 +02:00
Asger F
bc2a772f3b JS: Add test case showing false negative 2023-03-27 11:08:39 +02:00
Alex Ford
6f08447427 Ruby: add a change note for rb/sensitive-get-query flow path removal 2023-03-27 09:45:23 +01:00
Alex Ford
24aa16c919 Ruby: update rb/sensitive-get-query test output 2023-03-27 09:44:55 +01:00
Michael Nebel
4a64479551 C#: Add change note. 2023-03-27 10:42:14 +02:00
Michael Nebel
32ea8420a9 C#: Move the existing tests into separate folders to emulate separate projects and add some more tests. 2023-03-27 10:42:14 +02:00
Alex Ford
15c9e7666a Ruby: convert rb/sensitive-get-query into a @kind problem 2023-03-27 09:42:10 +01:00
Michael Nebel
9f88a72d9f C#: Make cs/web/debug-binary respect transformation file RemoveAttribute. 2023-03-27 10:39:44 +02:00
Tony Torralba
ea1ca03bf1 Add change note 2023-03-27 10:30:47 +02:00
Tony Torralba
9a18043d9f Apply suggestions from code review 2023-03-27 10:28:13 +02:00
yoff
2121ed784f Merge branch 'main' into python/rewrite-InsecureContextConfiguration 2023-03-27 10:20:53 +02:00
Tony Torralba
6b265104cf Merge pull request #12662 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-27 09:33:27 +02:00
Jeroen Ketema
d65b9ef32c Merge pull request #12661 from geoffw0/elementstests
C++: Restrict tests that output all elements
2023-03-27 09:04:11 +02:00
Jeroen Ketema
977f15f8a4 Merge pull request #12649 from jketema/unit
Replace all definitions of `Unit` by `import codeql.util.Unit`
2023-03-27 08:49:50 +02:00
smiddy007
4980948613 changenote 2023-03-26 23:07:32 -04:00
smiddy007
cef6b95b15 Fixed Conflicts due to recent changes to file 2023-03-26 22:32:34 -04:00
smiddy007
ad527b8f69 Added new example files and renamed existing ones 2023-03-26 21:53:22 -04:00
smiddy007
ccf152df00 Added support for progressive hashing in crypto-js module 2023-03-26 21:29:55 -04:00
github-actions[bot]
7aca5ee534 Add changed framework coverage reports 2023-03-27 00:16:27 +00:00
Geoffrey White
202a717085 C++: Autoformat. 2023-03-24 22:10:51 +00:00
Raul Garcia
4ba1740c45 Merge branch 'main' into main 2023-03-24 14:56:07 -07:00
Harry Maclean
6b2e8847f5 Rename shared extractor
It is now called `tree-sitter-extractor`, to make it clearer that it
builds on tree-sitter grammars.
2023-03-25 10:43:07 +13:00
Harry Maclean
2b6cbc836d Ruby: Remove outdated cache path 2023-03-25 10:39:41 +13:00
Geoffrey White
536c1939c0 C++: ... and rename the test to fit. 2023-03-24 19:50:13 +00:00
Geoffrey White
7096318884 C++: Focus the templates extern test on Declarations. 2023-03-24 19:50:13 +00:00
Geoffrey White
b5de2a5985 C++: Focus the lambda captures test on stuff inside the lambdas (including some that don't currently have locations). 2023-03-24 19:50:13 +00:00
Geoffrey White
d5b9cea4bc C++: Focus the CPP-205 test on the templates. 2023-03-24 17:45:36 +00:00
Henry Mercer
c68c83c516 Merge pull request #12659 from github/henrymercer/merge-back-3.9
Merge `rc/3.9` back to `main`
2023-03-24 17:38:07 +00:00
Henry Mercer
fc105ffa4b Merge branch 'rc/3.9' into henrymercer/merge-back-3.9 2023-03-24 17:21:27 +00:00
Geoffrey White
41a5dc8efe C++: Restrict tests that report all Elements to Elements in files. 2023-03-24 17:06:47 +00:00
Mathias Vorreiter Pedersen
125c013052 Merge branch 'main' into skip-safe-conversions-in-range-analysis 2023-03-24 17:01:11 +00:00
Mathias Vorreiter Pedersen
86cc59e7db Merge pull request #12650 from gsingh93/strlen-literal-range-expr
C++: Add StrlenLiteralRangeExpr
2023-03-24 16:58:16 +00:00
Arthur Baars
3b12ddfdc2 Address comments 2023-03-24 16:58:53 +01:00
Arthur Baars
052bc95639 Ruby: add change note 2023-03-24 16:58:53 +01:00
Arthur Baars
9a8e138684 Ruby: also change evaluation order for scoped constants 2023-03-24 16:57:55 +01:00
Arthur Baars
a819797508 Ruby: add test case of destructured assignment with contants 2023-03-24 16:57:39 +01:00
Arthur Baars
8b90d021fa Ruby: change evaluation order of destructured assignments 2023-03-24 16:57:25 +01:00
Gulshan Singh
b87f12d5b2 C++: Add StrlenLiteralRangeExpr 2023-03-24 08:51:35 -07:00
Edward Minnix III
bb27ba7d3c Merge pull request #12632 from egregius313/egregius313/java/android/refactor-android-query-libraries
Java: Refactor Android `Query.qll` libraries to new dataflow api
2023-03-24 11:18:57 -04:00
Stephan Brandauer
4b458b2898 Merge branch 'main' into java/update-mad-decls-after-triage-2023-03-20T12-45-37 2023-03-24 16:17:07 +01:00
Stephan Brandauer
2c49e62c64 Merge branch 'main' into java/update-mad-decls-after-triage-2023-03-13T13-21-27 2023-03-24 16:16:57 +01:00
Taus
11c89adbe3 Merge branch 'main' into timing-attack-py 2023-03-24 15:40:33 +01:00
Henry Mercer
f1fe7af4fb Merge pull request #12651 from github/dependabot/github_actions/actions/stale-8
Bump actions/stale from 7 to 8
2023-03-24 14:27:58 +00:00
Ed Minnix
fcd53a8555 Deprecate old predicate 2023-03-24 10:07:40 -04:00
Ed Minnix
e7bad4cd90 Refactor to DataFlow::Global 2023-03-24 10:04:46 -04:00
Geoffrey White
c158f8331a Swift: Fix regression. 2023-03-24 14:04:10 +00:00
Ed Minnix
899200a9c9 Remove unnecessary private markers 2023-03-24 09:57:55 -04:00
Ed Minnix
f6b8d89756 Refactor GroovyInjectionQuery 2023-03-24 09:57:55 -04:00
Ed Minnix
bf5f82bb78 Refactor SqlInjectionQuery 2023-03-24 09:57:55 -04:00
Ed Minnix
fec80973a9 Refactor SpelInjectionQuery 2023-03-24 09:57:55 -04:00
Ed Minnix
787b73317d Refactor TemplateInjection 2023-03-24 09:57:55 -04:00
Ed Minnix
7e1c42442a Refactor OgnlInjection 2023-03-24 09:57:55 -04:00
Ed Minnix
3116e306b1 Refactor MvelInjection 2023-03-24 09:57:55 -04:00
Ed Minnix
423ab1d9cf Refactor JndiInjection 2023-03-24 09:57:54 -04:00
Ed Minnix
8bf3315bb5 Refactor JexlInjection 2023-03-24 09:57:54 -04:00
Ed Minnix
7ee6c06f7f Refactor RegexInjectionQuery 2023-03-24 09:57:54 -04:00
Ed Minnix
c44254e2e0 Refactor XsltInjection 2023-03-24 09:57:54 -04:00
Anders Schack-Mulligen
6db8c8b19f Merge pull request #12656 from aschackmull/dataflow/qldoc
Dataflow: Minor qldoc fix
2023-03-24 14:57:39 +01:00
Ed Minnix
1bf4dd9649 Update to DataFlow::Global 2023-03-24 09:54:53 -04:00
Asger F
f6900bd807 JS: Rephrase a few sentences 2023-03-24 14:54:13 +01:00
Ed Minnix
2eea34dc4a Apply suggestions from code review 2023-03-24 09:47:50 -04:00
Edward Minnix III
c62eaba601 Simulate deprecated import
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2023-03-24 09:47:50 -04:00
Ed Minnix
8cc2a7329e Fix test to use new InlineFlowTest 2023-03-24 09:47:50 -04:00
Ed Minnix
58bd2f7fa2 Address code review comments 2023-03-24 09:47:50 -04:00
Ed Minnix
e7f6d53907 Deprecate WebViewDubuggingQuery.qll 2023-03-24 09:47:50 -04:00
Ed Minnix
ef08a91340 Refactor ImproperIntentVerificationQuery.qll 2023-03-24 09:47:50 -04:00
Ed Minnix
413a6cbc4f Refactor SensitiveKeyboardCacheQuery 2023-03-24 09:47:50 -04:00
Ed Minnix
d68bec98bc Refactor CWE-940/AndroidIntentRedirection 2023-03-24 09:47:50 -04:00
Ed Minnix
1e0c6811a4 Refactor UnsafeAndroidAccess 2023-03-24 09:47:50 -04:00
Ed Minnix
807588a031 Refactor AndroidCertificatePinningQuery 2023-03-24 09:47:50 -04:00
Ed Minnix
768102ee92 Refactor java/android/webview-debugging-enabled 2023-03-24 09:47:50 -04:00
Asger F
2a57b00a13 JS: Above -> previous section 2023-03-24 14:41:35 +01:00
Asger F
8b7ab28f25 JS: Add "In the next section..." 2023-03-24 14:40:06 +01:00
Asger F
4a418b1f29 Apply suggestion from code review (execa) 2023-03-24 14:37:30 +01:00
Asger F
06c7160916 JS: Extension point -> extensible predicate 2023-03-24 14:29:02 +01:00
Michael Nebel
c45c2ff842 Add google doc link. 2023-03-24 14:24:21 +01:00
Asger F
395a9f0e8c Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-24 14:21:39 +01:00
Jeroen Ketema
559f6a5f20 Merge pull request #12652 from jketema/global-rename
C++: Rename `SslContextCallMake` to `SslContextCallGlobal`
2023-03-24 14:15:22 +01:00
Asger F
179d0b36cf Ruby: make up qnames for top-level namespaces 2023-03-24 13:42:51 +01:00
Rasmus Lerchedahl Petersen
3c407eaa23 python: rewrite comment 2023-03-24 13:32:25 +01:00
Rasmus Lerchedahl Petersen
8ea4878f7a python: move comment 2023-03-24 13:24:49 +01:00
Taus
c0eb611dae Merge pull request #12244 from RasmusWL/import-refined
Python: Fix import of refined variable
2023-03-24 13:22:19 +01:00
yoff
cf4eac6fa1 Update python/ql/src/Security/CWE-327/PyOpenSSL.qll
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2023-03-24 13:18:03 +01:00
Michael Nebel
ac4aa4f06c Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-24 13:17:43 +01:00
Jami
49d5149857 Merge pull request #11968 from jcogs33/jcogs33/model-more-top-jdk-apis-300-500
Java: model remaining top-500 JDK APIs
2023-03-24 07:54:17 -04:00
Henry Mercer
605ddec04b Merge branch 'main' into dependabot/github_actions/actions/stale-8 2023-03-24 11:49:31 +00:00
Anders Schack-Mulligen
85511ba19d Dataflow: Sync 2023-03-24 12:42:06 +01:00
Anders Schack-Mulligen
b45c274f33 Dataflow: Adjust qldoc 2023-03-24 12:41:53 +01:00
Tom Hvitved
a5b7a0fe16 Merge pull request #12566 from hvitved/ruby/dataflow-assignments-in-paths 2023-03-24 12:31:59 +01:00
Michael Nebel
e87747c52e Document a few sink kinds. 2023-03-24 10:49:06 +01:00
Jeroen Ketema
a87a9438c7 Replace all definitions of Unit by import codeql.util.Unit 2023-03-24 10:39:34 +01:00
Jeroen Ketema
8b5393661b C++: Address review comments 2023-03-24 10:34:10 +01:00
Tom Hvitved
b816c79248 Ruby: Include all assignments in data flow paths 2023-03-24 10:09:30 +01:00
Michael Nebel
e5637876b2 Address review comments related to neutrals and ext. 2023-03-24 10:00:58 +01:00
Michael Nebel
43fd342119 Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-24 09:41:36 +01:00
Michael Nebel
ad42f7d5ba Java: Update provenance description to prepare for the upcoming changes. 2023-03-24 09:41:36 +01:00
Michael Nebel
a73f73c6e0 Java: The qualifier is selected using this instead of -1. 2023-03-24 09:41:36 +01:00
Michael Nebel
6afdaa3ee1 Java: Address review comments. 2023-03-24 09:41:36 +01:00
Michael Nebel
aba7d84686 Apply suggestions from code review
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
Co-authored-by: Jami <57204504+jcogs33@users.noreply.github.com>
2023-03-24 09:41:36 +01:00
Michael Nebel
5659b5899f Java: Extend the description of models. 2023-03-24 09:41:36 +01:00
Michael Nebel
ce162ce5d4 Java: Address review comments. 2023-03-24 09:41:36 +01:00
Michael Nebel
9e49daa57a Apply suggestions from code review
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-03-24 09:41:36 +01:00
Michael Nebel
68a7fc9646 Java: Minor improvements on wording. 2023-03-24 09:41:36 +01:00
Michael Nebel
396e24cca7 Java: Add documentation for access paths and provenance. 2023-03-24 09:41:36 +01:00
Michael Nebel
c624536097 Java: Summary flow reference material. 2023-03-24 09:41:36 +01:00
Michael Nebel
0f03605b08 Java: Add reference material docs for source and sink models. 2023-03-24 09:41:35 +01:00
Michael Nebel
3a1d6420db Java: Add neutral example. 2023-03-24 09:41:35 +01:00
Michael Nebel
7ef4cc4bb9 Java: Add flow through examples. 2023-03-24 09:41:35 +01:00
Michael Nebel
f6ef55881d Java: Add source example. 2023-03-24 09:41:35 +01:00
Michael Nebel
1fd28445e3 Java: Add link to the library customization page. 2023-03-24 09:41:35 +01:00
Michael Nebel
690b39420e Java: Add initial documentation for MaD using data extensions for Java. 2023-03-24 09:41:35 +01:00
Jeroen Ketema
3e4f35151a C++: Rename SslContextCallMake to SslContextCallGlobal
This is in line with changes made to the dataflow library
2023-03-24 09:05:06 +01:00
Tony Torralba
c395779b85 Merge pull request #12643 from chmodxxx/sbaddou/jndisanitizer
Java : Add JndiInjection Sanitizer Class
2023-03-24 09:04:54 +01:00
Anders Schack-Mulligen
9d88f01c82 Merge pull request #12645 from aschackmull/dataflow/renaming
Dataflow: Rename Make to Global and hasFlow to flow
2023-03-24 08:48:31 +01:00
dependabot[bot]
fbda6dc5c6 Bump actions/stale from 7 to 8
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 04:01:51 +00:00
Harry Maclean
30eacd03d8 Ruby: Whitespace change to bust extractor cache 2023-03-24 15:04:10 +13:00
Harry Maclean
32468b68de Ruby: Use correct binary for linux build 2023-03-24 15:04:10 +13:00
Jami Cogswell
b8ceb7112d Java: update ordering of Path.getFileName model 2023-03-23 18:07:06 -04:00
Jami Cogswell
222e6f0b82 Java: undo temp revert of neutral filtering 2023-03-23 18:01:33 -04:00
Jami Cogswell
128a6a3951 Java: temp revert of neutral filtering 2023-03-23 18:01:33 -04:00
Jami Cogswell
8046ec2f78 Java: update -1 to this 2023-03-23 18:01:28 -04:00
Jami Cogswell
3d0d4111c0 Java: add test for ResourceBundle.getString 2023-03-23 18:00:21 -04:00
Jami Cogswell
0f3a0a1e81 Java: remove ArrayElement from listFiles 2023-03-23 18:00:21 -04:00
Jami Cogswell
29999d7bc8 Java: add WithoutElement comment 2023-03-23 18:00:21 -04:00
Jami Cogswell
62d64d5828 Java: add comments for reflection-related models 2023-03-23 18:00:21 -04:00
Jami Cogswell
e0c0c973a7 Java: remove Format and MessageFormat 2023-03-23 18:00:21 -04:00
Jami Cogswell
702ca19c3c Java: added comment about second order sql injection 2023-03-23 18:00:20 -04:00
Jami Cogswell
a7da6c8029 Java: update cast and delete tests 2023-03-23 18:00:20 -04:00
Jami Cogswell
db545e4981 Java: switch StringBuilder.delete to AbstractStringBuilder.delete 2023-03-23 18:00:20 -04:00
Jami Cogswell
56d14820e4 Java: change taint to value for Class.cast 2023-03-23 18:00:20 -04:00
Jami Cogswell
170d9e35be Java: update change note date 2023-03-23 18:00:20 -04:00
Jami Cogswell
79ce46a221 Java: remove FileInputStream summary model since causing issues in DCA 2023-03-23 18:00:20 -04:00
Jami Cogswell
882237e13e Java: update test cases affected by Duration.ofMillis and AtomicReference.set models 2023-03-23 18:00:20 -04:00
Jami Cogswell
bdd7f18e35 Java: remove some comments 2023-03-23 18:00:20 -04:00
Jami Cogswell
ab4ab7812d Java: add change note 2023-03-23 18:00:20 -04:00
Jami Cogswell
17e0920325 Java: resolve more conflicts 2023-03-23 18:00:14 -04:00
Jami Cogswell
275634e907 Java: remove apis with ObjectString param type 2023-03-23 17:56:54 -04:00
Jami Cogswell
c213d56d2c Java: resolve some more -1 to this conflicts 2023-03-23 17:56:46 -04:00
Jami Cogswell
9103e5c5dd Java: update TopJdkApis test case for top-500 2023-03-23 17:53:32 -04:00
Jami Cogswell
44c3a41194 Java: resolve more -1 to this conflicts 2023-03-23 17:53:27 -04:00
Jami Cogswell
d6c071d2b7 Java: update TopJdkApis test case for top-400 2023-03-23 17:50:21 -04:00
Jami Cogswell
971b0e8814 Java: -1 to this conflict 2023-03-23 17:50:08 -04:00
Jami Cogswell
a6b775f769 Java: update TopJdkApis test case for top-300 2023-03-23 17:45:40 -04:00
Erik Krogh Kristensen
9f36acbb5e Merge pull request #12644 from erik-krogh/diag-test-internal-error
JS: add diagnostics test for internal error
2023-03-23 21:00:50 +01:00
Tom Hvitved
110d666010 Merge pull request #12421 from kaspersv/kaspersv/dataflow-proper-unit
Dataflow: Instantiate stage 1 access paths with proper unit type
2023-03-23 20:29:04 +01:00
Tony Torralba
3eed4b4186 Move JndiInjectionSanitizer to importable file
Add change note
2023-03-23 17:05:53 +01:00
Joe Farebrother
48823aec75 Fix tests and missing model after rebase 2023-03-23 14:37:32 +00:00
Joe Farebrother
56fb3d23ff Argument[-1] -> Argument[this] 2023-03-23 14:37:32 +00:00
Joe Farebrother
9287549e93 Generate tests; fix models 2023-03-23 14:37:32 +00:00
Joe Farebrother
14f753b8cf Use precise access paths for http headers models 2023-03-23 14:37:31 +00:00
Joe Farebrother
a476677b2b Model more setters and constructors 2023-03-23 14:37:31 +00:00
Joe Farebrother
904102143e Add some missing models 2023-03-23 14:37:31 +00:00
Joe Farebrother
28b0e7e074 Remove unneeded blank lines 2023-03-23 14:37:31 +00:00
Joe Farebrother
76b92857c9 Add change note 2023-03-23 14:37:31 +00:00
Joe Farebrother
312c3eae06 Generate tests and stubs, fix an issue 2023-03-23 14:37:31 +00:00
Joe Farebrother
0124d81145 Fix models 2023-03-23 14:37:31 +00:00
Joe Farebrother
2fb560a170 Add more models for message decoder sources an headers fluent methods 2023-03-23 14:37:31 +00:00
Joe Farebrother
5d6eab4f3a Add models for more utility methods 2023-03-23 14:37:31 +00:00
Joe Farebrother
7b02616f30 Fix a model 2023-03-23 14:37:31 +00:00
Joe Farebrother
f292e85c51 Model fixes - remove ambiguity, correctly model constructors 2023-03-23 14:37:31 +00:00
Joe Farebrother
f1c347d4e1 Generate tests and stubs 2023-03-23 14:37:30 +00:00
Joe Farebrother
39ed5038af Generate test cases and fix some errors in models 2023-03-23 14:37:30 +00:00
Joe Farebrother
43cfbb228a Add additional tests for http stuff + corresponding stubs 2023-03-23 14:37:30 +00:00
Joe Farebrother
f88780cdd1 Add some tests; improve buffer models 2023-03-23 14:37:30 +00:00
Joe Farebrother
9a33c2a611 Generate netty stubs 2023-03-23 14:37:30 +00:00
Joe Farebrother
6ea0cfc2af Add more models for byte buffer handling and http2 utils 2023-03-23 14:37:30 +00:00
Joe Farebrother
63f0823a9b Add more sources and flow steps for http2 types 2023-03-23 14:37:30 +00:00
Joe Farebrother
d8da4fb1f4 Add websocket models 2023-03-23 14:37:30 +00:00
Joe Farebrother
24c59bb7e5 Formatting fixes 2023-03-23 14:37:30 +00:00
Joe Farebrother
f3882f92db Add more netty modelling, mostly around http requests 2023-03-23 14:37:29 +00:00
Joe Farebrother
d257e32eba Separate different packages into different files 2023-03-23 14:37:29 +00:00
Joe Farebrother
0f7a1d283d Add Netty models 2023-03-23 14:37:29 +00:00
Asger F
a59a404752 Ruby: redundant check is implied by isToplevel() 2023-03-23 14:28:09 +01:00
Mathias Vorreiter Pedersen
61bafd358a C++: Fix another place that assumed that 'Expr' was always 'Instruction'. 2023-03-23 13:27:24 +00:00
Anders Schack-Mulligen
d440bc2d0c Dataflow: Sync. 2023-03-23 13:40:23 +01:00
Anders Schack-Mulligen
4993e7c149 Dataflow: Rename output signature 2023-03-23 13:39:53 +01:00
Asger F
1f70c59bbc Ruby: add test with deep unresolved classes 2023-03-23 13:36:14 +01:00
Anders Schack-Mulligen
1c1aa7ecdd Dataflow: Add change notes. 2023-03-23 13:17:36 +01:00
erik-krogh
27c29303da add test diagnostics test for internal error 2023-03-23 13:12:51 +01:00
Salah Baddou
b1d9c65194 Add JndiInjection Sanitizer Class 2023-03-23 12:11:07 +00:00
Anders Schack-Mulligen
ab95a0b9f0 Java/C#: Rename references 2023-03-23 13:09:09 +01:00
Anders Schack-Mulligen
978c5f7bd8 Java/C++: Autoformat 2023-03-23 13:06:19 +01:00
Anders Schack-Mulligen
d0b7ffda70 Python/Ruby/Swift: Rename references. 2023-03-23 13:06:19 +01:00
Anders Schack-Mulligen
72415c7c2c C++: Rename references. 2023-03-23 13:06:19 +01:00
Anders Schack-Mulligen
ec34d44359 Java: Rename references. 2023-03-23 13:06:19 +01:00
Anders Schack-Mulligen
2761aa73ca Dataflow: Sync. 2023-03-23 13:06:19 +01:00
Anders Schack-Mulligen
cfa5af969e Dataflow: Rename Make to Global and remove has* prefix. 2023-03-23 13:06:19 +01:00
Michael Nebel
79cd7615b7 Merge pull request #12539 from michaelnebel/modelgenerator/configuration
Java/C#: Re-factor model generator taint tracking configurations to use the new API
2023-03-23 12:56:41 +01:00
Paolo Tranquilli
329684c2b0 Merge pull request #12634 from github/redsun82/swift-successuful-extractions
Swift: add a query showing successfully extracted files
2023-03-23 12:52:13 +01:00
Geoffrey White
de5cf84bd5 Swift: Address check failures. 2023-03-23 11:08:49 +00:00
Geoffrey White
a5bb93402c Swift: Replace sources with (extendable) CSV. 2023-03-23 10:52:58 +00:00
Geoffrey White
9529bc5f09 Swift: The regressed test is not realistic, update it to be more like what really happens. 2023-03-23 10:52:58 +00:00
Geoffrey White
e266132f0a Swift: Replace sinks with (extendable) CSV. 2023-03-23 10:45:29 +00:00
Geoffrey White
4c0d02a87d Swift: Standardize the sources, sinks etc. 2023-03-23 10:39:03 +00:00
Geoffrey White
dfcad7fa84 Swift: Split the query into the usual three files. 2023-03-23 10:39:03 +00:00
Geoffrey White
879dea2984 Swift: Additional test cases. 2023-03-23 10:38:52 +00:00
erik-krogh
404cbc93eb rename succ to pumpEnd throughout SuperLinearBackTracking.qll 2023-03-23 10:46:22 +01:00
erik-krogh
3f18b7730f address some review comments 2023-03-23 10:39:56 +01:00
erik-krogh
e189b36e3f materialize less strings when ranking states 2023-03-23 10:35:58 +01:00
Michael Nebel
d258a1c728 C#/Java: Some light re-factoring. 2023-03-23 10:24:46 +01:00
Paolo Tranquilli
ccb816ed84 Java: autoformat 2023-03-23 10:22:18 +01:00
Michael Nebel
b17a71674a C#: Refactor the model generator configurations to use the new API. 2023-03-23 10:17:37 +01:00
Anders Schack-Mulligen
07f8780541 Merge pull request #12640 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-23 09:55:40 +01:00
Michael Nebel
d0732a765b C#: Sync files. 2023-03-23 09:52:42 +01:00
Michael Nebel
eed8c72ce6 Java: Refactor the model generator configurations to use the new API. 2023-03-23 09:48:12 +01:00
Kasper Svendsen
ce6be1f636 Dataflow: Instantiate stage 1 access paths with proper unit type 2023-03-23 08:32:16 +01:00
github-actions[bot]
271e41c6dd Add changed framework coverage reports 2023-03-23 00:16:48 +00:00
Harry Maclean
45797b3de5 Ruby: bump cross to 0.2.5
This include support for mounting external path dependencies as volumes.
2023-03-23 12:20:15 +13:00
Harry Maclean
856132bc2f Ruby: Fix cross-compilation
Ensure that builds via cargo-cross, which are executed in a docker
container, can see the shared library.
2023-03-23 11:59:14 +13:00
Harry Maclean
f2fc80b3c1 QL: Bump rust to 1.68 2023-03-23 11:59:14 +13:00
Harry Maclean
8c60b6e657 QL: Merge extractor crates into one
This mirrors the structure we have in the Ruby extractor, and will allow
us to share more code.
2023-03-23 11:59:14 +13:00
Harry Maclean
6171eae7a2 QL: Use shared extractor library 2023-03-23 11:59:13 +13:00
Harry Maclean
c90299baee Ruby: Move codeql_threads calculation to library 2023-03-23 11:58:19 +13:00
Harry Maclean
74671281f9 Ruby: Remove unused dependencies from extractor 2023-03-23 11:58:18 +13:00
Harry Maclean
c4a7389873 Ruby: Move extractor into shared crate
This makes it possible for different languages to share this extractor.
2023-03-23 11:58:18 +13:00
erik-krogh
0462e2a6ea update some expected output 2023-03-22 20:47:53 +01:00
Jami
71c37dba32 Merge pull request #12110 from jcogs33/jcogs33/add-heuristic-sql-models
Java: add sql summary model discovered with heuristics
2023-03-22 15:20:01 -04:00
Geoffrey White
bcca18d5b2 Merge pull request #12638 from geoffw0/testfix
Swift: Accept test regressions
2023-03-22 17:19:44 +00:00
Jami
081d97ff72 Merge pull request #12637 from jcogs33/jcogs33/yml-check-change-note
CI: Add yml files to change note check
2023-03-22 13:06:35 -04:00
Mathias Vorreiter Pedersen
0f240d6738 C++: Fix join order in 'boundFlowCond'. 2023-03-22 17:00:07 +00:00
Mathias Vorreiter Pedersen
cd7ba7c503 C++: Fix join orders in 'eqBound'. 2023-03-22 16:51:39 +00:00
Mathias Vorreiter Pedersen
0c6b60b2c6 C++: Avoid two joins on value number. 2023-03-22 16:51:39 +00:00
Mathias Vorreiter Pedersen
d325082db3 C++: Fix another place that assumed that 'Expr' was always 'Instruction'. 2023-03-22 16:51:39 +00:00
Mathias Vorreiter Pedersen
6e38105615 C++: Fix implicit 'this'. 2023-03-22 16:51:39 +00:00
Mathias Vorreiter Pedersen
4d029acb11 C++: Accept test changes. 2023-03-22 16:51:39 +00:00
Mathias Vorreiter Pedersen
4cc3bfae33 C++: Fix places that assumed that 'Expr' was always 'Instruction'. 2023-03-22 16:51:38 +00:00
Geoffrey White
a4e9d38abb Swift: Fix the test regression. 2023-03-22 16:44:29 +00:00
Mathias Vorreiter Pedersen
0aa90d6f09 Merge pull request #12635 from MathiasVP/bool-to-int-is-safe
C++: `bool` -> `int` are safe conversions
2023-03-22 16:29:29 +00:00
Geoffrey White
cbe5243c89 Swift: Accept test regressions. :( 2023-03-22 16:24:32 +00:00
Mathias Vorreiter Pedersen
08e8604430 C++: Change 'Expr' to be EquivalenceClasses instead of Instructions. 2023-03-22 15:26:26 +00:00
Michael Nebel
915efffe21 Merge pull request #12610 from michaelnebel/java/validatespecs
Java/C#: Validate all AccessPaths.
2023-03-22 16:22:54 +01:00
Mathias Vorreiter Pedersen
59f2c75186 C++: bool -> int conversions are safe conversions. 2023-03-22 15:01:54 +00:00
Rasmus Wriedt Larsen
77f1539e71 Python: Add change-note 2023-03-22 15:57:09 +01:00
Rasmus Wriedt Larsen
7b3f710e91 Python: Model aiosqlite 2023-03-22 15:51:47 +01:00
Jami Cogswell
3f40e3863f Add yml files to change note check 2023-03-22 10:51:36 -04:00
Rasmus Wriedt Larsen
9975facf9d Python: Make asyncio version of PEP249 modeling library
so it's also easy to modeling asyncio libraries

Also ports aiomysql/aiopg to use this new modeling
2023-03-22 15:51:33 +01:00
Rasmus Wriedt Larsen
2b4ebf7377 Python: Add support for .executescript 2023-03-22 15:20:06 +01:00
Alex Ford
0f267e012a Merge pull request #12631 from alexrford/js/weak-cryptographic-algorithm_space
JS: add a missing space in alert message for `js/weak-cryptographic-algorithm`
2023-03-22 14:12:35 +00:00
Arthur Baars
65d129dee1 Merge pull request #12529 from hmac/ruby-extractor-bump-rust-version
Ruby: Bump rust toolchain to 1.68
2023-03-22 15:12:08 +01:00
Rasmus Wriedt Larsen
eb43fa2644 Python: Make API graph version of PEP249 modeling
This will allow us to more easily handle the executescript method, which
we'll do in next commit.
2023-03-22 15:07:03 +01:00
Jami Cogswell
5f8d6c3c07 Java: add change note 2023-03-22 10:05:55 -04:00
Jami Cogswell
82daf50ed4 Java: add signature 2023-03-22 10:05:55 -04:00
Jami Cogswell
974f4bc371 Java: remove nativeSql sink 2023-03-22 10:05:55 -04:00
Jami Cogswell
ea626a03b6 Java: add nativeSQL as summary model 2023-03-22 10:05:55 -04:00
Rasmus Wriedt Larsen
5930499f1d Python: Add test for missing .executescript SQL method 2023-03-22 14:57:08 +01:00
Ian Lynagh
536bc9ac89 Merge pull request #12589 from igfoo/igfoo/distutils
Kotlin: Don't use distutils in build script
2023-03-22 13:18:51 +00:00
Alex Denisov
635564531c Swift: add a query showing successfully extracted files
(cherry picked from commit 7c15527300)
2023-03-22 13:52:09 +01:00
erik-krogh
2bba9057a0 better callgraph support for global variables 2023-03-22 13:49:33 +01:00
Anders Schack-Mulligen
dc6729d0bf Merge pull request #12616 from aschackmull/java-csharp/redundant-sign-analysis-case
Java/C#: Remove useless disjuncts.
2023-03-22 13:33:46 +01:00
Erik Krogh Kristensen
663d4e8e3b Merge pull request #12592 from erik-krogh/rhsRegress
JS: Fix performance regression in the `GetLaterAccess` module.
2023-03-22 12:55:56 +01:00
Arthur Baars
bed5eeb372 Apply suggestions from code review 2023-03-22 12:30:15 +01:00
Erik Krogh Kristensen
5dc5c8e683 Merge pull request #12629 from erik-krogh/qlTreeSitterQll
QL: regen TreeSitter.qll
2023-03-22 12:28:27 +01:00
Alex Ford
b000b9b5c0 JS: add a missing space in alert message for js/weak-cryptographic-algorithm 2023-03-22 11:12:13 +00:00
Erik Krogh Kristensen
a93c2ec20b Merge pull request #12630 from erik-krogh/disableConsis
QL: disable the consistency check
2023-03-22 11:06:15 +01:00
erik-krogh
5a3ddcfca6 QL: disable the consistency check 2023-03-22 10:53:39 +01:00
erik-krogh
4bc6a0927d fix queries that relied on the old TreeSitter.qll 2023-03-22 10:45:50 +01:00
erik-krogh
53d9e4d4eb QL: regen TreeSitter.qll 2023-03-22 10:29:30 +01:00
Rasmus Wriedt Larsen
170a93cc4f Python: Model cassandra-driver PyPI package 2023-03-22 10:28:04 +01:00
Rasmus Wriedt Larsen
e4db5f9a64 Python: Model asyncpg.connection.connect() 2023-03-22 10:28:04 +01:00
Rasmus Wriedt Larsen
4f9117963d Python: Model sqlite3.dbapi2 2023-03-22 10:28:04 +01:00
Erik Krogh Kristensen
bdab57b9d3 Update javascript/ql/lib/semmle/javascript/GlobalAccessPaths.qll
Co-authored-by: Asger F <asgerf@github.com>
2023-03-22 10:19:48 +01:00
erik-krogh
3d9bbd7824 ReDoS: fix potential bad mistake caught by QL-for-QL 2023-03-22 10:16:23 +01:00
erik-krogh
b071d3557e JS/PY/RB: add a worst-case test, that now performs OK 2023-03-22 10:13:18 +01:00
erik-krogh
801e0ff050 ReDoS: implement a better super-linear algorithm, with better worst-case performance 2023-03-22 10:13:16 +01:00
Michael Nebel
71d184e8c0 C#: Validate all access paths except for Field and Property. 2023-03-22 10:05:46 +01:00
Michael Nebel
46ef954d5c Java: Validate all accesspaths except for Field. 2023-03-22 10:05:46 +01:00
Tony Torralba
6c0c06c963 Merge pull request #12624 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-22 09:49:41 +01:00
Erik Krogh Kristensen
5fcc0d3e28 Merge pull request #12625 from github/dependabot/cargo/ql/regex-1.7.2
Bump regex from 1.7.1 to 1.7.2 in /ql
2023-03-22 09:30:36 +01:00
yoff
a328d8c93b Merge pull request #12594 from yoff/python/add-test-to-valid
python: add test to validation (and fix it)
2023-03-22 09:07:27 +01:00
Anders Schack-Mulligen
b2d436ccc1 Merge pull request #12533 from aschackmull/java/misc-perf
Java/dataflow: Misc performance fixes
2023-03-22 08:39:43 +01:00
dependabot[bot]
b7600c6022 Bump regex from 1.7.1 to 1.7.2 in /ql
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.7.1...1.7.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-22 04:06:21 +00:00
Harry Maclean
6cb1348988 Ruby: Try different workaround for Actions bug 2023-03-22 15:02:36 +13:00
github-actions[bot]
4fc5742a62 Add changed framework coverage reports 2023-03-22 00:14:41 +00:00
Edward Minnix III
5db3ec8f5b Merge pull request #12623 from egregius313/egregius313/swift/fix-format
Swift: Fix formatting of TypeDecl.qll
2023-03-21 16:35:19 -04:00
Ed Minnix
0408e9dc2d Fix formatting of TypeDecl.qll 2023-03-21 15:28:16 -04:00
Edward Minnix III
e91165bc01 Merge pull request #12531 from aschackmull/java/autoformat
Java: Autoformat.
2023-03-21 14:10:40 -04:00
Geoffrey White
6a2a351929 Merge pull request #12619 from geoffw0/fullname
Swift: Fix for TypeDecl.getFullName with extensions
2023-03-21 18:02:16 +00:00
Alexandre Boulgakov
81e3b8badb Merge pull request #12621 from github/sashabu/includes
Swift: Cleanup: Remove some unused #includes.
2023-03-21 16:49:51 +00:00
Aditya Sharad
62a47ce18b Merge pull request #12618 from smowton/smowton/admin/merge-rc39-into-main
Merge rc/3.9 into main
2023-03-21 09:33:55 -07:00
Alexandre Boulgakov
12b75e7be1 Swift: Cleanup: Remove some unused #includes. 2023-03-21 16:07:44 +00:00
Geoffrey White
91c324ea4f Swift: Fix for getFullName. 2023-03-21 15:11:02 +00:00
Geoffrey White
29f7862466 Swift: Add a test for getFullName. 2023-03-21 15:10:22 +00:00
Raul Garcia
afd89809b2 Merge branch 'main' into main 2023-03-21 08:06:14 -07:00
Raul Garcia
8b4826c0b4 Singleton set literal fix
Fixing auto-code scanning recommendation
2023-03-21 08:02:30 -07:00
Chris Smowton
288e9206c7 Merge remote-tracking branch 'origin/rc/3.9' into smowton/admin/merge-rc39-into-main 2023-03-21 14:36:43 +00:00
Chris Smowton
834511bd78 Merge pull request #12617 from github/fc-3.9-mergeback
Mergeback from rc/3.9 to main for small docs change
2023-03-21 14:36:20 +00:00
Edward Minnix III
b102ddac30 Merge pull request #12542 from egregius313/egregius313/refactor-more-queries-to-dataflow-module-api
Java: Refactor more queries to the new DataFlow module API (part 2)
2023-03-21 10:35:29 -04:00
Chris Smowton
218ed8ad37 Merge pull request #12614 from smowton/smowton/admin/backport-integration-test-fix
Java: Backport https://github.com/github/codeql/pull/12609 to rc/3.9
2023-03-21 14:30:17 +00:00
erik-krogh
c023af7308 manual recursion, and other join-order 2023-03-21 15:22:10 +01:00
erik-krogh
070468ab68 fix performance 2023-03-21 15:19:38 +01:00
erik-krogh
34fe1a8f5e use SSA in the GetLaterAccess module 2023-03-21 15:19:15 +01:00
Felicity Chapman
92a31608a2 Merge branch 'rc/3.9' into fc-3.9-mergeback 2023-03-21 14:16:51 +00:00
Felicity Chapman
5c607b81fd Merge pull request #12613 from github/fix-missing-docs-link
Minor update: Add new article to manual TOC
2023-03-21 14:14:12 +00:00
Rasmus Wriedt Larsen
b2f34ef4b1 Merge branch 'main' into import-refined 2023-03-21 15:12:11 +01:00
yoff
e21e630316 Merge branch 'main' into python/add-test-to-valid 2023-03-21 14:47:17 +01:00
Anders Schack-Mulligen
89d9d65755 Java/C#: Remove useless disjuncts. 2023-03-21 14:45:29 +01:00
Jeroen Ketema
574b2201cb Merge pull request #12608 from jketema/configsig
C++: Use `DataFlow::ConfigSig` in more places
2023-03-21 14:37:32 +01:00
Anders Schack-Mulligen
0d6dd7d25a DataFlow: Sync. 2023-03-21 14:27:25 +01:00
Anders Schack-Mulligen
56288eb3d2 Java: Misc performance fixes 2023-03-21 14:26:13 +01:00
Tom Hvitved
5260d9815a Merge pull request #12582 from hvitved/ruby/element-of-type-content-set
Ruby: Introduce `ContentSet::isElementOfType[OrUnknown]/1`
2023-03-21 13:41:15 +01:00
Anders Schack-Mulligen
225ed1e220 Java: Autoformat. 2023-03-21 13:35:02 +01:00
Rasmus Wriedt Larsen
caa25f78d9 Merge pull request #12607 from RasmusWL/fix-dataflow-consistency-output
Python: Accept dataflow-consistency test changes
2023-03-21 13:20:29 +01:00
Chris Smowton
a865f1666d maven-httpo-repository: add Maven wrapper
Maven 3.9.1 changes the format of the error message this test is looking for (though it still matches the target regex). Use the Maven wrapper to avoid such sensitivity to the precise version present in the environment.
2023-03-21 12:19:52 +00:00
Mathias Vorreiter Pedersen
98dc73c6dd Merge pull request #12611 from MathiasVP/buffer-access-should-be-evaluated
C++: Exclude unevaluated accesses in `BufferAccess`
2023-03-21 12:10:37 +00:00
Asger F
6d665da4dc Merge pull request #12570 from github/post-release-prep/codeql-cli-2.12.5
Post-release preparation for codeql-cli-2.12.5
2023-03-21 13:06:25 +01:00
Felicity Chapman
719708cb89 Fix typo 2023-03-21 12:00:55 +00:00
Felicity Chapman
da96ed1ff9 A few tweaks 2023-03-21 12:00:55 +00:00
Felicity Chapman
41becfe2ba Add new article to manual TOC 2023-03-21 12:00:55 +00:00
Chris Smowton
219031f62b Merge pull request #12609 from smowton/smowton/admin/maven-wrapper-http-test
Java: maven-http-repository test: add Maven wrapper
2023-03-21 11:14:19 +00:00
Mathias Vorreiter Pedersen
2ce0d2b7ee C++: Accept more test changes. 2023-03-21 10:07:23 +00:00
Mathias Vorreiter Pedersen
eab43973b7 C++: Add change note. 2023-03-21 10:00:11 +00:00
yoff
4e6b93e239 Merge branch 'main' into fix-dataflow-consistency-output 2023-03-21 10:57:36 +01:00
Stephan Brandauer
0a605638e5 Merge branch 'main' into java/update-mad-decls-after-triage-2023-03-13T13-21-27 2023-03-21 10:56:53 +01:00
Mathias Vorreiter Pedersen
40cc2e7891 C++: Also exclude unevaluated buffers in 'OverflowStatic'. 2023-03-21 09:53:39 +00:00
Mathias Vorreiter Pedersen
4d2a1ea149 C++: Also add a FP test to 'OverflowStatic'. 2023-03-21 09:50:47 +00:00
Mathias Vorreiter Pedersen
8623d8eb8e C++: Exclude unevaluated expressions from BufferAccess. 2023-03-21 09:48:09 +00:00
Mathias Vorreiter Pedersen
b37bb660c5 C++: Add FP caused by a BufferAccess inside an unevalauted context. 2023-03-21 09:37:18 +00:00
Chris Smowton
2876b4aa5d maven-httpo-repository: add Maven wrapper
Maven 3.9.1 changes the format of the error message this test is looking for (though it still matches the target regex). Use the Maven wrapper to avoid such sensitivity to the precise version present in the environment.
2023-03-21 09:25:33 +00:00
Rasmus Wriedt Larsen
e90559b86d Python: Add missing options files
I could not for the life of me figure out why the tests were failing,
when they were working for me locally 🤦
2023-03-21 10:24:28 +01:00
Tony Torralba
956f991b8d Merge pull request #12603 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-21 10:11:51 +01:00
Rasmus Wriedt Larsen
346086524b Python: Accept dataflow-consistency test changes
To PRs must have had a conflict when merged separately
2023-03-21 10:09:01 +01:00
Stephan Brandauer
3134ad859e Merge branch 'main' into java/update-mad-decls-after-triage-2023-03-20T12-45-37 2023-03-21 10:04:00 +01:00
Tony Torralba
1f991807d4 Merge pull request #12366 from github/java/update-mad-decls-after-triage-2023-03-02T12-08-59
Java: Update MaD Declarations after Triage
2023-03-21 09:40:03 +01:00
Jeroen Ketema
2fdfa0808a C++: Refactor experimental queries to use DataFlow::ConfigSig 2023-03-21 09:16:59 +01:00
Jeroen Ketema
1f75c3836e C++: Refactor dataflow examples to use DataFlow::ConfigSig 2023-03-21 09:16:58 +01:00
Jeroen Ketema
4e752369c5 Merge pull request #12598 from jketema/default-config
C++: Adjust the internals of default taint tracking to use `DataFlow::ConfigSig`
2023-03-21 08:59:27 +01:00
Erik Krogh Kristensen
cc46d7fef3 Merge pull request #12605 from github/dependabot/cargo/ql/serde-1.0.158
Bump serde from 1.0.157 to 1.0.158 in /ql
2023-03-21 08:20:13 +01:00
dependabot[bot]
7420e90a46 Bump serde from 1.0.157 to 1.0.158 in /ql
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.157 to 1.0.158.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.157...v1.0.158)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-21 04:06:18 +00:00
Raul Garcia
1400b4b520 Update UnsafeUsageOfClientSideEncryptionVersion.ql
*  predicate `isUnsafeClientSideAzureStorageEncryptionViaObjectCreation` was not useful (it was meant to detect the SDK code, not its usage)
* fixed & simplified `isUnsafeClientSideAzureStorageEncryptionViaAttributes`, the original query was not finding the right code.
NOTE: tested with a real project: https://github.com/wastore/azure-storage-samples-for-python/tree/master/ClientSideEncryptionToServerSideEncryptionMigrationSamples/ClientSideEncryptionV1ToV2
2023-03-20 18:52:58 -07:00
Raul Garcia
569c38c833 Cleanup main
cleanup main
2023-03-20 18:38:42 -07:00
Raul Garcia
c3cb3ad477 Cleaning up main branch
Cleaning up main branch
2023-03-20 18:32:37 -07:00
Raul Garcia
c169e8360e Merge branch 'github:main' into main 2023-03-20 17:44:37 -07:00
github-actions[bot]
6598cc44ee Add changed framework coverage reports 2023-03-21 00:15:33 +00:00
Jeroen Ketema
7cdd2b69c9 C++: Adjust the internals of default taint tracking to use DataFlow::ConfigSig 2023-03-20 18:58:16 +01:00
AlexDenisov
43b3f379e9 Merge pull request #12596 from github/redsun82/swift-do-not-print-labels-in-function-types
Swift: remove labels from function type printing
2023-03-20 18:01:02 +01:00
Gulshan Singh
bae1dfebb2 Address some review comments on RangeNode class 2023-03-20 09:46:03 -07:00
Gulshan Singh
e2fdfbb71f Add RangeNode class 2023-03-20 09:46:02 -07:00
Ed Minnix
b64ca5dcaa Remove "private" marker from configurations 2023-03-20 12:26:54 -04:00
Ed Minnix
c7816ea180 Conform Config modules to naming convention 2023-03-20 12:26:54 -04:00
Ed Minnix
8856730843 Refactor CWE-614/InsecureCookie 2023-03-20 12:26:54 -04:00
Ed Minnix
de6959c688 Refactor CWE-209/StackTraceExposure 2023-03-20 12:26:54 -04:00
Ed Minnix
73a17536f5 Refactor CWE-129 queries 2023-03-20 12:26:54 -04:00
Ed Minnix
ae57807359 Refactor CWE-089 Sql queries 2023-03-20 12:26:54 -04:00
Ed Minnix
e6e974a752 Refactor CWE-079/SqlConcatenated 2023-03-20 12:26:54 -04:00
Ed Minnix
c1ee2dce61 Refactor CWE-078/ExecTaintedLocal 2023-03-20 12:26:54 -04:00
Edward Minnix III
ac58299d9e Merge pull request #12541 from egregius313/egregius313/refactor-queries-to-new-dataflow-api
Java: Refactor more queries to the new DataFlow module API
2023-03-20 12:24:26 -04:00
Tony Torralba
1258812428 Fix Argument[this] 2023-03-20 17:13:44 +01:00
Tony Torralba
f685b93379 Add change note 2023-03-20 17:09:48 +01:00
Tony Torralba
a66b7ed54a Fix incorrect model, add missing model 2023-03-20 17:09:48 +01:00
Stephan Brandauer
0cab45e4b9 update old data to current standard (stream creation arg is a sink) 2023-03-20 17:09:48 +01:00
Stephan Brandauer
8802fbdfe7 Update java/ql/lib/ext/java.nio.file.model.yml
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-20 17:09:48 +01:00
Stephan Brandauer
bc227179c7 Update java/ql/lib/ext/org.geogebra.web.full.main.model.yml
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-20 17:09:48 +01:00
Tony Torralba
bc99a44f3a Apply suggestions from code review 2023-03-20 17:09:48 +01:00
Stephan Brandauer
12bb0d98c0 move toFile back to its original location 2023-03-20 17:09:48 +01:00
Stephan Brandauer
4761c3a328 remove duplicates 2023-03-20 17:09:48 +01:00
Stephan Brandauer
bd21dc9460 remove nonexploitable sinks 2023-03-20 17:09:48 +01:00
Stephan Brandauer
b7ce0c2d96 fix: taint flow of ctor goes to Argument[-1], instead of ReturnValue 2023-03-20 17:09:48 +01:00
Stephan Brandauer
2236db43ec sort the changed MaD declarations 2023-03-20 17:09:46 +01:00
Stephan Brandauer
74e261738f remove predicate 2023-03-20 17:06:40 +01:00
Stephan Brandauer
ec1762e015 Update MaD Declarations after Triage 2023-03-20 17:06:37 +01:00
Tony Torralba
fa60fa0ae2 Merge pull request #12572 from github/java/update-mad-decls-after-triage-2023-03-17T15-01-35
Java: Update MaD Declarations after Triage
2023-03-20 17:02:27 +01:00
Paolo Tranquilli
aaea976cf2 Swift: remove labels from function type printing 2023-03-20 16:43:34 +01:00
Anders Schack-Mulligen
3876e4335f Merge pull request #12420 from kaspersv/kaspersv/dataflow-remove-alias-preds
Dataflow: Remove revFlowAlias and revFlowApAlias predicates
2023-03-20 16:30:15 +01:00
Alex Ford
be163cfc38 Merge pull request #12311 from maikypedia/maikypedia/ruby-ssti
Ruby: Add Server Side Template Injection query
2023-03-20 15:26:27 +00:00
Michael Nebel
17b3383043 Merge pull request #12556 from michaelnebel/java/argumentthis
Java: Argument[-1] -> Argument[this]
2023-03-20 15:59:59 +01:00
Erik Krogh Kristensen
a9d40d39d9 Merge pull request #12550 from erik-krogh/useNumberUtil
Java/Python: use Number.qll to parse hex numbers in regex parsing
2023-03-20 15:50:31 +01:00
Erik Krogh Kristensen
0f813ce2e8 Merge pull request #12543 from erik-krogh/reg-perf
ReDoS: restrict the edges considered in polynomial-redos for complex regular expressions
2023-03-20 15:48:35 +01:00
Rasmus Wriedt Larsen
2ee09cc5d1 Merge branch 'main' into import-refined 2023-03-20 15:42:01 +01:00
Rasmus Wriedt Larsen
93c9f59e86 Python: Extract version specific coverage/classes.py tests
Since we can analyze operator.py from Python3, but not in Python 2
(since it's implemented in C), we get a difference for the index tests.

note: `operator.length_hint` is only available in Python 3.4 and later,
so would always fail under Python 2.
2023-03-20 15:39:20 +01:00
Jeroen Ketema
c56c1cbb62 Merge pull request #12588 from jketema/boost-config
C++: Refactor `BoostorgAsio` to use `DataFlow::ConfigSig`
2023-03-20 15:31:35 +01:00
yoff
6639e5a97b Merge pull request #12590 from yoff/python/patch-uninitialized-local
Python: Patch uninitialized local query
2023-03-20 15:11:14 +01:00
Rasmus Lerchedahl Petersen
6a5db750c4 python: add test to validation (and fix it) 2023-03-20 15:07:46 +01:00
yoff
17c9ba9872 Merge pull request #12464 from yoff/python/add-test-captured-in-collection
python: add test for captured variables in lists
2023-03-20 15:01:58 +01:00
Rasmus Lerchedahl Petersen
ed15cce31f python: add change note 2023-03-20 14:22:58 +01:00
Chuan-kai Lin
8c738b77a3 Merge pull request #12574 from cklin/document-upgrade-query-predicates
Document upgrade query predicates
2023-03-20 06:16:34 -07:00
Rasmus Lerchedahl Petersen
b042c60ca3 python: remove outdated comment 2023-03-20 14:13:48 +01:00
Stephan Brandauer
39726a54ec fix suggestion 2023-03-20 14:12:46 +01:00
Rasmus Lerchedahl Petersen
72e97918e9 python: format 2023-03-20 14:11:10 +01:00
Jeroen Ketema
bbe95367d6 C++: Simplify SslContextCallMake 2023-03-20 14:00:03 +01:00
Geoffrey White
a19579d21b Merge pull request #12587 from geoffw0/finishbitwise
Swift: Remove special case for bitwise operations
2023-03-20 12:59:31 +00:00
Stephan Brandauer
116108851f Update MaD Declarations after Triage 2023-03-20 13:45:39 +01:00
Jeroen Ketema
2968c12e12 Merge pull request #12583 from jketema/move-print
C++: Move SsaConsistency to its own file
2023-03-20 13:41:29 +01:00
Jeroen Ketema
9997326804 C++: Refactor BoostorgAsio to use DataFlow::ConfigSig 2023-03-20 13:37:18 +01:00
Rasmus Lerchedahl Petersen
5f438e433d python: exclude nonlocals from query 2023-03-20 13:34:39 +01:00
Kasper Svendsen
1d2f1b6ae6 Address comments 2023-03-20 13:34:14 +01:00
Ed Minnix
83b0d073f0 Fix typo in QLDoc 2023-03-20 08:11:01 -04:00
Ed Minnix
1c661fd3ac Add missing QLDocs 2023-03-20 08:10:07 -04:00
Kasper Svendsen
e0e3a1d621 Dataflow: remove revFlowApAlias trick 2023-03-20 13:04:13 +01:00
Rasmus Lerchedahl Petersen
9b7a20f4ad python: add example showing FP 2023-03-20 13:03:26 +01:00
Ed Minnix
84fd5f7ee0 Fix naming of ZipSlip configuration 2023-03-20 07:55:23 -04:00
Ian Lynagh
fcf1f6a6f9 Kotlin: Don't use distutils in build script
We were getting
    DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
during the build.
2023-03-20 11:49:54 +00:00
Ed Minnix
60a4a79537 Make the Config module of public Flow modules public
This is to make things easier for the CodeML/ATM team once these
configurations are moved from `src/` to `lib/`.
2023-03-20 07:47:55 -04:00
Edward Minnix III
9aa83d78e1 Merge pull request #12575 from egregius313/egregius313/ql/dataflow-naming-convention-check
QL: add a check to enforce naming convention for new `DataFlow::ConfigSig` modules
2023-03-20 07:26:01 -04:00
Edward Minnix III
1c06afffe5 Merge pull request #12578 from egregius313/egregius313/conform-dataflow-configs-to-config-naming-convention
Conform dataflow config modules to follow `*Config` naming convention
2023-03-20 07:25:10 -04:00
Geoffrey White
166902bfa0 Swift: Remove the special case for bitwise operations in the XXE query (but upgrade that bit of the query to taint flow as appears to be intended). 2023-03-20 11:18:17 +00:00
erik-krogh
ef498020c2 PY: dont depend on codeql/util in src/ now that its added to lib/ 2023-03-20 12:11:06 +01:00
Geoffrey White
1f8a165611 Swift: Add a couple of extra test cases. 2023-03-20 10:58:58 +00:00
Paolo Tranquilli
029d924e6d Merge pull request #12580 from github/redsun82/swift-more-precise-successfully-extracted-query
Swift: make `SuccessfullyExtractedFiles.ql` more precise
2023-03-20 11:05:54 +01:00
Erik Krogh Kristensen
2270d6fa61 fix typo
Co-authored-by: Taus <tausbn@github.com>
2023-03-20 10:56:30 +01:00
Alex Ford
4b1171ce64 Merge branch 'main' into maikypedia/ruby-ssti 2023-03-20 09:55:53 +00:00
Tony Torralba
27fc14236f Add change note 2023-03-20 10:48:56 +01:00
Tony Torralba
bff8bbfe33 Apply suggestions from code review 2023-03-20 10:43:46 +01:00
Jeroen Ketema
91b069603d C++: Move SsaConsistency to its own file
This removes the import of the `Print` library in places that are used in
production and not just debugging.
2023-03-20 10:31:33 +01:00
Michael Nebel
01ade878ea Java: Update test comments to use this instead of -1. 2023-03-20 10:14:20 +01:00
Michael Nebel
ba711ab849 Java: Update expected test-output (different sorting). 2023-03-20 10:14:20 +01:00
Michael Nebel
ae12510d8d Java: Add change-note. 2023-03-20 10:14:20 +01:00
Michael Nebel
9039a468cb Java: Update models that uses -1 in a range. 2023-03-20 10:14:20 +01:00
Michael Nebel
e86f1e4961 Java: Replace Argument[-1] with Argument[this]. 2023-03-20 10:14:20 +01:00
Tom Hvitved
a9ef3f95a2 Ruby: Introduce ContentSet::isElementOfType[OrUnknown]/1 2023-03-20 10:03:15 +01:00
Michael Nebel
e78af3e66c C#: Introduce Argument and Parameter index validation for models. 2023-03-20 09:38:40 +01:00
Michael Nebel
37484a415f Sync files. 2023-03-20 09:38:40 +01:00
Michael Nebel
0ec56203f9 Java: Introduce index validation. 2023-03-20 09:38:40 +01:00
Michael Nebel
9a3c2d3fbe Java: Update summary parsing to use this instead of -1 and adjust the model generator. 2023-03-20 09:38:40 +01:00
Michael Nebel
abd9f673e1 Java: Update the java internal documentation for models. 2023-03-20 09:38:39 +01:00
Michael Nebel
352bb5a29a C#: Update internal documentation for this parameter in models. 2023-03-20 09:38:39 +01:00
Tony Torralba
8457d45edc Merge pull request #12577 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-20 09:26:18 +01:00
Kasper Svendsen
9630feb5e4 Dataflow: Remove revFlowAlias trick 2023-03-20 09:04:35 +01:00
Erik Krogh Kristensen
540542ceb5 Merge pull request #12518 from erik-krogh/more-express-sources
JS: recognize more express URL related sources
2023-03-20 08:49:11 +01:00
Erik Krogh Kristensen
af98ceb3c3 Merge pull request #11478 from erik-krogh/more-shell-taint
Rb: more taint-steps for shell-command-construction
2023-03-20 08:41:22 +01:00
Paolo Tranquilli
a131966066 Swift: make SuccessfullyExtractedFiles.ql more precise
This is done by adding a `isSuccessfullyExtracted` predicate that is
filled for primary files at the very end of the extractor invocation if
the frontend was performed successfully. If for example the extractor
crashes this will therefore not be filled.

The upgrade script is written so that `SuccessfullyExtractedFiles.ql`
on an upgraded script will give exactly the same results as before it.
2023-03-20 08:34:34 +01:00
Erik Krogh Kristensen
5f14af5db0 Merge pull request #12579 from github/dependabot/cargo/ql/serde-1.0.157
Bump serde from 1.0.156 to 1.0.157 in /ql
2023-03-20 08:02:23 +01:00
dependabot[bot]
9b3b6632fc Bump serde from 1.0.156 to 1.0.157 in /ql
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.156 to 1.0.157.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.156...v1.0.157)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 04:09:27 +00:00
github-actions[bot]
0d36a5a733 Add changed framework coverage reports 2023-03-20 00:17:11 +00:00
Ed Minnix
c852d3a541 Rename configurations from "Conf" to "Config" 2023-03-19 17:55:53 -04:00
Ed Minnix
2d5944fb0e Refactor DataFlow configurations to use "Config" naming convention 2023-03-19 17:44:07 -04:00
Ed Minnix
d743b31ab6 Fix typo in QLdoc 2023-03-19 13:45:46 -04:00
Mathias Vorreiter Pedersen
b0f803759c Merge pull request #11928 from rdmarsh2/rdmarsh2/stageify-range-analysis 2023-03-18 12:42:49 +00:00
Ed Minnix
00267637eb Implementation of check for DataFlow naming convention 2023-03-17 15:47:15 -04:00
Ed Minnix
7eb3fd2ff7 Conform queries to Config naming convention 2023-03-17 15:17:18 -04:00
Ed Minnix
d317de14c9 XXE Configuration Deprecation messages 2023-03-17 15:17:18 -04:00
Ed Minnix
310af99843 Refactor Security.CWE.CWE-807.TaintedPermissionsCheck 2023-03-17 15:17:18 -04:00
Ed Minnix
a9561a97c3 Refactor Security.CWE.CWE-643.XPathInjection 2023-03-17 15:17:18 -04:00
Ed Minnix
271d50ba99 Refactor Security.CWE.CWE-611 Xxe queries 2023-03-17 15:17:18 -04:00
Ed Minnix
80012b190d Refactor Security.CWE.CWE-601.UrlRedirect 2023-03-17 15:17:18 -04:00
Ed Minnix
481d1f9b15 Refactor Security.CWE.CWE-297.UnsafeHostnameVerification 2023-03-17 15:17:18 -04:00
Ed Minnix
7bd7ecd9e6 Refactor Security.CWE.CWE-190 Arithmetic queries 2023-03-17 15:17:18 -04:00
Ed Minnix
4a202b430f Security.CWE.CWE-200.AndroidWebViewSettingsAllowsContentAccess 2023-03-17 15:17:18 -04:00
Ed Minnix
d34dbbc96f Refactor Security.CWE.CWE-134.ExternallyControlledFormatString 2023-03-17 15:17:18 -04:00
Ed Minnix
ac223ea57f Refactor Security.CWE.CWE-094.InsecureBeanValidation 2023-03-17 15:17:18 -04:00
Ed Minnix
7aecefc4aa Refactor Security.CWE.CWE-090.LdapInjectionLib 2023-03-17 15:17:18 -04:00
Ed Minnix
07fdcf2d04 Refactor Security.CWE.CWE-022.ZipSlip 2023-03-17 15:17:18 -04:00
Ed Minnix
e60e1a2ba9 Refactor Security.CWE.CWE-022.TaintedPathLocal 2023-03-17 15:17:18 -04:00
Chuan-kai Lin
4dd7dbc73b Document upgrade query predicates 2023-03-17 11:06:39 -07:00
Stephan Brandauer
dce81cf0ae Merge pull request #12463 from github/java/update-mad-decls-after-triage-2023-03-09T10-41-58
Java: Add MaD declarations after triage
2023-03-17 17:02:42 +01:00
Robert Marsh
1e8404c954 C++: Remove fixed TODO
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-03-17 11:27:13 -04:00
Stephan Brandauer
8f565f5023 Update MaD Declarations after Triage 2023-03-17 16:01:36 +01:00
Robert Marsh
726f99975e C++: remove direct IR dependency in range analysis 2023-03-17 10:50:02 -04:00
github-actions[bot]
981e171525 Post-release preparation for codeql-cli-2.12.5 2023-03-17 13:27:00 +00:00
AlexDenisov
208ae192e4 Merge pull request #12567 from github/alexdenisov/swift-extracted-files
Swift: add a query showing successfully extracted files
2023-03-17 13:50:42 +01:00
Paolo Tranquilli
86b61d712c Merge pull request #12565 from github/redsun82/swift-remove-labels-from-function-type
Swift: remove parameter labels from function types
2023-03-17 13:49:37 +01:00
Asger F
d537f86324 Merge pull request #12555 from asgerf/js/block-modes
JS: Include weak block modes as sink in weak crypto algorithm
2023-03-17 13:23:23 +01:00
Henry Mercer
9d05d94f49 Merge pull request #12568 from github/rc/3.9
Merge `rc/3.9` back to `main`
2023-03-17 12:14:31 +00:00
Alex Ford
e84b08409c Ruby: test fixes 2023-03-17 12:08:38 +00:00
Erik Krogh Kristensen
ac85b6e74f Merge pull request #12011 from erik-krogh/ts50
JS: Add support for TypeScript 5.0
2023-03-17 13:03:47 +01:00
Chris Smowton
0cadf4d94a Merge pull request #12558 from smowton/smowton/fix/flow-to-external-api-write-only-methods
Go: exclude `net/http.Header.Set` and `.Del` from `go/untrusted-data-to-external-api`
2023-03-17 11:52:48 +00:00
Alex Ford
c12a85b07b Ruby: autoformat 2023-03-17 11:49:10 +00:00
Ian Lynagh
b8fb4b9b0f Merge pull request #12521 from igfoo/igfoo/printast_sig
Java: PrintAst: Improve the ranking of callables
2023-03-17 11:43:40 +00:00
Alex Ford
76ed56d2b6 Ruby: typo 2023-03-17 11:40:59 +00:00
Alex Ford
ee6288173f Ruby: remove extra opening p tag 2023-03-17 11:38:49 +00:00
Alex Ford
60f313863a Merge branch 'main' into maikypedia/ruby-ssti 2023-03-17 11:31:49 +00:00
Henry Mercer
d824695da2 Merge pull request #12561 from github/henrymercer/cli-prepare-diagnostics-rename
JS: Update for renamed `com.semmle.util.diagnostics` package
2023-03-17 10:31:27 +00:00
Alex Denisov
7c15527300 Swift: add a query showing successfully extracted files 2023-03-17 11:27:03 +01:00
Mathias Vorreiter Pedersen
1aecc64327 C++: Autoformat. 2023-03-17 09:37:46 +00:00
Michael Nebel
282b5d4836 Merge pull request #12538 from michaelnebel/emptypredworkaround
DataFlow: Workaround empty predicate usage in IPA branch.
2023-03-17 10:29:19 +01:00
Paolo Tranquilli
f2dff092dc Swift: remove parameter labels from function types
As discussed [in this accepted proposal][1], parameter labels do not
take part any more in making up a function type, so we need to not
extract them any more to avoid DB inconsistencies.

These were unused in the library, which makes the upgrade and downgrade
scripts have full compatibility.

[1]: 9c53790a13/proposals/0111-remove-arg-label-type-significance.md
2023-03-17 10:22:02 +01:00
Tom Hvitved
d2647850d2 Merge pull request #12564 from hvitved/ruby/remove-redundant-super-prefixes
Ruby: Remove some redundant `super` type qualifiers
2023-03-17 10:13:45 +01:00
Tom Hvitved
d146d816a9 Ruby: Fix semantic merge conflict 2023-03-17 09:59:44 +01:00
Tom Hvitved
e69e90db4a Ruby: Remove some redundant super type qualifiers 2023-03-17 09:32:13 +01:00
Tom Hvitved
75746cbacc Merge pull request #12549 from hvitved/ruby/ssa-write-access
Ruby: `Ssa::WriteDefinition::getWriteAccess` should return a CFG node
2023-03-17 09:31:14 +01:00
Tom Hvitved
ee01e9ab35 Merge pull request #12554 from hvitved/ruby/clear-text-logging-hashes
Ruby: Rely on built-in hash-flow in clear text storage query
2023-03-17 09:21:11 +01:00
Harry Maclean
5332344e5d Work around github actions bug 2023-03-17 12:13:30 +13:00
Harry Maclean
2abb03304d Install required dependencies for gh in centos 7 2023-03-17 11:56:04 +13:00
Harry Maclean
c447e125bb Ruby: Install gh cli in centos7 test 2023-03-17 10:59:49 +13:00
Harry Maclean
2c63dbad67 Merge pull request #11954 from hmac/sinatra
Ruby: Model Sinatra
2023-03-17 10:46:52 +13:00
erik-krogh
f1094cd3d6 bump to stable release 2023-03-16 22:38:54 +01:00
Harry Maclean
d4020ad305 Ruby: Run extractor test on centos 7 2023-03-17 10:38:45 +13:00
erik-krogh
f3c7aed1f9 bump to RC 2023-03-16 22:37:58 +01:00
erik-krogh
e00c41c6e2 add change-note and bump version 2023-03-16 22:37:56 +01:00
erik-krogh
a63739915d add test confirming support for const type parameters 2023-03-16 22:37:35 +01:00
erik-krogh
2c1c41d8a3 add test confirming end-to-end support for well-typed decorators with the new TS 5.0 type ClassMethodDecoratorContext 2023-03-16 22:37:35 +01:00
erik-krogh
d47659b48e upgrade to TypeScript 5.0 beta, and unbreak things that broke 2023-03-16 22:37:35 +01:00
Maiky
37e42bb05b Missing markdown extension 2023-03-16 20:45:35 +01:00
Mathias Vorreiter Pedersen
ebab6ecc30 Merge pull request #12559 from MathiasVP/test9-range-check 2023-03-16 19:18:38 +00:00
Henry Mercer
74cc1a42d0 JS: Update for renamed com.semmle.util.diagnostics package 2023-03-16 18:19:10 +00:00
Geoffrey White
880f948763 Merge pull request #12560 from geoffw0/testcustominterp
Swift: Add taint test for custom string interpolation.
2023-03-16 17:44:37 +00:00
Mathias Vorreiter Pedersen
406d02253d C++: Add 'range(x)' call demonstrating missing bounds. 2023-03-16 17:08:53 +00:00
Geoffrey White
3a04e42ae0 Swift: Add taint test for string interpolation. 2023-03-16 17:04:46 +00:00
Chris Smowton
3e9924fcd2 Add change note 2023-03-16 15:35:00 +00:00
Chris Smowton
647bd44666 Go: exclude net/http.Header.Set and .Del from go/untrusted-data-to-external-api
These functions (and doubtless many others) are write-only with respect to their receiver argument, so it doesn't really make sense to flag externally-controlled data flowing there.
2023-03-16 15:31:35 +00:00
Ian Lynagh
f9bb0df6a2 Kotlin: Update expected PrintAst output 2023-03-16 15:20:07 +00:00
Ian Lynagh
13c2ef8c20 Java: PrintAst: Improve the ranking or callables
We now look not only at how many parameters each callable has, but what
its full signature is. This allows us to give a consistent order to
    Test(Throwable) { ... }
    Test(String) { ... }
2023-03-16 15:20:07 +00:00
Maiky
a229f7a832 Solve merge conflict and add a change note 2023-03-16 16:15:02 +01:00
Tom Hvitved
f35fb13723 Add change note 2023-03-16 15:18:47 +01:00
Tom Hvitved
9d3863eccc Ruby: Rely on built-in hash-flow in clear text storage query 2023-03-16 14:55:06 +01:00
Asger F
bce1f29a7e JS: Add change note 2023-03-16 14:55:00 +01:00
Asger F
86a06bde72 JS: Flag crypto operations with weak block mode 2023-03-16 14:52:52 +01:00
Asger F
e907d685f4 JS: Add crypto test with AES-ECB 2023-03-16 14:52:18 +01:00
Tom Hvitved
ae10e6e08f Ruby: Add a test that shows FP/FN for clear text logging query 2023-03-16 14:38:45 +01:00
erik-krogh
880632f536 use Number.qll to parse hex numbers in regex parsing for Python/Java 2023-03-16 14:25:53 +01:00
Michael Nebel
3fea9e4d0b Sync files. 2023-03-16 14:12:29 +01:00
Michael Nebel
2e86bbd6cd Java: Introduce helper predicate to avoid empty predicate in IPA branch. 2023-03-16 14:11:53 +01:00
Geoffrey White
170fde5bc0 Swift: Add some more test cases. 2023-03-16 12:53:06 +00:00
Michael Nebel
a9e5b34ad6 Merge pull request #12200 from michaelnebel/csharp/viablestatic
C#: Support for virtual dispatch for operators.
2023-03-16 13:36:00 +01:00
erik-krogh
f718d78a9a avoid redundant sources 2023-03-16 13:34:01 +01:00
Mathias Vorreiter Pedersen
d02a50a504 Merge pull request #10817 from github/mathiasvp/replace-ast-with-ir-use-usedataflow
C++: Replace AST with IR use-use dataflow
2023-03-16 12:31:01 +00:00
erik-krogh
b208988675 Py: add test for problematic regex 2023-03-16 12:21:00 +01:00
erik-krogh
54ec047433 ReDoS: put an artificial limitation on the analysis in polynomial-redos for large regular expressions 2023-03-16 12:20:53 +01:00
Tom Hvitved
1d0b3d4112 Ruby: Ssa::WriteDefinition::getWriteAccess should return a CFG node 2023-03-16 11:28:24 +01:00
Chris Smowton
3ff60e076c Merge pull request #12548 from github/dependabot/github_actions/actions/setup-go-4
Bump actions/setup-go from 3 to 4
2023-03-16 10:21:51 +00:00
erik-krogh
8bc8342c7c Py:don't parse regular expressions in system-code 2023-03-16 10:41:30 +01:00
Erik Krogh Kristensen
be8f04a997 Merge pull request #12525 from github/dependabot/cargo/ql/serde-1.0.156
Bump serde from 1.0.155 to 1.0.156 in /ql
2023-03-16 10:36:11 +01:00
Erik Krogh Kristensen
48f889b055 Merge pull request #12496 from github/dependabot/cargo/ql/chrono-0.4.24
Bump chrono from 0.4.23 to 0.4.24 in /ql
2023-03-16 10:35:59 +01:00
Geoffrey White
7feab09ea9 Swift: Specialize the additional taint step a bit more. 2023-03-16 08:57:31 +00:00
dependabot[bot]
e999d33332 Bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 04:00:39 +00:00
Harry Maclean
0eb0c26b72 Ruby: Add some documentation
This is primarily to bust the build cache.
2023-03-16 12:24:47 +13:00
Harry Maclean
7b81fe3109 Ruby: fix conditional use of cross in build 2023-03-16 12:11:12 +13:00
Harry Maclean
e7ead76fe9 Ruby: Build extractor via cargo-cross on linux 2023-03-16 12:04:33 +13:00
Harry Maclean
907fbeaae8 Ruby: Update build instructions for new extractor 2023-03-16 11:54:47 +13:00
Harry Maclean
01a85164ee Ruby: Bump rust toolchain to 1.68 2023-03-16 11:54:47 +13:00
Robert Marsh
45fdf69461 C++: add SemLocation so SemBound is copy-shareable 2023-03-15 10:38:47 -04:00
Tony Torralba
5bc606753e org.openjdk.jmh.runner.options tests 2023-03-15 14:47:27 +01:00
Tony Torralba
3b4980ba2f org.kohsuke.stapler.model tests 2023-03-15 14:36:45 +01:00
Tony Torralba
c5a1905302 Fix stubs 2023-03-15 12:43:45 +01:00
Tony Torralba
341590f9ad org.kohsuke.stapler.framework.io tests 2023-03-15 11:43:52 +01:00
Tony Torralba
e0c852c0b8 Fix stubs and test expectations 2023-03-15 11:33:02 +01:00
erik-krogh
cc3efcd35e also restrict allowImplicitRead in unsafe-code-construction 2023-03-15 11:11:20 +01:00
erik-krogh
2133d1a5ab Merge branch 'main' into more-shell-taint 2023-03-15 10:54:30 +01:00
erik-krogh
a72436f6f1 recognize more express URL related sources 2023-03-15 10:14:31 +01:00
dependabot[bot]
f811436cff Bump serde from 1.0.155 to 1.0.156 in /ql
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.155 to 1.0.156.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.155...v1.0.156)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 04:05:38 +00:00
Robert Marsh
623e39031c C++: fix ModulusAnalysis test 2023-03-14 16:46:09 -04:00
Tony Torralba
fe1cc405eb org.kohsuke.stapler.framework.adjunct tests 2023-03-14 18:21:38 +01:00
Tony Torralba
44f239f4a4 Fix org.kohsuke.stapler.framework.adjunct models 2023-03-14 18:21:19 +01:00
Tony Torralba
cbc0ba6ac6 org.apache.tools.zip tests 2023-03-14 17:41:20 +01:00
Tony Torralba
7455c27086 org.apache.tools.ant.taskdefs tests 2023-03-14 17:28:35 +01:00
Geoffrey White
237669aab7 Merge branch 'main' into dbsinks2 2023-03-14 16:26:36 +00:00
Tony Torralba
6aa9726223 org.apache.tools.ant tests 2023-03-14 17:20:31 +01:00
Geoffrey White
725d784be8 Swift: Make the same result presentation change to swift/cleartext-storage-preferences. 2023-03-14 16:13:26 +00:00
Tony Torralba
db9e305a56 org.apache.commons.jelly tests 2023-03-14 17:04:14 +01:00
Geoffrey White
bfbd3d95f9 Swift: Clean up the result message. 2023-03-14 16:03:55 +00:00
Robert Marsh
267c341965 C++: exclude ZeroBounds in relative stage 2023-03-14 10:41:50 -04:00
Rasmus Lerchedahl Petersen
f1a8d4936f python: Fix link to type inference
Link to type tracking instead
and actually add link.
2023-03-14 13:45:30 +01:00
Tony Torralba
31667b4478 org.apache.commons.io tests 2023-03-14 12:50:09 +01:00
Tony Torralba
720cf0ab7a org.apache.commons.compress.archivers.tar tests 2023-03-14 12:31:26 +01:00
Tony Torralba
3db95f3ac9 javax.xml.transform.stream tests 2023-03-14 12:28:04 +01:00
Tony Torralba
d54abddab1 java.nio.file tests 2023-03-14 12:22:56 +01:00
Tony Torralba
2e7ad99059 Fix java.nio.file models 2023-03-14 11:51:44 +01:00
Tony Torralba
452b9d11db java.net tests 2023-03-14 11:43:23 +01:00
Tony Torralba
cad5cd4037 java.io tests 2023-03-14 11:21:33 +01:00
Tony Torralba
db83fe6f42 Fix incorrect java.io models 2023-03-14 11:21:17 +01:00
Tony Torralba
8cc2686a2f netty.resolver tests 2023-03-14 11:09:26 +01:00
Tony Torralba
1b85e8b706 hudson.remoting tests 2023-03-14 11:00:27 +01:00
Stephan Brandauer
ccf7d9beec Update MaD Declarations after Triage 2023-03-14 10:32:19 +01:00
erik-krogh
984a589954 don't depend on the callgraph in KernelArraySummary 2023-03-14 09:20:24 +01:00
erik-krogh
4307889b1f specialize allowImplicitRead in unsafe-shell-command-construction to fix performance 2023-03-14 08:42:11 +01:00
Robert Marsh
b4b7507fe4 C++: autoformat 2023-03-13 15:45:48 -04:00
erik-krogh
8b99e8af88 fix bad join by removing bad recursion 2023-03-13 17:34:11 +01:00
erik-krogh
25a6d496d9 Merge branch 'main' into HEAD 2023-03-13 17:33:06 +01:00
Michael Nebel
41b2273dee C#: Update expected test output. 2023-03-13 15:15:03 +01:00
Michael Nebel
e2479940d2 C#: Overridable operator support in dispatch. 2023-03-13 15:15:03 +01:00
Stephan Brandauer
05b0cc2231 Update MaD Declarations after Triage 2023-03-13 14:21:29 +01:00
dependabot[bot]
df45ba0476 Bump chrono from 0.4.23 to 0.4.24 in /ql
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.23 to 0.4.24.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.23...v0.4.24)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 12:25:21 +00:00
Michael Nebel
8398ee43b3 C#: Update test comment and expected test output. 2023-03-13 10:09:03 +01:00
Michael Nebel
a964f536e8 C#: Fix issue with dispatch to implementations of virtual interface members. 2023-03-13 10:09:03 +01:00
Michael Nebel
278f90e5fa C#: Update expected test output. 2023-03-13 10:09:03 +01:00
Michael Nebel
cfe2a76431 C#: Add viable callable test cases for statics in interfaces. 2023-03-13 10:09:03 +01:00
Asger F
ecb46e808c JS: extension point -> extensible predicate 2023-03-13 09:39:05 +01:00
Harry Maclean
3734a544bc Ruby: Add change note 2023-03-13 21:38:45 +13:00
Asger F
c4c0009f8a Apply suggestions from code review
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-03-13 09:35:35 +01:00
Harry Maclean
e80ff4efba Ruby: Fix tests and qldoc 2023-03-13 20:32:37 +13:00
Harry Maclean
071517c74b Ruby: Clean up Sinatra modeling 2023-03-13 19:25:56 +13:00
Harry Maclean
bfe42a656c Ruby: QL4QL fix 2023-03-13 19:04:46 +13:00
Harry Maclean
384e7c7a80 Jump step for sinatra callbacks 2023-03-13 19:03:32 +13:00
Harry Maclean
e65d7224db Ruby: tests, patterns, fix erb flow 2023-03-13 19:03:32 +13:00
Harry Maclean
eada3b91df Ruby: track flow from sinatra routes to erb files 2023-03-13 19:03:32 +13:00
Harry Maclean
c82b4638c6 Ruby: Import Sinatra modeling by default 2023-03-13 19:03:32 +13:00
Harry Maclean
a1fab31bfc Ruby: Model Sinatra
Adds some very basic modeling of Sinatra applications.
We recognise the `params` call in Sinatra routes as an HTTP request
input access.
2023-03-13 19:03:32 +13:00
Robert Marsh
d4e3f7f738 C++: fix missing bounds in new range analysis 2023-03-10 14:23:08 -05:00
Geoffrey White
e17c059f5e Swift: More reliable sink recognition.
This is needed for the real world results, but I could not reproduce the
issue in tests.  I think it may have  something to do with classes defined
across different files / modules???
2023-03-09 17:17:42 +00:00
Geoffrey White
ffa279e87b Swift: Add additional taint steps into fields.
ed
2023-03-09 17:17:42 +00:00
Geoffrey White
da338c26ba Swift: Add a few more test cases for sensitive data. 2023-03-09 11:39:22 +00:00
Rasmus Lerchedahl Petersen
bbb43a53e5 python: add test for captured variables
this illustrates that the function implementing
the comprehension does not capture `mod_local`.

We could handle this case specially, by having
a different implementation for `for`, but the
wider issue would remain.
2023-03-09 11:44:58 +01:00
Robert Marsh
b941d54f1f C++ Move RangeAnalysis to work around shadowing 2023-03-08 11:32:37 -05:00
Robert Marsh
50fac3060c C++: split RA into constant and relative phases 2023-03-08 11:32:36 -05:00
Maiky
5a9a90d00b Move query to experimental 2023-03-08 11:50:04 +01:00
Maiky
d9d63bbdc6 Change ERB to Erb 2023-03-08 10:41:24 +01:00
Maiky
3e1808d92e Apply suggestions from code review
Co-authored-by: Alex Ford <alexrford@users.noreply.github.com>
2023-03-08 10:30:43 +01:00
Maiky
cd49175fae Update ruby/ql/src/queries/security/cwe-094/TemplateInjection.qhelp
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2023-03-08 10:27:57 +01:00
Maiky
cbb031ee14 Update ruby/ql/src/queries/security/cwe-094/TemplateInjection.qhelp
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2023-03-08 10:27:39 +01:00
yoff
25fbd9c323 Merge branch 'main' into python/rewrite-InsecureContextConfiguration 2023-03-07 14:44:37 +01:00
Rasmus Lerchedahl Petersen
072df5dbc0 python: remove protocol family
this concept was due to my confusion between
TLS and SSL23, but they are aliases.

We might want to bring back the concept if we model DTLS.

Also, model what exactly creations allow,
bring this back from the unrestrictions they used to be.

We accept the changes regarding sources being reported differently.
2023-03-07 14:41:13 +01:00
Rasmus Lerchedahl Petersen
8160f742a5 Python: small clean-up
- no need for th 2-suffix
- context creations are no longer unrestrictions
2023-03-06 19:47:53 +01:00
Rasmus Wriedt Larsen
2cc8fbaa50 Python: Accept changes due to better import resolution of operator.py 2023-03-06 14:48:48 +01:00
Rasmus Lerchedahl Petersen
f8b5a820f4 python: revert change in expected behaviour 2023-03-06 14:31:17 +01:00
Asger F
3d5c06b782 Revert "JS: Remove public links to customization docs"
This reverts commit b9b8b8b28a.
2023-03-06 12:46:12 +01:00
Rasmus Wriedt Larsen
35bd809baf Merge branch 'main' into import-refined 2023-03-06 11:22:56 +01:00
Asger F
b9b8b8b28a JS: Remove public links to customization docs 2023-03-03 13:46:15 +01:00
erik-krogh
6cd4cd332d remove redundant imports 2023-03-01 16:25:01 +01:00
Asger F
e09975f853 JS: Replace 'remote-flow' kind with 'remote' 2023-03-01 13:46:13 +01:00
erik-krogh
31336b09c4 add summary for the Array method on Kernel 2023-03-01 12:53:13 +01:00
erik-krogh
36b33765a5 use allowImplicitRead instead of a taint-step from elements to the array 2023-02-28 16:09:52 +01:00
Ahmed Farid
6a578c62b0 Update TimingAttack.qll 2023-02-27 22:16:09 +01:00
erik-krogh
b0797a2559 Merge branch 'main' into more-shell-taint 2023-02-27 18:27:09 +01:00
Rasmus Wriedt Larsen
be7d6689b8 Merge branch 'main' into import-refined 2023-02-27 17:00:48 +01:00
Rasmus Wriedt Larsen
11000fd123 Python: Fix ModuleExport.ql test for Python 2 2023-02-27 17:00:17 +01:00
Maikypedia
44997d6b5f Change query id 2023-02-25 15:51:04 +01:00
Maikypedia
61fe3704c0 Remove unused imports 2023-02-25 15:43:48 +01:00
Maikypedia
dd1f7cc1d2 Remove missed file 2023-02-25 15:35:16 +01:00
Maikypedia
ff50513441 Add initial query for Ruby SSTI 2023-02-25 15:33:23 +01:00
Rasmus Wriedt Larsen
b7bdc551d5 Python: Show import resolution is a bit generous with exported value 2023-02-23 00:55:58 +01:00
Rasmus Wriedt Larsen
96c0d95b10 Python: Illustrate that clashing_attr can be submodule 2023-02-23 00:55:58 +01:00
Rasmus Wriedt Larsen
13ae98ea76 Python: Fix submodule exported under wrong name (when attribute clash) 2023-02-23 00:55:30 +01:00
Rasmus Wriedt Larsen
373907265b Python: Fixed most problems from last commit
That one line was an afterthought, and certainly did not work as
intended.
2023-02-23 00:39:45 +01:00
Rasmus Wriedt Larsen
97fefd2545 Python: Attempt to fix import flow
It's nice that it fixes the `InsecureProtocol` test-case (which maybe
should have been a test-case for the import resolution library in the
first place?)

But it's not quite right:

1. it adds spurious flow for `clashing_attr`
2. it runs into huge problems for typetracking_imports/tracked.expected
3. it runs into the problem for
   https://github.com/github/codeql/pull/10176 with an `from <pkg>
   import *` blocking flow from previously defined variable, that is NOT
   overridden. (simplistic_reexport.bar_attr)
2023-02-23 00:36:30 +01:00
Rasmus Wriedt Larsen
bea0acb497 Python: Add barrier test to import resolution
Just like the one added for `py/insecure-protocol` in fb425b7, but
instead added in the import-resolution tests, such that we don't have to
remember it's in a completely different directory.
2023-02-23 00:33:12 +01:00
Rasmus Wriedt Larsen
321a4b4ef2 Python: ModuleExport.ql test: ignore main.py
It's not very useful to look at, and it's a mess when you change any
tests to see all the changes lines in the expected output that you
really do not care about!
2023-02-23 00:31:05 +01:00
Rasmus Wriedt Larsen
8eaaf8e3e5 Python: Ignore trace.py in ModuleExport.ql test
I guess we could have done this at the very start of introducing this
test in this PR, but I think the last commit was mostly inspired from
looking at all the things that evidently was re-exported from the trace
import, even when I knew they were not available because of the
`__all__` definition.
2023-02-22 15:42:28 +01:00
Rasmus Wriedt Larsen
c8a76246d8 Python: Take __all__ into consideration for re-export of from <pkg> import *
However, we can see that `from <pkg> import *` and `import pkg` are
handled differently. Would have liked `has_defined_all_indirection` to
behave in the same way no matter how the import was made.
2023-02-22 15:39:57 +01:00
Rasmus Wriedt Larsen
be5812cf91 Python: from <pkg> import * ignores __all__ regression
Notice that `has_defined_all_indirection` all have both
`all_defined_bar_copy` and `all_defined_foo_copy` marked as exported,
even though only `all_defined_foo_copy` is available.
2023-02-22 15:38:24 +01:00
Rasmus Wriedt Larsen
d77ce4f3d7 Python: minor rewrite of from <pkg> import * handling 2023-02-22 15:00:55 +01:00
Rasmus Wriedt Larsen
4df7dfbff6 Python: Don't import module as module_attr
For `from <pkg> import <attr>` we would use to treat the `<pkg>`
(ImportExpr) as a definition of the name `<attr>`.

Since this removes bad import-flow, and nothing broke, I'm guessing this
was never intentional.
2023-02-22 14:52:35 +01:00
Rasmus Wriedt Larsen
6ba39d5fb3 Python: Add import regression for re-exported things 2023-02-22 14:50:42 +01:00
Rasmus Wriedt Larsen
6a5eebe891 Python: Add test of module_export 2023-02-22 12:26:01 +01:00
Rasmus Wriedt Larsen
4a66e48dc5 Python: Allow import resolution with recursive phi/refine steps 2023-02-21 17:46:39 +01:00
Rasmus Wriedt Larsen
e522009666 Python: More complex import examples
We need some recursive unwinding to get all of these right
2023-02-21 17:46:28 +01:00
Rasmus Wriedt Larsen
00eec6986c Python: Allow import of refined variable
However, as illustrated by the `CWE-327-InsecureProtocol` test, this fix
is NOT good enough, since now even the `secure_context` is considered to
be insecure (for both versions). Ouch.

Will fix this in a later commit, since it was only discoverd late on.
2023-02-21 17:45:58 +01:00
Rasmus Wriedt Larsen
fb425b73fc Python: Add import test of py/insecure-protocol 2023-02-21 17:43:04 +01:00
Rasmus Wriedt Larsen
27e2307d0c Python: Add import regression for refined variable 2023-02-17 16:34:34 +01:00
Ahmed Farid
ccbb58966f Update TimingAttack.qll 2023-02-16 14:15:04 +01:00
Ahmed Farid
a421e3a3a3 Update TimingAttackAgainstHeaderValue.ql 2023-02-16 14:14:43 +01:00
Ahmed Farid
f57861b6a3 Update TimingAttack.qll 2023-02-16 14:14:13 +01:00
Ahmed Farid
f70f5c7935 Update TimingAttackAgainstHeaderValue.ql 2023-02-16 14:03:26 +01:00
Ahmed Farid
4b3efa87dc Update TimingAttack.qll 2023-02-16 14:01:29 +01:00
Ahmed Farid
005839b462 Update TimingAttack.qll 2023-02-16 12:49:40 +01:00
Ahmed Farid
01b865f75b Update TimingAttack.qll 2023-02-16 01:36:06 +01:00
Ahmed Farid
fbfe23b7c4 Update TimingAttack.qll 2023-02-16 01:21:50 +01:00
Ahmed Farid
b8f9b2b424 Update TimingAttackAgainstHeaderValue.ql 2023-02-16 01:11:41 +01:00
Ahmed Farid
016136a2e3 Update TimingAttack.qll 2023-02-16 01:10:36 +01:00
erik-krogh
17f7ba2a8f rewrite the taint-step for join() to a flowsummary 2023-02-15 12:34:59 +01:00
erik-krogh
d2bd70dc33 Merge branch 'main' into more-shell-taint 2023-02-15 11:35:58 +01:00
erik-krogh
c2e8206090 add more array taint steps that taint the entire array 2023-01-30 21:14:27 +01:00
erik-krogh
962465f77a add array-taint-steps to unsafe-shell-command-construction 2023-01-30 16:56:03 +01:00
erik-krogh
a4c42aa14b more custom array steps from unsafe-code-construction to a utility predicate 2023-01-30 16:46:13 +01:00
Asger F
c2a10a3206 JS: Elaborate on comment about window 2022-12-15 12:46:46 +01:00
Asger F
2052ba6fa6 JS: sake of example -> this example 2022-12-15 12:45:53 +01:00
Asger F
fb6a6e550c JS: Factor beta notice into a reusable snippet 2022-12-15 12:42:59 +01:00
Asger F
3f4ecd5fdd JS: Add underscore.forEach example 2022-12-15 12:21:03 +01:00
Asger F
cfdac73948 JS: Add decodeURIComponent example 2022-12-15 12:21:03 +01:00
Asger F
5c14eabb0c JS: Remove broken link to 'sink kinds' section 2022-12-15 12:21:03 +01:00
Asger F
1c3dd93cbe JS: Rename section and remove broken link
It seems Sphinx just isn't capable of rendering these intra-document links.
2022-12-15 11:46:27 +01:00
Asger F
fab798d654 JS: Add some text at the beginning of the reference 2022-12-15 11:45:53 +01:00
Asger F
bbce52535a JS: Add clarification in another customization doc 2022-12-13 15:34:54 +01:00
Asger F
111cabbfc1 JS: Add deprecation notice to page about JSON-based format 2022-12-13 15:34:54 +01:00
Asger F
9ce0c60247 JS: Rephrase link in ToC 2022-12-13 15:34:54 +01:00
Asger F
b3a1d02d8c JS: Add data extension docs 2022-12-13 15:34:54 +01:00
Rasmus Lerchedahl Petersen
820d94098f python: port py/comparison-using-is
see triage [here](https://github.com/github/codeql-python-team/issues/628#issuecomment-1328933001)
- no longer try to interpret the class of operands
- simply alert in clear bad cases of uninterned literals
- surprisingly(?), all tests still pass
2022-12-01 09:56:51 +01:00
Ben Rodes
50691ecc45 Merge pull request #19 from raulgarciamsft/16-detecting-private-key-usage-windows-cng-apis
16 detecting private key usage windows cng apis
2022-11-09 10:11:52 -05:00
REDMOND\brodes
345b7e4c4e Comments. 2022-11-08 15:43:23 -05:00
REDMOND\brodes
68d668e719 Final bug fixes and new sink. 2022-11-08 15:40:00 -05:00
REDMOND\brodes
59ca3b26cd Adding SslEncryptPacket sink. 2022-11-08 15:00:21 -05:00
REDMOND\brodes
60a67dce73 Adding NCryptEncrypt sink 2022-11-08 14:57:34 -05:00
REDMOND\brodes
24382453c3 More comments, and added sink BCryptGenerateKeyPair 2022-11-08 14:21:10 -05:00
REDMOND\brodes
f5ce07d22c Class re-org 2022-11-08 13:40:47 -05:00
REDMOND\brodes
b15a5a9030 Comments and reorg. 2022-11-08 13:04:51 -05:00
REDMOND\brodes
5f2a42bb48 Changing predicate names. 2022-11-08 12:53:34 -05:00
REDMOND\brodes
46bfa35c35 More reformatting 2022-11-08 12:52:41 -05:00
REDMOND\brodes
b242b4bba6 More re-org 2022-11-08 12:49:57 -05:00
REDMOND\brodes
da8a7f36d1 More cleanup 2022-11-08 12:43:22 -05:00
REDMOND\brodes
eceda7a787 More cleanup 2022-11-08 12:39:49 -05:00
REDMOND\brodes
43760b6bb1 Misc. compartmentalization and naming changes. 2022-11-08 12:20:15 -05:00
REDMOND\brodes
1e9c2b3335 Applied formatting. 2022-11-08 12:13:05 -05:00
REDMOND\brodes
7a27635a11 Moving queries and modifying query to include BCryptEncrypt 2022-11-08 12:11:43 -05:00
REDMOND\brodes
19321634da Merge branch '16-detecting-private-key-usage-windows-cng-apis' of https://github.com/raulgarciamsft/ql into 16-detecting-private-key-usage-windows-cng-apis
# Conflicts:
#	cpp/ql/src/experimental/campaigns/nccoe-pqc-migration/QuantumVulnerableDiscovery/WindowsCngPQCVAsymmetricKeyUsage.qll
2022-11-08 10:59:51 -05:00
REDMOND\brodes
96116c2d2d Suggested query changes. 2022-11-08 10:59:13 -05:00
Ben Rodes
ad29826135 Merge pull request #18 from raulgarciamsft/nccoe-pqc-migration
Initial PR - Proof of Concept using CNG
2022-11-08 09:23:40 -05:00
Raul Garcia
d4ba46ce82 Initial PR - Proof of Concept using CNG 2022-11-07 15:05:28 -08:00
Raul Garcia
cd51b4991d Initial CHeckin - CNG basic case 2022-10-18 11:48:13 -07:00
Ahmed Farid
64bb022adf Add www-authenticate to sensitiveheaders() 2022-09-07 11:12:53 +01:00
Taus
0b8bdc0f85 Python: Fix broken test 2022-09-06 16:37:43 +00:00
Ahmed Farid
23871b3f5a Update Concepts.qll 2022-09-05 18:26:56 +01:00
Ahmed Farid
f84331f5a5 Provides classes for modeling HTTP Header APIs 2022-09-05 00:53:10 +01:00
Ahmed Farid
94b91536f9 Replacing getParameter by getArg and getArgByName 2022-09-03 14:05:07 +01:00
Ahmed Farid
a50c226ca9 Autoformat 2022-09-03 12:10:55 +01:00
Ahmed Farid
0fd684cde8 Add more source of crypto call 2022-08-31 17:13:43 +01:00
Ahmed Farid
cf83b07aae Add more source of crypto call 2022-08-31 17:04:02 +01:00
Ahmed Farid
daff7775ca Update TimingAttack.qll 2022-08-31 16:09:22 +01:00
Ahmed Farid
a42cb20b86 Update TimingAttack.qll 2022-08-31 16:07:58 +01:00
Ahmed Farid
8153b790ad Update test result 2022-08-31 16:01:09 +01:00
Ahmed Farid
56d48e6264 Add more tests 2022-08-31 15:59:51 +01:00
Ahmed Farid
13d1a4fdc1 Update TimingAttackAgainstHeaderValue.ql 2022-08-31 12:46:17 +01:00
Ahmed Farid
12960fd00f Update TimingAttack.qll 2022-08-31 12:39:46 +01:00
Ahmed Farid
f2688c4a02 Update select statement 2022-08-31 12:39:00 +01:00
Ahmed Farid
275ed0d6e5 Update select statement 2022-08-31 12:37:36 +01:00
Ahmed Farid
740bf716cb Update TimingAttack.qll 2022-08-31 12:22:01 +01:00
Ahmed Farid
ca28d79541 Prevent crosstalk between the configurations 2022-08-31 11:15:39 +01:00
Ahmed Farid
133a3c19f0 Add more source of crypto call 2022-08-31 11:09:24 +01:00
Ahmed Farid
23f268f3b9 Import Django and Flask model 2022-08-30 16:39:40 +01:00
Ahmed Farid
de58d0f024 Update the subclasses of ClientSuppliedSecret class 2022-08-30 16:34:43 +01:00
Ahmed Farid
0177cd810e Update suspicious() 2022-08-30 13:58:54 +01:00
Ahmed Farid
9995e91bb7 Update the name of the class (and its subclasses) 2022-08-29 18:57:56 +01:00
Ahmed Farid
b2551a5581 Update the name of the class (and its subclasses) 2022-08-29 18:30:43 +01:00
Ahmed Farid
baa0fd4148 Convert %UserPass% word to lowercase 2022-08-29 18:25:26 +01:00
Ahmed Farid
141b65fea8 Fix typo 2022-08-29 18:18:19 +01:00
Ahmed Farid
199e3d9462 Rename the query ID 2022-08-29 18:13:45 +01:00
Ahmed Farid
66fb420d00 Update PossibleTimingAttackAgainstHash.ql 2022-08-29 18:08:09 +01:00
Ahmed Farid
93257be913 Add Werkzeug source 2022-08-23 12:51:48 +01:00
Ahmed Farid
ee05e2ca76 add x-gitlab-token to sensitive headers 2022-08-23 12:27:20 +01:00
Taus
bd45ea94d0 Python: Fix TimingAttackAgainstHash.ql select 2022-08-19 12:31:12 +00:00
Taus
687cd92903 Python: Update .expected file 2022-08-19 11:43:57 +00:00
Taus
3d17989107 Python: Fix broken select statement
Based on the alert description, "message" seemed like a suitable word to
use here.
2022-08-17 17:09:18 +00:00
Taus
76de2f4203 Python: Remove trailing newlines
These were causing the autoformatting check to fail. I'm not really sure
how these newlines got introduced. Possibly some editor option or
`git-commit` hook?
2022-08-17 15:12:51 +00:00
Ahmed Farid
313dbc9120 Autoformat PossibleTimingAttackAgainstSensitiveInfo.ql 2022-08-17 12:59:09 +01:00
Ahmed Farid
9f3de035c7 Autoformat PossibleTimingAttackAgainstHash.ql 2022-08-17 12:57:57 +01:00
Ahmed Farid
cb5331bdd8 Autoformat TimingAttackAgainstHeaderValue.ql 2022-08-17 12:54:34 +01:00
Ahmed Farid
a7dcf96f55 Autoformat TimingAttackAgainstSensitiveInfo.ql 2022-08-17 12:53:07 +01:00
Ahmed Farid
9b4d1789b1 Autoformat TimingAttackAgainstHash.ql 2022-08-17 12:49:58 +01:00
Ahmed Farid
b29ca57ce1 Autoformat TimingAttack.qll 2022-08-17 12:46:57 +01:00
Ahmed Farid
5daeea7aeb Adjust the @id property 2022-08-17 12:24:40 +01:00
Ahmed Farid
01828936e2 fix qhelp 2022-08-17 12:19:44 +01:00
Ahmed Farid
10d5ab20f5 fix qhelp 2022-08-17 12:19:02 +01:00
Ahmed Farid
9cb7a0ac2e Rename python/ql/test/experimental/query-tests/Security/CWE-208/PossibleTimingAttackAgainstSensitiveInfo.qlref to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.qlref 2022-08-16 16:29:05 +01:00
Ahmed Farid
685cd97b8e Rename python/ql/test/experimental/query-tests/Security/CWE-208/PossibleTimingAttackAgainstSensitiveInfo.expected to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.expected 2022-08-16 16:28:51 +01:00
Ahmed Farid
2377880d0c Rename python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstSensitiveInfo.py to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstSensitiveInfo/TimingAttackAgainstSensitiveInfo.py 2022-08-16 16:28:36 +01:00
Ahmed Farid
f956fe12d5 Rename python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHeaderValue.qlref to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.qlref 2022-08-16 16:28:17 +01:00
Ahmed Farid
6536b602df Rename python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHeaderValue.expected to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.expected 2022-08-16 16:28:00 +01:00
Ahmed Farid
b8fe0e2eee Rename python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHeader.py to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeader.py 2022-08-16 16:27:45 +01:00
Ahmed Farid
87b67ed64f Rename python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHash.py to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.py 2022-08-16 16:27:19 +01:00
Ahmed Farid
fa3940f69a Rename python/ql/test/experimental/query-tests/Security/CWE-208/PossibleTimingAttackAgainstHash.qlref to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.qlref 2022-08-16 16:27:02 +01:00
Ahmed Farid
6a94d45643 Rename python/ql/test/experimental/query-tests/Security/CWE-208/PossibleTimingAttackAgainstHash.expected to python/ql/test/experimental/query-tests/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.expected 2022-08-16 16:26:45 +01:00
Ahmed Farid
31ecb0727f Rename TimingAttackAgainstHeader.expected to TimingAttackAgainstHeaderValue.expected 2022-08-16 14:50:54 +01:00
Ahmed Farid
d8719f3b1f Rename TimingAttackAgainstSensitiveInfo.expected to PossibleTimingAttackAgainstSensitiveInfo.expected 2022-08-16 14:50:21 +01:00
Ahmed Farid
67476d0a36 Rename TimingAttackAgainstSensitiveInfo.qlref to PossibleTimingAttackAgainstSensitiveInfo.qlref 2022-08-16 13:36:59 +01:00
Ahmed Farid
e8376a522c Update TimingAttackAgainstHeaderValue.qlref 2022-08-16 13:35:20 +01:00
Ahmed Farid
ecbe663c2f Update TimingAttackAgainstSensitiveInfo.qlref 2022-08-16 13:34:24 +01:00
Ahmed Farid
1dd4400c67 Update PossibleTimingAttackAgainstHash.qlref 2022-08-16 13:33:17 +01:00
Ahmed Farid
abcfb1cd63 Update TimingAttack.qll 2022-08-16 12:33:19 +01:00
Ahmed Farid
44f054bede Update PossibleTimingAttackAgainstHash.expected 2022-08-16 12:31:33 +01:00
Ahmed Farid
74f68aa60a Update TimingAttackAgainstHeader.expected 2022-08-16 12:20:52 +01:00
Ahmed Farid
abc49bd62b Update TimingAttackAgainstHeader.py 2022-08-16 12:06:34 +01:00
Ahmed Farid
68cf084b8f Update TimingAttackAgainstSensitiveInfo.expected 2022-08-16 12:03:14 +01:00
Ahmed Farid
c85ad1b2c0 Update TimingAttackAgainstHash.py 2022-08-16 11:50:37 +01:00
Ahmed Farid
5ecadd06ae Update TimingAttackAgainstHash.py 2022-08-15 15:21:10 +01:00
Ahmed Farid
169d27951a Update UnSafeComparisonOfSensitiveInfo.py 2022-08-15 15:19:13 +01:00
Ahmed Farid
dbd6076725 Update SafeComparisonOfSensitiveInfo.py 2022-08-15 15:18:09 +01:00
Ahmed Farid
f2bf58bdb6 Update TimingAttackAgainstSensitiveInfo.py 2022-08-15 15:16:30 +01:00
Ahmed Farid
8ebf428078 Update SafeComparisonOfSensitiveInfo.py 2022-08-15 15:15:24 +01:00
Ahmed Farid
054e0726b0 Update UnsafeComparisonOfHeaderValue.py 2022-08-15 15:13:17 +01:00
Ahmed Farid
c578a34892 Update SafeComparisonOfHeaderValue.py 2022-08-15 15:12:38 +01:00
Ahmed Farid
773bb5fffd Update SafeComparisonOfHeaderValue.py 2022-08-15 14:43:32 +01:00
Ahmed Farid
a724bd1e32 Update UnSafeComparisonOfSensitiveInfo.py 2022-08-15 14:42:17 +01:00
Ahmed Farid
18b103dbd5 Update TimingAttackAgainstHash.py 2022-08-15 11:29:29 +01:00
Ahmed Farid
7d23b80582 Update TimingAttackAgainstHash.py 2022-08-15 11:29:09 +01:00
Ahmed Farid
521dbd0e82 Update TimingAttackAgainstSensitiveInfo.py 2022-08-15 11:28:51 +01:00
Ahmed Farid
5de103303d Update TimingAttackAgainstHeader.py 2022-08-15 11:26:34 +01:00
Ahmed Farid
7cb1683f5b Update TimingAttackAgainstSensitiveInfo.py 2022-08-15 11:21:40 +01:00
Ahmed Farid
0e0c6e08b5 Update TimingAttack.qll 2022-08-15 11:18:31 +01:00
Ahmed Farid
01490414e8 Update TimingAttackAgainstHeader.py 2022-08-12 12:25:31 +01:00
Ahmed Farid
21f9ee449a Delete UnSafeComparison.py 2022-08-05 12:49:00 +01:00
Ahmed Farid
d9e85a9064 Delete SafeComparison.py 2022-08-05 12:48:51 +01:00
Ahmed Farid
c7828bf9b4 Create UnSafeComparisonOfSensitiveInfo.py 2022-08-05 12:47:58 +01:00
Ahmed Farid
dd61383469 Create SafeComparisonOfSensitiveInfo.py 2022-08-05 12:46:46 +01:00
Ahmed Farid
5eef14a0a9 Update SafeComparisonOfHeaderValue.py 2022-08-04 12:51:30 +01:00
Ahmed Farid
a6af455eae Create UnsafeComparisonOfHeaderValue.py 2022-08-04 12:50:55 +01:00
Ahmed Farid
a98a77ad40 Create SafeComparisonOfHeaderValue.py 2022-08-04 12:48:19 +01:00
Ahmed Farid
e1435afea9 Rename python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue.qhelp to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.qhelp 2022-08-04 12:45:01 +01:00
Ahmed Farid
76c8e7d2e8 Rename python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue.ql to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHeaderValue/TimingAttackAgainstHeaderValue.ql 2022-08-04 12:44:45 +01:00
Ahmed Farid
428132a58e Rename python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo.ql to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/TimingAttackAgainstSensitiveInfo.ql 2022-08-04 12:44:10 +01:00
Ahmed Farid
a34478d58f Rename python/ql/src/experimental/Security/CWE-208/PossibleTimingAttackAgainstSensitiveInfo.ql to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.ql 2022-08-04 12:43:53 +01:00
Ahmed Farid
59f05b4d62 Rename python/ql/src/experimental/Security/CWE-208/PossibleTimingAttackAgainstSensitiveInfo.qhelp to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/PossibleTimingAttackAgainstSensitiveInfo.qhelp 2022-08-04 12:43:35 +01:00
Ahmed Farid
fe51a917ec Rename python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo.qhelp to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstSensitiveInfo/TimingAttackAgainstSensitiveInfo.qhelp 2022-08-04 12:43:21 +01:00
Ahmed Farid
ae4ded08fa Update and rename TimingAttackAgainstHeader.qlref to TimingAttackAgainstHeaderValue.qlref 2022-08-04 12:42:52 +01:00
Ahmed Farid
a747bacbe5 Rename python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash.ql to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.ql 2022-08-04 12:42:08 +01:00
Ahmed Farid
cf36a30909 Rename python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash.qhelp to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.qhelp 2022-08-04 12:41:51 +01:00
Ahmed Farid
4b0c42951f Rename python/ql/src/experimental/Security/CWE-208/UnSafeComparisonOfHash.py to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/UnSafeComparisonOfHash.py 2022-08-04 12:41:27 +01:00
Ahmed Farid
cf47104f62 Update TimingAttackAgainstHeaderValue.ql 2022-08-04 12:39:31 +01:00
Ahmed Farid
8490a54af5 Update TimingAttackAgainstSensitiveInfo.ql 2022-08-04 12:38:31 +01:00
Ahmed Farid
31692f523f Update PossibleTimingAttackAgainstHash.ql 2022-08-04 12:37:57 +01:00
Ahmed Farid
61b7d89813 Update TimingAttackAgainstHash.ql 2022-08-04 12:36:58 +01:00
Ahmed Farid
b5ff606b41 Update PossibleTimingAttackAgainstSensitiveInfo.ql 2022-08-04 12:36:36 +01:00
Ahmed Farid
ad53176546 Rename python/ql/src/experimental/Security/CWE-208/TimingAttack.qll to python/ql/src/experimental/semmle/python/security/TimingAttack.qll 2022-08-04 12:35:24 +01:00
Ahmed Farid
028ac19259 Rename python/ql/src/experimental/Security/CWE-208/SafeComparisonOfHash.py to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/SafeComparisonOfHash.py 2022-08-04 12:30:56 +01:00
Ahmed Farid
5afc0a7773 Rename python/ql/src/experimental/Security/CWE-208/PossibleTimingAttackAgainstHash.ql to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.ql 2022-08-04 12:30:38 +01:00
Ahmed Farid
035de1fffe Rename python/ql/src/experimental/Security/CWE-208/PossibleTimingAttackAgainstHash.qhelp to python/ql/src/experimental/Security/CWE-208/TimingAttackAgainstHash/PossibleTimingAttackAgainstHash.qhelp 2022-08-04 12:30:12 +01:00
Ahmed Farid
e28cf7ebe2 Create UnSafeComparisonOfHash.py 2022-08-04 12:28:46 +01:00
Ahmed Farid
9c0a71d880 Update SafeComparisonOfHash.py 2022-08-04 12:27:35 +01:00
Ahmed Farid
1fed6074e9 Create SafeComparisonOfHash.py 2022-08-04 12:25:47 +01:00
Ahmed Farid
c59a8b0c57 Create PossibleTimingAttackAgainstSensitiveInfo.qhelp 2022-08-04 12:17:43 +01:00
Ahmed Farid
c13477c14f Update and rename TimingAttack.qhelp to TimingAttackAgainstSensitiveInfo.qhelp 2022-08-04 12:16:06 +01:00
Ahmed Farid
10df8e6c02 Rename TimingAttackAgainstHeader.ql to TimingAttackAgainstHeaderValue.ql 2022-08-04 12:12:44 +01:00
Ahmed Farid
399972071c Rename TimingAttackAgainstHeaderValue.ql to TimingAttackAgainstHeaderValue.qhelp 2022-08-04 12:11:28 +01:00
Ahmed Farid
89e1ad40f2 Create TimingAttackAgainstHeaderValue.ql 2022-08-04 12:10:06 +01:00
Ahmed Farid
2bb9448c9f Create PossibleTimingAttackAgainstHash.qhelp 2022-08-04 12:03:48 +01:00
Ahmed Farid
473ff0ef59 Create TimingAttackAgainstHash.qhelp 2022-08-04 12:02:50 +01:00
Ahmed Farid
9b2ff70332 format document 2022-08-04 00:56:30 +01:00
Ahmed Farid
813e2394f7 Merge branch 'main' into timing-attack-py 2022-07-27 14:40:55 +01:00
Ahmed Farid
e3340c9345 Update TimingAttackAgainstSensitiveInfo.py 2022-07-27 00:25:42 +01:00
Ahmed Farid
11e888f0ac Update TimingAttackAgainstSensitiveInfo.expected 2022-07-27 00:25:13 +01:00
Ahmed Farid
ca4fa0aaae Update TimingAttack.qll 2022-07-27 00:06:28 +01:00
Ahmed Farid
ad57ff4def Rename PossibleTimingAttackAgainstSignature.qlref to PossibleTimingAttackAgainstHash.qlref 2022-07-26 23:56:24 +01:00
Ahmed Farid
d01d7ba766 Create PossibleTimingAttackAgainstSensitiveInfo.ql 2022-07-26 23:53:39 +01:00
Ahmed Farid
0083a7fa6d Update TimingAttackAgainstSensitiveInfo.ql 2022-07-26 23:53:18 +01:00
Ahmed Farid
f35985097d Update and rename PossibleTimingAttackAgainstSignature.expected to PossibleTimingAttackAgainstHash.expected 2022-07-26 23:50:44 +01:00
Ahmed Farid
d68f8c5325 Update PossibleTimingAttackAgainstHash.ql 2022-07-26 16:44:33 +01:00
Ahmed Farid
bdf94ceeee Update TimingAttackAgainstHash.ql 2022-07-26 16:44:08 +01:00
Ahmed Farid
32d380828d Update TimingAttackAgainstSensitiveInfo.ql 2022-07-26 16:41:23 +01:00
Ahmed Farid
b42293dbbb Update TimingAttackAgainstSensitiveInfo.ql 2022-07-26 16:40:24 +01:00
Ahmed Farid
735fee53a4 Update TimingAttack.qll 2022-07-26 16:35:26 +01:00
Ahmed Farid
bfb8395dce Update TimingAttackAgainstSensitiveInfo.ql 2022-07-26 16:05:57 +01:00
Ahmed Farid
9c08f9fbe6 Update TimingAttackAgainstHeader.ql 2022-07-26 15:38:37 +01:00
Ahmed Farid
912f40255d Update TimingAttackAgainstSensitiveInfo.ql 2022-07-26 15:37:02 +01:00
Ahmed Farid
961cc8778f Update PossibleTimingAttackAgainstHash.ql 2022-07-26 15:36:07 +01:00
Ahmed Farid
2f3172e74b Update TimingAttackAgainstHeader.ql 2022-07-26 15:34:40 +01:00
Ahmed Farid
dc89773fe8 Update TimingAttack.qll 2022-07-26 15:30:31 +01:00
Ahmed Farid
c98af44df8 Update Concepts.qll 2022-07-26 15:15:06 +01:00
Ahmed Farid
e6dd21a57d Update Frameworks.qll 2022-07-26 15:14:02 +01:00
Ahmed Farid
656e8cf44e Delete CryptographicOperation.qll 2022-07-26 15:13:32 +01:00
Ahmed Farid
2f72cc5ca8 Update PossibleTimingAttackAgainstHash.ql 2022-07-22 03:28:32 +01:00
Ahmed Farid
fd558604cc Update TimingAttack.qll 2022-07-21 18:48:07 +01:00
Ahmed Farid
6a782f47a9 Update Frameworks.qll 2022-07-20 13:08:21 +01:00
Ahmed Farid
6871790793 Rename TimingAttackAgainstSignature.ql to TimingAttackAgainstHash.ql 2022-07-20 13:07:14 +01:00
Ahmed Farid
7d0d39e019 Update PossibleTimingAttackAgainstHash.ql 2022-07-20 13:05:49 +01:00
Ahmed Farid
ee743e61e9 Update TimingAttack.qll 2022-07-20 13:03:55 +01:00
Ahmed Farid
238d3250c3 Update Concepts.qll 2022-07-20 13:00:30 +01:00
Ahmed Farid
e7742bd87c Create CryptographicOperation.qll
Provides models for Python's Cryptography-related libraries
2022-07-20 12:58:13 +01:00
Ahmed Farid
4f082e28e5 Update and rename TimingAttackAgainstSignature.py to TimingAttackAgainstHash.py 2022-07-20 12:26:57 +01:00
Ahmed Farid
b3925ae988 Update PossibleTimingAttackAgainstSignature.qlref 2022-07-20 00:57:26 +01:00
Ahmed Farid
3d092f9569 Update TimingAttackAgainstSignature.ql 2022-07-20 00:56:52 +01:00
Ahmed Farid
27d81548a7 Update PossibleTimingAttackAgainstHash.ql 2022-07-20 00:55:22 +01:00
Ahmed Farid
bfce1898b9 Update and rename PossibleTimingAttackAgainstSignature.ql to PossibleTimingAttackAgainstHash.ql 2022-07-20 00:49:09 +01:00
Ahmed Farid
7406273346 Update TimingAttack.qhelp 2022-07-14 17:56:58 +01:00
Ahmed Farid
f4654136d6 Update TimingAttack.qhelp 2022-07-14 17:56:13 +01:00
Taus
ec363166ba Python: Make UserInputMsgConfig public 2022-07-11 15:24:31 +02:00
Ahmed Farid
f5d0791b4f Update TimingAttack.qll 2022-06-29 00:56:15 +01:00
Ahmed Farid
98909c2069 Update TimingAttackAgainstSensitiveInfo.ql 2022-06-29 00:55:21 +01:00
Ahmed Farid
41b4c06f2d Update TimingAttackAgainstSignature.ql 2022-06-29 00:54:44 +01:00
Ahmed Farid
e20fefc3ad Update TimingAttackAgainstHeader.ql 2022-06-29 00:54:03 +01:00
Ahmed Farid
5742046edf Update PossibleTimingAttackAgainstSignature.ql 2022-06-29 00:51:51 +01:00
Ahmed Farid
acbb4042df Update TimingAttack.qhelp 2022-06-29 00:51:12 +01:00
root
655b9d4262 Python: Timing attack 2022-06-27 12:18:45 -04:00
2575 changed files with 248593 additions and 140748 deletions

View File

@@ -1,102 +0,0 @@
name: "ATM - Check query suite"
env:
QUERY_PACK: javascript/ql/experimental/adaptivethreatmodeling/src
QUERY_SUITE: codeql-suites/javascript-atm-code-scanning.qls
on:
pull_request:
paths:
- ".github/workflows/atm-check-query-suite.yml"
- "javascript/ql/experimental/adaptivethreatmodeling/**"
workflow_dispatch:
jobs:
atm-check-query-suite:
runs-on: ubuntu-latest-xl
steps:
- uses: actions/checkout@v3
- name: Setup CodeQL
uses: ./.github/actions/fetch-codeql
with:
channel: release
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: atm-suite
- name: Install ATM model
run: |
set -exu
# Install dependencies of ATM query pack, i.e. the ATM model
codeql pack install "${QUERY_PACK}"
# Retrieve model checksum
model_checksum=$(codeql resolve extensions "${QUERY_PACK}/${QUERY_SUITE}" | jq -r '.models[0].checksum')
# Trust the model so that we can use it in the ATM boosted queries
mkdir -p "$HOME/.config/codeql"
echo "--insecurely-execute-ml-model-checksums ${model_checksum}" >> "$HOME/.config/codeql/config"
- name: Create test DB
run: |
DB_PATH="${RUNNER_TEMP}/db"
echo "DB_PATH=${DB_PATH}" >> "${GITHUB_ENV}"
codeql database create "${DB_PATH}" --source-root config/atm --language javascript
- name: Run ATM query suite
run: |
SARIF_PATH="${RUNNER_TEMP}/sarif.json"
echo "SARIF_PATH=${SARIF_PATH}" >> "${GITHUB_ENV}"
codeql database analyze \
--threads=0 \
--ram 50000 \
--format sarif-latest \
--output "${SARIF_PATH}" \
--sarif-group-rules-by-pack \
-vv \
--compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" \
-- \
"${DB_PATH}" \
"${QUERY_PACK}/${QUERY_SUITE}"
- name: Upload SARIF
uses: actions/upload-artifact@v3
with:
name: javascript-ml-powered-queries.sarif
path: "${{ env.SARIF_PATH }}"
retention-days: 5
- name: Check results
run: |
# We should run at least the ML-powered queries in `expected_rules`.
expected_rules="js/ml-powered/nosql-injection js/ml-powered/path-injection js/ml-powered/sql-injection js/ml-powered/xss"
for rule in ${expected_rules}; do
found_rule=$(jq --arg rule "${rule}" '[.runs[0].tool.extensions[].rules | select(. != null) |
flatten | .[].id] | any(. == $rule)' "${SARIF_PATH}")
if [[ "${found_rule}" != "true" ]]; then
echo "Expected SARIF output to contain rule '${rule}', but found no such rule."
exit 1
else
echo "Found rule '${rule}'."
fi
done
# We should have at least one alert from an ML-powered query.
num_alerts=$(jq '[.runs[0].results[] |
select(.properties.score != null and (.rule.id | startswith("js/ml-powered/")))] | length' \
"${SARIF_PATH}")
if [[ "${num_alerts}" -eq 0 ]]; then
echo "Expected to find at least one alert from an ML-powered query but found ${num_alerts}."
exit 1
else
echo "Found ${num_alerts} alerts from ML-powered queries.";
fi

View File

@@ -1,12 +0,0 @@
name: ATM Model Integration Tests
on:
workflow_dispatch:
jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- name: foo
run: echo "Hello world"

View File

@@ -8,6 +8,7 @@ on:
- "*/ql/src/**/*.qll"
- "*/ql/lib/**/*.ql"
- "*/ql/lib/**/*.qll"
- "*/ql/lib/**/*.yml"
- "!**/experimental/**"
- "!ql/**"
- "!swift/**"

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Comment or remove the `Stale` label in order to avoid having this issue closed in 7 days.'

50
.github/workflows/fast-forward.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
# Fast-forwards the branch specified in BRANCH_NAME
# to the github.ref/sha that this workflow is run on.
# Used as part of the release process, to ensure
# external query writers can always access a branch of github/codeql
# that is compatible with the latest stable release.
name: Fast-forward tracking branch for selected CodeQL version
on:
workflow_dispatch:
jobs:
fast-forward:
name: Fast-forward tracking branch for selected CodeQL version
runs-on: ubuntu-latest
if: github.repository == 'github/codeql'
permissions:
contents: write
env:
BRANCH_NAME: 'lgtm.com'
steps:
- name: Validate chosen branch
if: ${{ !startsWith(github.ref_name, 'codeql-cli-') }}
shell: bash
run: |
echo "::error ::The $BRANCH_NAME tracking branch should only be fast-forwarded to the tip of a codeql-cli-* branch, got $GITHUB_REF_NAME instead."
exit 1
- name: Checkout
uses: actions/checkout@v3
- name: Git config
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Fetch
shell: bash
run: |
set -x
echo "Fetching $BRANCH_NAME"
# Explicitly unshallow and fetch to ensure the remote ref is available.
git fetch --unshallow origin "$BRANCH_NAME"
git checkout -b "$BRANCH_NAME" "origin/$BRANCH_NAME"
- name: Fast-forward
shell: bash
run: |
echo "Fast-forwarding $BRANCH_NAME to ${GITHUB_REF}@${GITHUB_SHA}"
git merge --ff-only "$GITHUB_SHA"
git push origin "$BRANCH_NAME"

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.20.0
id: go
@@ -48,7 +48,7 @@ jobs:
runs-on: windows-latest-xl
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.20.0
id: go

View File

@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest-xl
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.20.0
id: go

View File

@@ -48,6 +48,9 @@ jobs:
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Install cargo-cross
if: runner.os == 'Linux'
run: cargo install cross --version 0.2.5
- uses: ./.github/actions/os-version
id: os_version
- name: Cache entire extractor
@@ -78,8 +81,18 @@ jobs:
- name: Run tests
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cd extractor && cargo test --verbose
- name: Release build
if: steps.cache-extractor.outputs.cache-hit != 'true'
# On linux, build the extractor via cross in a centos7 container.
# This ensures we don't depend on glibc > 2.17.
- name: Release build (linux)
if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: |
cd extractor
cross build --release
mv target/x86_64-unknown-linux-gnu/release/extractor target/release/
mv target/x86_64-unknown-linux-gnu/release/autobuilder target/release/
mv target/x86_64-unknown-linux-gnu/release/generator target/release/
- name: Release build (windows and macos)
if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os != 'Linux'
run: cd extractor && cargo build --release
- name: Generate dbscheme
if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}}
@@ -227,3 +240,54 @@ jobs:
shell: bash
run: |
codeql database analyze --search-path "${{ runner.temp }}/ruby-bundle" --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls
# This is a copy of the 'test' job that runs in a centos7 container.
# This tests that the extractor works correctly on systems with an old glibc.
test-centos7:
defaults:
run:
working-directory: ${{ github.workspace }}
strategy:
fail-fast: false
runs-on: ubuntu-latest
container:
image: centos:centos7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs: [package]
steps:
- name: Install gh cli
run: |
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
# fetch-codeql requires unzip and jq
# jq is available in epel-release (https://docs.fedoraproject.org/en-US/epel/)
yum install -y gh unzip epel-release
yum install -y jq
- uses: actions/checkout@v3
- name: Fetch CodeQL
uses: ./.github/actions/fetch-codeql
# Due to a bug in Actions, we can't use runner.temp in the run blocks here.
# https://github.com/actions/runner/issues/2185
- name: Download Ruby bundle
uses: actions/download-artifact@v3
with:
name: codeql-ruby-bundle
path: ${{ runner.temp }}
- name: Unzip Ruby bundle
shell: bash
run: unzip -q -d "$RUNNER_TEMP"/ruby-bundle "$RUNNER_TEMP"/codeql-ruby-bundle.zip
- name: Run QL test
shell: bash
run: |
codeql test run --search-path "$RUNNER_TEMP"/ruby-bundle --additional-packs "$RUNNER_TEMP"/ruby-bundle ruby/ql/test/library-tests/ast/constants/
- name: Create database
shell: bash
run: |
codeql database create --search-path "$RUNNER_TEMP"/ruby-bundle --language ruby --source-root ruby/ql/test/library-tests/ast/constants/ ../database
- name: Analyze database
shell: bash
run: |
codeql database analyze --search-path "$RUNNER_TEMP"/ruby-bundle --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls

View File

@@ -4,6 +4,7 @@ on:
push:
paths:
- "ruby/**"
- "shared/**"
- .github/workflows/ruby-build.yml
- .github/actions/fetch-codeql/action.yml
- codeql-workspace.yml

View File

@@ -19,7 +19,7 @@ repos:
rev: v1.6.0
hooks:
- id: autopep8
files: ^swift/.*\.py
files: ^misc/codegen/.*\.py
- repo: local
hooks:

View File

@@ -123,6 +123,10 @@
"java/ql/src/utils/modelgenerator/internal/CaptureModels.qll",
"csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll"
],
"Model as Data Generation Java/C# - CaptureModelsPrinting": [
"java/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll",
"csharp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll"
],
"Sign Java/C#": [
"java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll"
@@ -279,6 +283,11 @@
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/IRBlockImports.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/IRBlockImports.qll"
],
"C++ IR IRConsistencyImports": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/IRConsistencyImports.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/IRConsistencyImports.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/IRConsistencyImports.qll"
],
"C++ IR IRFunctionImports": [
"cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/IRFunctionImports.qll",
"cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/IRFunctionImports.qll",
@@ -591,4 +600,4 @@
"python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll",
"java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll"
]
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
description: Revert support for repeated initializers, which are allowed in C with designated initializers.
compatibility: full
aggregate_field_init.rel: reorder aggregate_field_init.rel (int aggregate, int initializer, int field, int position) aggregate initializer field
aggregate_array_init.rel: reorder aggregate_array_init.rel (int aggregate, int initializer, int element_index, int position) aggregate initializer element_index

View File

@@ -1,3 +1,33 @@
## 0.7.0
### Breaking Changes
* The internal `SsaConsistency` module has been moved from `SSAConstruction` to `SSAConsitency`, and the deprecated `SSAConsistency` module has been removed.
### Deprecated APIs
* The single-parameter predicates `ArrayOrVectorAggregateLiteral.getElementExpr` and `ClassAggregateLiteral.getFieldExpr` have been deprecated in favor of `ArrayOrVectorAggregateLiteral.getAnElementExpr` and `ClassAggregateLiteral.getAFieldExpr`.
* The recently introduced new data flow and taint tracking APIs have had a
number of module and predicate renamings. The old APIs remain in place for
now.
* The `SslContextCallAbstractConfig`, `SslContextCallConfig`, `SslContextCallBannedProtocolConfig`, `SslContextCallTls12ProtocolConfig`, `SslContextCallTls13ProtocolConfig`, `SslContextCallTlsProtocolConfig`, `SslContextFlowsToSetOptionConfig`, `SslOptionConfig` dataflow configurations from `BoostorgAsio` have been deprecated. Please use `SslContextCallConfigSig`, `SslContextCallGlobal`, `SslContextCallFlow`, `SslContextCallBannedProtocolFlow`, `SslContextCallTls12ProtocolFlow`, `SslContextCallTls13ProtocolFlow`, `SslContextCallTlsProtocolFlow`, `SslContextFlowsToSetOptionFlow`.
### New Features
* Added overridable predicates `getSizeExpr` and `getSizeMult` to the `BufferAccess` class (`semmle.code.cpp.security.BufferAccess.qll`). This makes it possible to model a larger class of buffer reads and writes using the library.
### Minor Analysis Improvements
* The `BufferAccess` library (`semmle.code.cpp.security.BufferAccess`) no longer matches buffer accesses inside unevaluated contexts (such as inside `sizeof` or `decltype` expressions). As a result, queries using this library may see fewer false positives.
### Bug Fixes
* Fixed some accidental predicate visibility in the backwards-compatible wrapper for data flow configurations. In particular `DataFlow::hasFlowPath`, `DataFlow::hasFlow`, `DataFlow::hasFlowTo`, and `DataFlow::hasFlowToExpr` were accidentally exposed in a single version.
## 0.6.1
No user-facing changes.
## 0.6.0
### Breaking Changes

View File

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

View File

@@ -0,0 +1,25 @@
## 0.7.0
### Breaking Changes
* The internal `SsaConsistency` module has been moved from `SSAConstruction` to `SSAConsitency`, and the deprecated `SSAConsistency` module has been removed.
### Deprecated APIs
* The single-parameter predicates `ArrayOrVectorAggregateLiteral.getElementExpr` and `ClassAggregateLiteral.getFieldExpr` have been deprecated in favor of `ArrayOrVectorAggregateLiteral.getAnElementExpr` and `ClassAggregateLiteral.getAFieldExpr`.
* The recently introduced new data flow and taint tracking APIs have had a
number of module and predicate renamings. The old APIs remain in place for
now.
* The `SslContextCallAbstractConfig`, `SslContextCallConfig`, `SslContextCallBannedProtocolConfig`, `SslContextCallTls12ProtocolConfig`, `SslContextCallTls13ProtocolConfig`, `SslContextCallTlsProtocolConfig`, `SslContextFlowsToSetOptionConfig`, `SslOptionConfig` dataflow configurations from `BoostorgAsio` have been deprecated. Please use `SslContextCallConfigSig`, `SslContextCallGlobal`, `SslContextCallFlow`, `SslContextCallBannedProtocolFlow`, `SslContextCallTls12ProtocolFlow`, `SslContextCallTls13ProtocolFlow`, `SslContextCallTlsProtocolFlow`, `SslContextFlowsToSetOptionFlow`.
### New Features
* Added overridable predicates `getSizeExpr` and `getSizeMult` to the `BufferAccess` class (`semmle.code.cpp.security.BufferAccess.qll`). This makes it possible to model a larger class of buffer reads and writes using the library.
### Minor Analysis Improvements
* The `BufferAccess` library (`semmle.code.cpp.security.BufferAccess`) no longer matches buffer accesses inside unevaluated contexts (such as inside `sizeof` or `decltype` expressions). As a result, queries using this library may see fewer false positives.
### Bug Fixes
* Fixed some accidental predicate visibility in the backwards-compatible wrapper for data flow configurations. In particular `DataFlow::hasFlowPath`, `DataFlow::hasFlow`, `DataFlow::hasFlowTo`, and `DataFlow::hasFlowToExpr` were accidentally exposed in a single version.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.6.0
lastReleaseVersion: 0.7.0

View File

@@ -1,17 +1,146 @@
import semmle.code.cpp.ir.dataflow.DataFlow
import semmle.code.cpp.ir.dataflow.DataFlow2
private import codeql.util.Unit
module ProductFlow {
abstract class Configuration extends string {
bindingset[this]
Configuration() { any() }
signature module ConfigSig {
/**
* Holds if `(source1, source2)` is a relevant data flow source.
*
* `source1` and `source2` must belong to the same callable.
*/
predicate isSourcePair(DataFlow::Node source1, DataFlow::Node source2) { none() }
predicate isSourcePair(DataFlow::Node source1, DataFlow::Node source2);
/**
* Holds if `(sink1, sink2)` is a relevant data flow sink.
*
* `sink1` and `sink2` must belong to the same callable.
*/
predicate isSinkPair(DataFlow::Node sink1, DataFlow::Node sink2);
/**
* Holds if data flow through `node` is prohibited through the first projection of the product
* dataflow graph.
*/
default predicate isBarrier1(DataFlow::Node node) { none() }
/**
* Holds if data flow through `node` is prohibited through the second projection of the product
* dataflow graph.
*/
default predicate isBarrier2(DataFlow::Node node) { none() }
/**
* Holds if data flow out of `node` is prohibited in the first projection of the product
* dataflow graph.
*/
default predicate isBarrierOut1(DataFlow::Node node) { none() }
/**
* Holds if data flow out of `node` is prohibited in the second projection of the product
* dataflow graph.
*/
default predicate isBarrierOut2(DataFlow::Node node) { none() }
/*
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps in
* the first projection of the product dataflow graph.
*/
default predicate isAdditionalFlowStep1(DataFlow::Node node1, DataFlow::Node node2) { none() }
/**
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps in
* the second projection of the product dataflow graph.
*/
default predicate isAdditionalFlowStep2(DataFlow::Node node1, DataFlow::Node node2) { none() }
/**
* Holds if data flow into `node` is prohibited in the first projection of the product
* dataflow graph.
*/
default predicate isBarrierIn1(DataFlow::Node node) { none() }
/**
* Holds if data flow into `node` is prohibited in the second projection of the product
* dataflow graph.
*/
default predicate isBarrierIn2(DataFlow::Node node) { none() }
}
module Global<ConfigSig Config> {
private module StateConfig implements StateConfigSig {
class FlowState1 = Unit;
class FlowState2 = Unit;
predicate isSourcePair(
DataFlow::Node source1, FlowState1 state1, DataFlow::Node source2, FlowState2 state2
) {
exists(state1) and
exists(state2) and
Config::isSourcePair(source1, source2)
}
predicate isSinkPair(
DataFlow::Node sink1, FlowState1 state1, DataFlow::Node sink2, FlowState2 state2
) {
exists(state1) and
exists(state2) and
Config::isSinkPair(sink1, sink2)
}
predicate isBarrier1(DataFlow::Node node, FlowState1 state) {
exists(state) and
Config::isBarrier1(node)
}
predicate isBarrier2(DataFlow::Node node, FlowState2 state) {
exists(state) and
Config::isBarrier2(node)
}
predicate isBarrier1 = Config::isBarrier1/1;
predicate isBarrier2 = Config::isBarrier2/1;
predicate isBarrierOut1 = Config::isBarrierOut1/1;
predicate isBarrierOut2 = Config::isBarrierOut2/1;
predicate isAdditionalFlowStep1 = Config::isAdditionalFlowStep1/2;
predicate isAdditionalFlowStep1(
DataFlow::Node node1, FlowState1 state1, DataFlow::Node node2, FlowState1 state2
) {
exists(state1) and
exists(state2) and
Config::isAdditionalFlowStep1(node1, node2)
}
predicate isAdditionalFlowStep2 = Config::isAdditionalFlowStep2/2;
predicate isAdditionalFlowStep2(
DataFlow::Node node1, FlowState2 state1, DataFlow::Node node2, FlowState2 state2
) {
exists(state1) and
exists(state2) and
Config::isAdditionalFlowStep2(node1, node2)
}
predicate isBarrierIn1 = Config::isBarrierIn1/1;
predicate isBarrierIn2 = Config::isBarrierIn2/1;
}
import GlobalWithState<StateConfig>
}
signature module StateConfigSig {
bindingset[this]
class FlowState1;
bindingset[this]
class FlowState2;
/**
* Holds if `(source1, source2)` is a relevant data flow source with initial states `state1`
@@ -20,20 +149,8 @@ module ProductFlow {
* `source1` and `source2` must belong to the same callable.
*/
predicate isSourcePair(
DataFlow::Node source1, DataFlow::FlowState state1, DataFlow::Node source2,
DataFlow::FlowState state2
) {
state1 = "" and
state2 = "" and
this.isSourcePair(source1, source2)
}
/**
* Holds if `(sink1, sink2)` is a relevant data flow sink.
*
* `sink1` and `sink2` must belong to the same callable.
*/
predicate isSinkPair(DataFlow::Node sink1, DataFlow::Node sink2) { none() }
DataFlow::Node source1, FlowState1 state1, DataFlow::Node source2, FlowState2 state2
);
/**
* Holds if `(sink1, sink2)` is a relevant data flow sink with final states `state1`
@@ -42,60 +159,51 @@ module ProductFlow {
* `sink1` and `sink2` must belong to the same callable.
*/
predicate isSinkPair(
DataFlow::Node sink1, DataFlow::FlowState state1, DataFlow::Node sink2,
DataFlow::FlowState state2
) {
state1 = "" and
state2 = "" and
this.isSinkPair(sink1, sink2)
}
DataFlow::Node sink1, FlowState1 state1, DataFlow::Node sink2, FlowState2 state2
);
/**
* Holds if data flow through `node` is prohibited through the first projection of the product
* dataflow graph when the flow state is `state`.
*/
predicate isBarrier1(DataFlow::Node node, DataFlow::FlowState state) {
this.isBarrier1(node) and state = ""
}
predicate isBarrier1(DataFlow::Node node, FlowState1 state);
/**
* Holds if data flow through `node` is prohibited through the second projection of the product
* dataflow graph when the flow state is `state`.
*/
predicate isBarrier2(DataFlow::Node node, DataFlow::FlowState state) {
this.isBarrier2(node) and state = ""
}
predicate isBarrier2(DataFlow::Node node, FlowState2 state);
/**
* Holds if data flow through `node` is prohibited through the first projection of the product
* dataflow graph.
*/
predicate isBarrier1(DataFlow::Node node) { none() }
default predicate isBarrier1(DataFlow::Node node) { none() }
/**
* Holds if data flow through `node` is prohibited through the second projection of the product
* dataflow graph.
*/
predicate isBarrier2(DataFlow::Node node) { none() }
default predicate isBarrier2(DataFlow::Node node) { none() }
/**
* Holds if data flow out of `node` is prohibited in the first projection of the product
* dataflow graph.
*/
predicate isBarrierOut1(DataFlow::Node node) { none() }
default predicate isBarrierOut1(DataFlow::Node node) { none() }
/**
* Holds if data flow out of `node` is prohibited in the second projection of the product
* dataflow graph.
*/
predicate isBarrierOut2(DataFlow::Node node) { none() }
default predicate isBarrierOut2(DataFlow::Node node) { none() }
/*
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps in
* the first projection of the product dataflow graph.
*/
predicate isAdditionalFlowStep1(DataFlow::Node node1, DataFlow::Node node2) { none() }
default predicate isAdditionalFlowStep1(DataFlow::Node node1, DataFlow::Node node2) { none() }
/**
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps in
@@ -104,19 +212,14 @@ module ProductFlow {
* This step is only applicable in `state1` and updates the flow state to `state2`.
*/
predicate isAdditionalFlowStep1(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
state1 instanceof DataFlow::FlowStateEmpty and
state2 instanceof DataFlow::FlowStateEmpty and
this.isAdditionalFlowStep1(node1, node2)
}
DataFlow::Node node1, FlowState1 state1, DataFlow::Node node2, FlowState1 state2
);
/**
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps in
* the second projection of the product dataflow graph.
*/
predicate isAdditionalFlowStep2(DataFlow::Node node1, DataFlow::Node node2) { none() }
default predicate isAdditionalFlowStep2(DataFlow::Node node1, DataFlow::Node node2) { none() }
/**
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps in
@@ -125,177 +228,168 @@ module ProductFlow {
* This step is only applicable in `state1` and updates the flow state to `state2`.
*/
predicate isAdditionalFlowStep2(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
state1 instanceof DataFlow::FlowStateEmpty and
state2 instanceof DataFlow::FlowStateEmpty and
this.isAdditionalFlowStep2(node1, node2)
}
DataFlow::Node node1, FlowState2 state1, DataFlow::Node node2, FlowState2 state2
);
/**
* Holds if data flow into `node` is prohibited in the first projection of the product
* dataflow graph.
*/
predicate isBarrierIn1(DataFlow::Node node) { none() }
default predicate isBarrierIn1(DataFlow::Node node) { none() }
/**
* Holds if data flow into `node` is prohibited in the second projection of the product
* dataflow graph.
*/
predicate isBarrierIn2(DataFlow::Node node) { none() }
default predicate isBarrierIn2(DataFlow::Node node) { none() }
}
predicate hasFlowPath(
DataFlow::PathNode source1, DataFlow2::PathNode source2, DataFlow::PathNode sink1,
DataFlow2::PathNode sink2
module GlobalWithState<StateConfigSig Config> {
class PathNode1 = Flow1::PathNode;
class PathNode2 = Flow2::PathNode;
module PathGraph1 = Flow1::PathGraph;
module PathGraph2 = Flow2::PathGraph;
class FlowState1 = Config::FlowState1;
class FlowState2 = Config::FlowState2;
predicate flowPath(
Flow1::PathNode source1, Flow2::PathNode source2, Flow1::PathNode sink1, Flow2::PathNode sink2
) {
reachable(this, source1, source2, sink1, sink2)
reachable(source1, source2, sink1, sink2)
}
}
private import Internal
private module Config1 implements DataFlow::StateConfigSig {
class FlowState = FlowState1;
module Internal {
class Conf1 extends DataFlow::Configuration {
Conf1() { this = "Conf1" }
override predicate isSource(DataFlow::Node source, DataFlow::FlowState state) {
exists(Configuration conf | conf.isSourcePair(source, state, _, _))
predicate isSource(DataFlow::Node source, FlowState state) {
Config::isSourcePair(source, state, _, _)
}
override predicate isSink(DataFlow::Node sink, DataFlow::FlowState state) {
exists(Configuration conf | conf.isSinkPair(sink, state, _, _))
predicate isSink(DataFlow::Node sink, FlowState state) {
Config::isSinkPair(sink, state, _, _)
}
override predicate isBarrier(DataFlow::Node node, DataFlow::FlowState state) {
exists(Configuration conf | conf.isBarrier1(node, state))
}
predicate isBarrier(DataFlow::Node node, FlowState state) { Config::isBarrier1(node, state) }
override predicate isBarrierOut(DataFlow::Node node) {
exists(Configuration conf | conf.isBarrierOut1(node))
}
predicate isBarrierOut(DataFlow::Node node) { Config::isBarrierOut1(node) }
override predicate isAdditionalFlowStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
predicate isAdditionalFlowStep(
DataFlow::Node node1, FlowState1 state1, DataFlow::Node node2, FlowState state2
) {
exists(Configuration conf | conf.isAdditionalFlowStep1(node1, state1, node2, state2))
Config::isAdditionalFlowStep1(node1, state1, node2, state2)
}
override predicate isBarrierIn(DataFlow::Node node) {
exists(Configuration conf | conf.isBarrierIn1(node))
}
predicate isBarrierIn(DataFlow::Node node) { Config::isBarrierIn1(node) }
}
class Conf2 extends DataFlow2::Configuration {
Conf2() { this = "Conf2" }
module Flow1 = DataFlow::GlobalWithState<Config1>;
override predicate isSource(DataFlow::Node source, DataFlow::FlowState state) {
exists(Configuration conf, DataFlow::PathNode source1 |
conf.isSourcePair(source1.getNode(), source1.getState(), source, state) and
any(Conf1 c).hasFlowPath(source1, _)
module Config2 implements DataFlow::StateConfigSig {
class FlowState = FlowState2;
predicate isSource(DataFlow::Node source, FlowState state) {
exists(Flow1::PathNode source1 |
Config::isSourcePair(source1.getNode(), source1.getState(), source, state) and
Flow1::flowPath(source1, _)
)
}
override predicate isSink(DataFlow::Node sink, DataFlow::FlowState state) {
exists(Configuration conf, DataFlow::PathNode sink1 |
conf.isSinkPair(sink1.getNode(), sink1.getState(), sink, state) and
any(Conf1 c).hasFlowPath(_, sink1)
predicate isSink(DataFlow::Node sink, FlowState state) {
exists(Flow1::PathNode sink1 |
Config::isSinkPair(sink1.getNode(), sink1.getState(), sink, state) and
Flow1::flowPath(_, sink1)
)
}
override predicate isBarrier(DataFlow::Node node, DataFlow::FlowState state) {
exists(Configuration conf | conf.isBarrier2(node, state))
}
predicate isBarrier(DataFlow::Node node, FlowState state) { Config::isBarrier2(node, state) }
override predicate isBarrierOut(DataFlow::Node node) {
exists(Configuration conf | conf.isBarrierOut2(node))
}
predicate isBarrierOut(DataFlow::Node node) { Config::isBarrierOut2(node) }
override predicate isAdditionalFlowStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
predicate isAdditionalFlowStep(
DataFlow::Node node1, FlowState state1, DataFlow::Node node2, FlowState state2
) {
exists(Configuration conf | conf.isAdditionalFlowStep2(node1, state1, node2, state2))
Config::isAdditionalFlowStep2(node1, state1, node2, state2)
}
override predicate isBarrierIn(DataFlow::Node node) {
exists(Configuration conf | conf.isBarrierIn2(node))
}
predicate isBarrierIn(DataFlow::Node node) { Config::isBarrierIn2(node) }
}
}
pragma[nomagic]
private predicate reachableInterprocEntry(
Configuration conf, DataFlow::PathNode source1, DataFlow2::PathNode source2,
DataFlow::PathNode node1, DataFlow2::PathNode node2
) {
conf.isSourcePair(node1.getNode(), node1.getState(), node2.getNode(), node2.getState()) and
node1 = source1 and
node2 = source2
or
exists(
DataFlow::PathNode midEntry1, DataFlow2::PathNode midEntry2, DataFlow::PathNode midExit1,
DataFlow2::PathNode midExit2
|
reachableInterprocEntry(conf, source1, source2, midEntry1, midEntry2) and
interprocEdgePair(midExit1, midExit2, node1, node2) and
localPathStep1*(midEntry1, midExit1) and
localPathStep2*(midEntry2, midExit2)
)
}
module Flow2 = DataFlow::GlobalWithState<Config2>;
private predicate localPathStep1(DataFlow::PathNode pred, DataFlow::PathNode succ) {
DataFlow::PathGraph::edges(pred, succ) and
pragma[only_bind_out](pred.getNode().getEnclosingCallable()) =
pragma[only_bind_out](succ.getNode().getEnclosingCallable())
}
pragma[nomagic]
private predicate reachableInterprocEntry(
Flow1::PathNode source1, Flow2::PathNode source2, Flow1::PathNode node1, Flow2::PathNode node2
) {
Config::isSourcePair(node1.getNode(), node1.getState(), node2.getNode(), node2.getState()) and
node1 = source1 and
node2 = source2
or
exists(
Flow1::PathNode midEntry1, Flow2::PathNode midEntry2, Flow1::PathNode midExit1,
Flow2::PathNode midExit2
|
reachableInterprocEntry(source1, source2, midEntry1, midEntry2) and
interprocEdgePair(midExit1, midExit2, node1, node2) and
localPathStep1*(midEntry1, midExit1) and
localPathStep2*(midEntry2, midExit2)
)
}
private predicate localPathStep2(DataFlow2::PathNode pred, DataFlow2::PathNode succ) {
DataFlow2::PathGraph::edges(pred, succ) and
pragma[only_bind_out](pred.getNode().getEnclosingCallable()) =
pragma[only_bind_out](succ.getNode().getEnclosingCallable())
}
private predicate localPathStep1(Flow1::PathNode pred, Flow1::PathNode succ) {
Flow1::PathGraph::edges(pred, succ) and
pragma[only_bind_out](pred.getNode().getEnclosingCallable()) =
pragma[only_bind_out](succ.getNode().getEnclosingCallable())
}
pragma[nomagic]
private predicate interprocEdge1(
Declaration predDecl, Declaration succDecl, DataFlow::PathNode pred1, DataFlow::PathNode succ1
) {
DataFlow::PathGraph::edges(pred1, succ1) and
predDecl != succDecl and
pred1.getNode().getEnclosingCallable() = predDecl and
succ1.getNode().getEnclosingCallable() = succDecl
}
private predicate localPathStep2(Flow2::PathNode pred, Flow2::PathNode succ) {
Flow2::PathGraph::edges(pred, succ) and
pragma[only_bind_out](pred.getNode().getEnclosingCallable()) =
pragma[only_bind_out](succ.getNode().getEnclosingCallable())
}
pragma[nomagic]
private predicate interprocEdge2(
Declaration predDecl, Declaration succDecl, DataFlow2::PathNode pred2, DataFlow2::PathNode succ2
) {
DataFlow2::PathGraph::edges(pred2, succ2) and
predDecl != succDecl and
pred2.getNode().getEnclosingCallable() = predDecl and
succ2.getNode().getEnclosingCallable() = succDecl
}
pragma[nomagic]
private predicate interprocEdge1(
Declaration predDecl, Declaration succDecl, Flow1::PathNode pred1, Flow1::PathNode succ1
) {
Flow1::PathGraph::edges(pred1, succ1) and
predDecl != succDecl and
pred1.getNode().getEnclosingCallable() = predDecl and
succ1.getNode().getEnclosingCallable() = succDecl
}
private predicate interprocEdgePair(
DataFlow::PathNode pred1, DataFlow2::PathNode pred2, DataFlow::PathNode succ1,
DataFlow2::PathNode succ2
) {
exists(Declaration predDecl, Declaration succDecl |
interprocEdge1(predDecl, succDecl, pred1, succ1) and
interprocEdge2(predDecl, succDecl, pred2, succ2)
)
}
pragma[nomagic]
private predicate interprocEdge2(
Declaration predDecl, Declaration succDecl, Flow2::PathNode pred2, Flow2::PathNode succ2
) {
Flow2::PathGraph::edges(pred2, succ2) and
predDecl != succDecl and
pred2.getNode().getEnclosingCallable() = predDecl and
succ2.getNode().getEnclosingCallable() = succDecl
}
private predicate reachable(
Configuration conf, DataFlow::PathNode source1, DataFlow2::PathNode source2,
DataFlow::PathNode sink1, DataFlow2::PathNode sink2
) {
exists(DataFlow::PathNode mid1, DataFlow2::PathNode mid2 |
reachableInterprocEntry(conf, source1, source2, mid1, mid2) and
conf.isSinkPair(sink1.getNode(), sink1.getState(), sink2.getNode(), sink2.getState()) and
localPathStep1*(mid1, sink1) and
localPathStep2*(mid2, sink2)
)
private predicate interprocEdgePair(
Flow1::PathNode pred1, Flow2::PathNode pred2, Flow1::PathNode succ1, Flow2::PathNode succ2
) {
exists(Declaration predDecl, Declaration succDecl |
interprocEdge1(predDecl, succDecl, pred1, succ1) and
interprocEdge2(predDecl, succDecl, pred2, succ2)
)
}
private predicate reachable(
Flow1::PathNode source1, Flow2::PathNode source2, Flow1::PathNode sink1, Flow2::PathNode sink2
) {
exists(Flow1::PathNode mid1, Flow2::PathNode mid2 |
reachableInterprocEntry(source1, source2, mid1, mid2) and
Config::isSinkPair(sink1.getNode(), sink1.getState(), sink2.getNode(), sink2.getState()) and
localPathStep1*(mid1, sink1) and
localPathStep2*(mid2, sink2)
)
}
}
}

View File

@@ -1,86 +1 @@
import cpp
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.ir.ValueNumbering
private newtype TBound =
TBoundZero() or
TBoundValueNumber(ValueNumber vn) {
exists(Instruction i |
vn.getAnInstruction() = i and
(
i.getResultIRType() instanceof IRIntegerType or
i.getResultIRType() instanceof IRAddressType
) and
not vn.getAnInstruction() instanceof ConstantInstruction
|
i instanceof PhiInstruction
or
i instanceof InitializeParameterInstruction
or
i instanceof CallInstruction
or
i instanceof VariableAddressInstruction
or
i instanceof FieldAddressInstruction
or
i.(LoadInstruction).getSourceAddress() instanceof VariableAddressInstruction
or
i.(LoadInstruction).getSourceAddress() instanceof FieldAddressInstruction
or
i.getAUse() instanceof ArgumentOperand
or
i instanceof PointerArithmeticInstruction
or
i.getAUse() instanceof AddressOperand
)
}
/**
* A bound that may be inferred for an expression plus/minus an integer delta.
*/
abstract class Bound extends TBound {
abstract string toString();
/** Gets an expression that equals this bound plus `delta`. */
abstract Instruction getInstruction(int delta);
/** Gets an expression that equals this bound. */
Instruction getInstruction() { result = getInstruction(0) }
abstract Location getLocation();
}
/**
* The bound that corresponds to the integer 0. This is used to represent all
* integer bounds as bounds are always accompanied by an added integer delta.
*/
class ZeroBound extends Bound, TBoundZero {
override string toString() { result = "0" }
override Instruction getInstruction(int delta) {
result.(ConstantValueInstruction).getValue().toInt() = delta
}
override Location getLocation() { result instanceof UnknownDefaultLocation }
}
/**
* A bound corresponding to the value of an `Instruction`.
*/
class ValueNumberBound extends Bound, TBoundValueNumber {
ValueNumber vn;
ValueNumberBound() { this = TBoundValueNumber(vn) }
/** Gets an `Instruction` that equals this bound. */
override Instruction getInstruction(int delta) {
this = TBoundValueNumber(valueNumber(result)) and delta = 0
}
override string toString() { result = "ValueNumberBound" }
override Location getLocation() { result = vn.getLocation() }
/** Gets the value number that equals this bound. */
ValueNumber getValueNumber() { result = vn }
}
import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.Bound

View File

@@ -3,3 +3,4 @@ import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
// Import each extension we want to enable
import extensions.SubtractSelf
import extensions.ConstantBitwiseAndExprRange
import extensions.StrlenLiteralRangeExpr

View File

@@ -0,0 +1,115 @@
/**
* This module implements subclasses for various DataFlow nodes that extends
* their `toString()` predicates with range information, if applicable. By
* including this module in a `path-problem` query, this range information
* will be displayed at each step in the query results.
*
* This is currently implemented for `DataFlow::ExprNode` and `DataFlow::DefinitionByReferenceNode`,
* but it is not yet implemented for `DataFlow::ParameterNode`.
*/
private import cpp
private import semmle.code.cpp.dataflow.DataFlow
private import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
string getExprBoundAsString(Expr e) {
if exists(lowerBound(e)) and exists(upperBound(e))
then result = "[" + lowerBound(e) + ", " + upperBound(e) + "]"
else result = "[unknown range]"
}
/**
* Holds for any integer type after resolving typedefs and stripping `const`
* specifiers, such as for `const size_t`
*/
predicate isIntegralType(Type t) {
// We use `getUnspecifiedType` here because without it things like
// `const size_t` aren't considered to be integral
t.getUnspecifiedType() instanceof IntegralType
}
/**
* Holds for any reference to an integer type after resolving typedefs and
* stripping `const` specifiers, such as for `const size_t&`
*/
predicate isIntegralReferenceType(Type t) { isIntegralType(t.(ReferenceType).stripType()) }
/**
* Holds for any pointer to an integer type after resolving typedefs and
* stripping `const` specifiers, such as for `const size_t*`. This predicate
* holds for any pointer depth, such as for `const size_t**`.
*/
predicate isIntegralPointerType(Type t) { isIntegralType(t.(PointerType).stripType()) }
predicate hasIntegralOrReferenceIntegralType(Locatable e) {
exists(Type t |
(
t = e.(Expr).getUnspecifiedType()
or
// This will cover variables, parameters, type declarations, etc.
t = e.(DeclarationEntry).getUnspecifiedType()
) and
(isIntegralType(t) or isIntegralReferenceType(t))
)
}
Expr getLOp(Operation o) {
result = o.(BinaryOperation).getLeftOperand() or
result = o.(Assignment).getLValue()
}
Expr getROp(Operation o) {
result = o.(BinaryOperation).getRightOperand() or
result = o.(Assignment).getRValue()
}
/**
* Display the ranges of expressions in the path view
*/
private class ExprRangeNode extends DataFlow::ExprNode {
pragma[inline]
private string getIntegralBounds(Expr arg) {
if hasIntegralOrReferenceIntegralType(arg)
then result = getExprBoundAsString(arg)
else result = ""
}
private string getOperationBounds(Operation e) {
result =
getExprBoundAsString(e) + " = " + getExprBoundAsString(getLOp(e)) + e.getOperator() +
getExprBoundAsString(getROp(e))
}
private string getCallBounds(Call e) {
result =
getExprBoundAsString(e) + "(" +
concat(Expr arg, int i | arg = e.getArgument(i) | getIntegralBounds(arg) order by i, ",") +
")"
}
override string toString() {
exists(Expr e | e = getExpr() |
if hasIntegralOrReferenceIntegralType(e)
then
result = super.toString() + ": " + getOperationBounds(e)
or
result = super.toString() + ": " + getCallBounds(e)
or
not exists(getOperationBounds(e)) and
not exists(getCallBounds(e)) and
result = super.toString() + ": " + getExprBoundAsString(e)
else result = super.toString()
)
}
}
/**
* Display the ranges of expressions in the path view
*/
private class ReferenceArgumentRangeNode extends DataFlow::DefinitionByReferenceNode {
override string toString() {
if hasIntegralOrReferenceIntegralType(asDefiningArgument())
then result = super.toString() + ": " + getExprBoundAsString(getArgument())
else result = super.toString()
}
}

View File

@@ -0,0 +1,18 @@
private import cpp
private import experimental.semmle.code.cpp.models.interfaces.SimpleRangeAnalysisExpr
/**
* Provides range analysis information for calls to `strlen` on literal strings.
* For example, the range of `strlen("literal")` will be 7.
*/
class StrlenLiteralRangeExpr extends SimpleRangeAnalysisExpr, FunctionCall {
StrlenLiteralRangeExpr() {
getTarget().hasGlobalOrStdName("strlen") and getArgument(0).isConstant()
}
override int getLowerBounds() { result = getArgument(0).getValue().length() }
override int getUpperBounds() { result = getArgument(0).getValue().length() }
override predicate dependsOnChild(Expr e) { none() }
}

View File

@@ -54,7 +54,7 @@ module PrivateCleartextWrite {
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
}
module WriteFlow = TaintTracking::Make<WriteConfig>;
module WriteFlow = TaintTracking::Global<WriteConfig>;
class PrivateDataSource extends Source {
PrivateDataSource() { this.getExpr() instanceof PrivateDataExpr }

View File

@@ -1,24 +0,0 @@
private import RangeAnalysisStage
private import RangeAnalysisSpecific
private import experimental.semmle.code.cpp.semantic.analysis.FloatDelta
private import RangeUtils
private import experimental.semmle.code.cpp.semantic.SemanticBound as SemanticBound
module Bounds implements BoundSig<FloatDelta> {
class SemBound instanceof SemanticBound::SemBound {
string toString() { result = super.toString() }
SemExpr getExpr(float delta) { result = super.getExpr(delta) }
}
class SemZeroBound extends SemBound instanceof SemanticBound::SemZeroBound { }
class SemSsaBound extends SemBound instanceof SemanticBound::SemSsaBound {
SemSsaVariable getAVariable() { result = this.(SemanticBound::SemSsaBound).getAVariable() }
}
}
private module CppRangeAnalysis =
RangeStage<FloatDelta, Bounds, CppLangImpl, RangeUtil<FloatDelta, CppLangImpl>>;
import CppRangeAnalysis

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-all
version: 0.6.0
version: 0.7.0
groups: cpp
dbscheme: semmlecode.cpp.dbscheme
extractor: cpp
@@ -8,3 +8,4 @@ upgrades: upgrades
dependencies:
codeql/ssa: ${workspace}
codeql/tutorial: ${workspace}
codeql/util: ${workspace}

View File

@@ -752,13 +752,13 @@ private predicate namedExprChildPredicates(Expr expr, Element ele, string pred)
expr.(VariableAccess).getQualifier() = ele and pred = "getQualifier()"
or
exists(Field f |
expr.(ClassAggregateLiteral).getFieldExpr(f) = ele and
pred = "getFieldExpr(" + f.toString() + ")"
expr.(ClassAggregateLiteral).getAFieldExpr(f) = ele and
pred = "getAFieldExpr(" + f.toString() + ")"
)
or
exists(int n |
expr.(ArrayOrVectorAggregateLiteral).getElementExpr(n) = ele and
pred = "getElementExpr(" + n.toString() + ")"
expr.(ArrayOrVectorAggregateLiteral).getAnElementExpr(n) = ele and
pred = "getAnElementExpr(" + n.toString() + ")"
)
or
expr.(AlignofExprOperator).getExprOperand() = ele and pred = "getExprOperand()"

View File

@@ -133,7 +133,7 @@ class Variable extends Declaration, @variable {
or
exists(AssignExpr ae | ae.getLValue().(Access).getTarget() = this and result = ae.getRValue())
or
exists(ClassAggregateLiteral l | result = l.getFieldExpr(this))
exists(ClassAggregateLiteral l | result = l.getAFieldExpr(this))
}
/**

View File

@@ -2,7 +2,7 @@
* Provides an implementation of global (interprocedural) data flow. This file
* re-exports the local (intraprocedural) data flow analysis from
* `DataFlowImplSpecific::Public` and adds a global analysis, mainly exposed
* through the `Make` and `MakeWithState` modules.
* through the `Global` and `GlobalWithState` modules.
*/
private import DataFlowImplCommon
@@ -73,10 +73,10 @@ signature module ConfigSig {
*/
default FlowFeature getAFeature() { none() }
/** Holds if sources should be grouped in the result of `hasFlowPath`. */
/** Holds if sources should be grouped in the result of `flowPath`. */
default predicate sourceGrouping(Node source, string sourceGroup) { none() }
/** Holds if sinks should be grouped in the result of `hasFlowPath`. */
/** Holds if sinks should be grouped in the result of `flowPath`. */
default predicate sinkGrouping(Node sink, string sinkGroup) { none() }
/**
@@ -166,10 +166,10 @@ signature module StateConfigSig {
*/
default FlowFeature getAFeature() { none() }
/** Holds if sources should be grouped in the result of `hasFlowPath`. */
/** Holds if sources should be grouped in the result of `flowPath`. */
default predicate sourceGrouping(Node source, string sourceGroup) { none() }
/** Holds if sinks should be grouped in the result of `hasFlowPath`. */
/** Holds if sinks should be grouped in the result of `flowPath`. */
default predicate sinkGrouping(Node sink, string sinkGroup) { none() }
/**
@@ -182,15 +182,15 @@ signature module StateConfigSig {
}
/**
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
* Gets the exploration limit for `partialFlow` and `partialFlowRev`
* measured in approximate number of interprocedural steps.
*/
signature int explorationLimitSig();
/**
* The output of a data flow computation.
* The output of a global data flow computation.
*/
signature module DataFlowSig {
signature module GlobalFlowSig {
/**
* A `Node` augmented with a call context (except for sinks) and an access path.
* Only those `PathNode`s that are reachable from a source, and which can reach a sink, are generated.
@@ -203,28 +203,28 @@ signature module DataFlowSig {
* The corresponding paths are generated from the end-points and the graph
* included in the module `PathGraph`.
*/
predicate hasFlowPath(PathNode source, PathNode sink);
predicate flowPath(PathNode source, PathNode sink);
/**
* Holds if data can flow from `source` to `sink`.
*/
predicate hasFlow(Node source, Node sink);
predicate flow(Node source, Node sink);
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowTo(Node sink);
predicate flowTo(Node sink);
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowToExpr(DataFlowExpr sink);
predicate flowToExpr(DataFlowExpr sink);
}
/**
* Constructs a standard data flow computation.
* Constructs a global data flow computation.
*/
module Make<ConfigSig Config> implements DataFlowSig {
module Global<ConfigSig Config> implements GlobalFlowSig {
private module C implements FullStateConfigSig {
import DefaultState<Config>
import Config
@@ -233,10 +233,15 @@ module Make<ConfigSig Config> implements DataFlowSig {
import Impl<C>
}
/** DEPRECATED: Use `Global` instead. */
deprecated module Make<ConfigSig Config> implements GlobalFlowSig {
import Global<Config>
}
/**
* Constructs a data flow computation using flow state.
* Constructs a global data flow computation using flow state.
*/
module MakeWithState<StateConfigSig Config> implements DataFlowSig {
module GlobalWithState<StateConfigSig Config> implements GlobalFlowSig {
private module C implements FullStateConfigSig {
import Config
}
@@ -244,6 +249,11 @@ module MakeWithState<StateConfigSig Config> implements DataFlowSig {
import Impl<C>
}
/** DEPRECATED: Use `GlobalWithState` instead. */
deprecated module MakeWithState<StateConfigSig Config> implements GlobalFlowSig {
import GlobalWithState<Config>
}
signature class PathNodeSig {
/** Gets a textual representation of this element. */
string toString();

View File

@@ -79,3 +79,13 @@ class ArgumentPosition extends int {
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
pragma[inline]
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
/**
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
*
* This is a temporary hook to support technical debt in the Go language; do not use.
*/
pragma[inline]
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
any()
}

View File

@@ -8,6 +8,7 @@ private import DataFlowImplCommon
private import DataFlowImplSpecific::Private
private import DataFlowImplSpecific::Public
private import DataFlowImplCommonPublic
private import codeql.util.Unit
import DataFlow
/**
@@ -91,10 +92,10 @@ signature module FullStateConfigSig {
*/
FlowFeature getAFeature();
/** Holds if sources should be grouped in the result of `hasFlowPath`. */
/** Holds if sources should be grouped in the result of `flowPath`. */
predicate sourceGrouping(Node source, string sourceGroup);
/** Holds if sinks should be grouped in the result of `hasFlowPath`. */
/** Holds if sinks should be grouped in the result of `flowPath`. */
predicate sinkGrouping(Node sink, string sinkGroup);
/**
@@ -418,6 +419,10 @@ module Impl<FullStateConfigSig Config> {
)
}
private predicate sourceCallCtx(CallContext cc) {
if hasSourceCallCtx() then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
}
private predicate hasSinkCallCtx() {
exists(FlowFeature feature | feature = Config::getAFeature() |
feature instanceof FeatureHasSinkCallContext or
@@ -441,11 +446,7 @@ module Impl<FullStateConfigSig Config> {
}
private module Stage1 implements StageSig {
class Ap extends int {
// workaround for bad functionality-induced joins (happens when using `Unit`)
pragma[nomagic]
Ap() { this in [0 .. 1] and this < 1 }
}
class Ap = Unit;
private class Cc = boolean;
@@ -1141,19 +1142,13 @@ module Impl<FullStateConfigSig Config> {
import Param
/* Begin: Stage logic. */
// use an alias as a workaround for bad functionality-induced joins
pragma[nomagic]
private predicate revFlowApAlias(NodeEx node, ApApprox apa) {
PrevStage::revFlowAp(node, apa)
}
pragma[nomagic]
private predicate flowIntoCallApa(
DataFlowCall call, ArgNodeEx arg, ParamNodeEx p, boolean allowsFieldFlow, ApApprox apa
) {
flowIntoCall(call, arg, p, allowsFieldFlow) and
PrevStage::revFlowAp(p, pragma[only_bind_into](apa)) and
revFlowApAlias(arg, pragma[only_bind_into](apa))
PrevStage::revFlowAp(arg, pragma[only_bind_into](apa))
}
pragma[nomagic]
@@ -1163,7 +1158,7 @@ module Impl<FullStateConfigSig Config> {
) {
flowOutOfCall(call, ret, kind, out, allowsFieldFlow) and
PrevStage::revFlowAp(out, pragma[only_bind_into](apa)) and
revFlowApAlias(ret, pragma[only_bind_into](apa))
PrevStage::revFlowAp(ret, pragma[only_bind_into](apa))
}
pragma[nomagic]
@@ -1691,16 +1686,6 @@ module Impl<FullStateConfigSig Config> {
pragma[nomagic]
predicate revFlowAp(NodeEx node, Ap ap) { revFlow(node, _, _, _, ap) }
// use an alias as a workaround for bad functionality-induced joins
pragma[nomagic]
additional predicate revFlowAlias(NodeEx node) { revFlow(node, _, _, _, _) }
// use an alias as a workaround for bad functionality-induced joins
pragma[nomagic]
additional predicate revFlowAlias(NodeEx node, FlowState state, Ap ap) {
revFlow(node, state, ap)
}
private predicate fwdConsCand(TypedContent tc, Ap ap) { storeStepFwd(_, ap, tc, _, _) }
private predicate revConsCand(TypedContent tc, Ap ap) { storeStepCand(_, ap, tc, _, _) }
@@ -1974,7 +1959,7 @@ module Impl<FullStateConfigSig Config> {
) {
flowOutOfCallNodeCand1(call, node1, kind, node2, allowsFieldFlow) and
Stage2::revFlow(node2) and
Stage2::revFlowAlias(node1)
Stage2::revFlow(node1)
}
pragma[nomagic]
@@ -1983,7 +1968,7 @@ module Impl<FullStateConfigSig Config> {
) {
flowIntoCallNodeCand1(call, node1, node2, allowsFieldFlow) and
Stage2::revFlow(node2) and
Stage2::revFlowAlias(node1)
Stage2::revFlow(node1)
}
private module LocalFlowBigStep {
@@ -2065,11 +2050,11 @@ module Impl<FullStateConfigSig Config> {
additionalLocalFlowStepNodeCand1(node1, node2) and
state1 = state2 and
Stage2::revFlow(node1, pragma[only_bind_into](state1), false) and
Stage2::revFlowAlias(node2, pragma[only_bind_into](state2), false)
Stage2::revFlow(node2, pragma[only_bind_into](state2), false)
or
additionalLocalStateStep(node1, state1, node2, state2) and
Stage2::revFlow(node1, state1, false) and
Stage2::revFlowAlias(node2, state2, false)
Stage2::revFlow(node2, state2, false)
}
/**
@@ -2262,7 +2247,7 @@ module Impl<FullStateConfigSig Config> {
) {
localFlowBigStep(node1, state1, node2, state2, preservesValue, ap.getType(), _) and
PrevStage::revFlow(node1, pragma[only_bind_into](state1), _) and
PrevStage::revFlowAlias(node2, pragma[only_bind_into](state2), _) and
PrevStage::revFlow(node2, pragma[only_bind_into](state2), _) and
exists(lcc)
}
@@ -2273,7 +2258,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowOutOfCallNodeCand2(call, node1, kind, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2284,7 +2269,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowIntoCallNodeCand2(call, node1, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2586,7 +2571,7 @@ module Impl<FullStateConfigSig Config> {
) {
localFlowBigStep(node1, state1, node2, state2, preservesValue, ap.getType(), lcc) and
PrevStage::revFlow(node1, pragma[only_bind_into](state1), _) and
PrevStage::revFlowAlias(node2, pragma[only_bind_into](state2), _)
PrevStage::revFlow(node2, pragma[only_bind_into](state2), _)
}
pragma[nomagic]
@@ -2596,7 +2581,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowOutOfCallNodeCand2(call, node1, kind, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2607,7 +2592,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowIntoCallNodeCand2(call, node1, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2804,11 +2789,7 @@ module Impl<FullStateConfigSig Config> {
// A PathNode is introduced by a source ...
Stage5::revFlow(node, state) and
sourceNode(node, state) and
(
if hasSourceCallCtx()
then cc instanceof CallContextSomeCall
else cc instanceof CallContextAny
) and
sourceCallCtx(cc) and
sc instanceof SummaryCtxNone and
ap = TAccessPathNil(node.getDataFlowType())
or
@@ -3214,11 +3195,7 @@ module Impl<FullStateConfigSig Config> {
override predicate isSource() {
sourceNode(node, state) and
(
if hasSourceCallCtx()
then cc instanceof CallContextSomeCall
else cc instanceof CallContextAny
) and
sourceCallCtx(cc) and
sc instanceof SummaryCtxNone and
ap = TAccessPathNil(node.getDataFlowType())
}
@@ -3653,7 +3630,7 @@ module Impl<FullStateConfigSig Config> {
* The corresponding paths are generated from the end-points and the graph
* included in the module `PathGraph`.
*/
predicate hasFlowPath(PathNode source, PathNode sink) {
predicate flowPath(PathNode source, PathNode sink) {
exists(PathNodeImpl flowsource, PathNodeImpl flowsink |
source = flowsource and sink = flowsink
|
@@ -3663,6 +3640,9 @@ module Impl<FullStateConfigSig Config> {
)
}
/** DEPRECATED: Use `flowPath` instead. */
deprecated predicate hasFlowPath = flowPath/2;
private predicate flowsTo(PathNodeImpl flowsource, PathNodeSink flowsink, Node source, Node sink) {
flowsource.isSource() and
flowsource.getNodeEx().asNode() = source and
@@ -3673,17 +3653,26 @@ module Impl<FullStateConfigSig Config> {
/**
* Holds if data can flow from `source` to `sink`.
*/
predicate hasFlow(Node source, Node sink) { flowsTo(_, _, source, sink) }
predicate flow(Node source, Node sink) { flowsTo(_, _, source, sink) }
/** DEPRECATED: Use `flow` instead. */
deprecated predicate hasFlow = flow/2;
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowTo(Node sink) { sink = any(PathNodeSink n).getNodeEx().asNode() }
predicate flowTo(Node sink) { sink = any(PathNodeSink n).getNodeEx().asNode() }
/** DEPRECATED: Use `flowTo` instead. */
deprecated predicate hasFlowTo = flowTo/1;
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
predicate flowToExpr(DataFlowExpr sink) { flowTo(exprNode(sink)) }
/** DEPRECATED: Use `flowToExpr` instead. */
deprecated predicate hasFlowToExpr = flowToExpr/1;
private predicate finalStats(
boolean fwd, int nodes, int fields, int conscand, int states, int tuples
@@ -4594,7 +4583,7 @@ module Impl<FullStateConfigSig Config> {
*
* To use this in a `path-problem` query, import the module `PartialPathGraph`.
*/
predicate hasPartialFlow(PartialPathNode source, PartialPathNode node, int dist) {
predicate partialFlow(PartialPathNode source, PartialPathNode node, int dist) {
partialFlow(source, node) and
dist = node.getSourceDistance()
}
@@ -4614,7 +4603,7 @@ module Impl<FullStateConfigSig Config> {
* Note that reverse flow has slightly lower precision than the corresponding
* forward flow, as reverse flow disregards type pruning among other features.
*/
predicate hasPartialFlowRev(PartialPathNode node, PartialPathNode sink, int dist) {
predicate partialFlowRev(PartialPathNode node, PartialPathNode sink, int dist) {
revPartialFlow(node, sink) and
dist = node.getSinkDistance()
}

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -140,10 +140,8 @@ private module LambdaFlow {
}
pragma[nomagic]
private TReturnPositionSimple viableReturnPosLambda(
DataFlowCall call, DataFlowCallOption lastCall, ReturnKind kind
) {
result = TReturnPositionSimple0(viableCallableLambda(call, lastCall), kind)
private TReturnPositionSimple viableReturnPosLambda(DataFlowCall call, ReturnKind kind) {
result = TReturnPositionSimple0(viableCallableLambda(call, _), kind)
}
private predicate viableReturnPosOutNonLambda(
@@ -155,11 +153,12 @@ private module LambdaFlow {
)
}
pragma[nomagic]
private predicate viableReturnPosOutLambda(
DataFlowCall call, DataFlowCallOption lastCall, TReturnPositionSimple pos, OutNode out
DataFlowCall call, TReturnPositionSimple pos, OutNode out
) {
exists(ReturnKind kind |
pos = viableReturnPosLambda(call, lastCall, kind) and
pos = viableReturnPosLambda(call, kind) and
out = getAnOutNode(call, kind)
)
}
@@ -188,6 +187,7 @@ private module LambdaFlow {
else any()
}
pragma[assume_small_delta]
pragma[nomagic]
predicate revLambdaFlow0(
DataFlowCall lambdaCall, LambdaCallKind kind, Node node, DataFlowType t, boolean toReturn,
@@ -274,6 +274,7 @@ private module LambdaFlow {
)
}
pragma[assume_small_delta]
pragma[nomagic]
predicate revLambdaFlowOut(
DataFlowCall lambdaCall, LambdaCallKind kind, TReturnPositionSimple pos, DataFlowType t,
@@ -285,7 +286,7 @@ private module LambdaFlow {
or
// non-linear recursion
revLambdaFlowOutLambdaCall(lambdaCall, kind, out, t, toJump, call, lastCall) and
viableReturnPosOutLambda(call, _, pos, out)
viableReturnPosOutLambda(call, pos, out)
)
}
@@ -424,7 +425,8 @@ private module Cached {
exists(ParameterPosition ppos |
viableParam(call, ppos, p) and
argumentPositionMatch(call, arg, ppos) and
compatibleTypes(getNodeDataFlowType(arg), getNodeDataFlowType(p))
compatibleTypes(getNodeDataFlowType(arg), getNodeDataFlowType(p)) and
golangSpecificParamArgFilter(call, p, arg)
)
}

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -3,6 +3,7 @@ private import DataFlowUtil
private import DataFlowDispatch
private import FlowVar
private import DataFlowImplConsistency
private import codeql.util.Unit
/** Gets the callable in which this node occurs. */
DataFlowCallable nodeGetEnclosingCallable(Node n) { result = n.getEnclosingCallable() }
@@ -158,7 +159,7 @@ predicate storeStep(Node node1, Content f, PostUpdateNode node2) {
// `PostUpdateNode`, which means it must be an `ObjectInitializerNode`.
node2.asExpr() = aggr and
f.(FieldContent).getField() = field and
aggr.getFieldExpr(field) = node1.asExpr()
aggr.getAFieldExpr(field) = node1.asExpr()
)
or
exists(FieldAccess fa |
@@ -264,15 +265,6 @@ int accessPathLimit() { result = 5 }
*/
predicate forceHighPrecision(Content c) { none() }
/** The unit type. */
private newtype TUnit = TMkUnit()
/** The trivial type with a single element. */
class Unit extends TUnit {
/** Gets a textual representation of this element. */
string toString() { result = "unit" }
}
/** Holds if `n` should be hidden from path explanations. */
predicate nodeIsHidden(Node n) { none() }

View File

@@ -33,9 +33,9 @@ private module AddTaintDefaults<DataFlowInternal::FullStateConfigSig Config> imp
}
/**
* Constructs a standard taint tracking computation.
* Constructs a global taint tracking computation.
*/
module Make<DataFlow::ConfigSig Config> implements DataFlow::DataFlowSig {
module Global<DataFlow::ConfigSig Config> implements DataFlow::GlobalFlowSig {
private module Config0 implements DataFlowInternal::FullStateConfigSig {
import DataFlowInternal::DefaultState<Config>
import Config
@@ -48,10 +48,15 @@ module Make<DataFlow::ConfigSig Config> implements DataFlow::DataFlowSig {
import DataFlowInternal::Impl<C>
}
/** DEPRECATED: Use `Global` instead. */
deprecated module Make<DataFlow::ConfigSig Config> implements DataFlow::GlobalFlowSig {
import Global<Config>
}
/**
* Constructs a taint tracking computation using flow state.
* Constructs a global taint tracking computation using flow state.
*/
module MakeWithState<DataFlow::StateConfigSig Config> implements DataFlow::DataFlowSig {
module GlobalWithState<DataFlow::StateConfigSig Config> implements DataFlow::GlobalFlowSig {
private module Config0 implements DataFlowInternal::FullStateConfigSig {
import Config
}
@@ -62,3 +67,8 @@ module MakeWithState<DataFlow::StateConfigSig Config> implements DataFlow::DataF
import DataFlowInternal::Impl<C>
}
/** DEPRECATED: Use `GlobalWithState` instead. */
deprecated module MakeWithState<DataFlow::StateConfigSig Config> implements DataFlow::GlobalFlowSig {
import GlobalWithState<Config>
}

View File

@@ -147,7 +147,7 @@ class LambdaCapture extends Locatable, @lambdacapture {
*/
Expr getInitializer() {
exists(LambdaExpression lambda | this = lambda.getCapture(_) |
result = lambda.getInitializer().getFieldExpr(this.getField())
result = lambda.getInitializer().getAFieldExpr(this.getField())
)
}
}

View File

@@ -187,12 +187,44 @@ class ClassAggregateLiteral extends AggregateLiteral {
override string getAPrimaryQlClass() { result = "ClassAggregateLiteral" }
/**
* Gets an expression within the aggregate literal that is used to initialize
* field `field`, if present.
*
* This predicate may have multiple results since a field can be initialized
* multiple times in the same initializer.
*/
Expr getAFieldExpr(Field field) { result = this.getFieldExpr(field, _) }
/**
* DEPRECATED: Use `getAFieldExpr` instead.
*
* Gets the expression within the aggregate literal that is used to initialize
* field `field`, if present.
*
* This predicate may have multiple results since a field can be initialized
* multiple times in the same initializer.
*/
Expr getFieldExpr(Field field) {
deprecated Expr getFieldExpr(Field field) { result = this.getFieldExpr(field, _) }
/**
* Gets the expression within the aggregate literal that is used to initialize
* field `field`, if present. The expression is the `position`'th entry in the
* aggregate literal.
*
* For example, if `aggr` represents the initialization literal `{.x = 123, .y = 456 .x = 789}` in
* ```cpp
* struct Foo { int x; int y; };
* struct Foo foo = {.x = 123, .y = 456 .x = 789};
* ```
* then:
* - `aggr.getFieldExpr(x, 0)` gives `123`.
* - `aggr.getFieldExpr(y, 1)` gives `456`.
* - `aggr.getFieldExpr(x, 2)` gives `789`.
*/
Expr getFieldExpr(Field field, int position) {
field = classType.getAField() and
aggregate_field_init(underlyingElement(this), unresolveElement(result), unresolveElement(field))
aggregate_field_init(underlyingElement(this), unresolveElement(result), unresolveElement(field),
position)
}
/**
@@ -206,7 +238,7 @@ class ClassAggregateLiteral extends AggregateLiteral {
(
// If the field has an explicit initializer expression, then the field is
// initialized.
exists(this.getFieldExpr(field))
exists(this.getAFieldExpr(field))
or
// If the type is not a union, all fields without initializers are value
// initialized.
@@ -230,7 +262,7 @@ class ClassAggregateLiteral extends AggregateLiteral {
pragma[inline]
predicate isValueInitialized(Field field) {
this.isInitialized(field) and
not exists(this.getFieldExpr(field))
not exists(this.getAFieldExpr(field))
}
}
@@ -260,11 +292,41 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral {
Type getElementType() { none() }
/**
* Gets an expression within the aggregate literal that is used to initialize
* element `elementIndex`, if present.
*
* This predicate may have multiple results since an element can be initialized
* multiple times in the same initializer.
*/
Expr getAnElementExpr(int elementIndex) { result = this.getElementExpr(elementIndex, _) }
/**
* DEPRECATED: Use `getAnElementExpr` instead.
*
* Gets the expression within the aggregate literal that is used to initialize
* element `elementIndex`, if present.
*
* This predicate may have multiple results since an element can be initialized
* multiple times in the same initializer.
*/
Expr getElementExpr(int elementIndex) {
aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex)
deprecated Expr getElementExpr(int elementIndex) { result = this.getElementExpr(elementIndex, _) }
/**
* Gets the expression within the aggregate literal that is used to initialize
* element `elementIndex`, if present. The expression is the `position`'th entry
* in the aggregate literal.
*
* For example, if `a` represents the initialization literal `{[0] = 123, [1] = 456, [0] = 789 }` in
* ```cpp
* int x[2] = {[0] = 123, [1] = 456, [0] = 789 };
* ```
* then:
* - `a.getElementExpr(0, 0)` gives `123`.
* - `a.getElementExpr(1, 1)` gives `456`.
* - `a.getElementExpr(0, 2)` gives `789`.
*/
Expr getElementExpr(int elementIndex, int position) {
aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex, position)
}
/**
@@ -289,7 +351,7 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral {
bindingset[elementIndex]
predicate isValueInitialized(int elementIndex) {
this.isInitialized(elementIndex) and
not exists(this.getElementExpr(elementIndex))
not exists(this.getAnElementExpr(elementIndex))
}
}

View File

@@ -2,7 +2,7 @@
* Provides an implementation of global (interprocedural) data flow. This file
* re-exports the local (intraprocedural) data flow analysis from
* `DataFlowImplSpecific::Public` and adds a global analysis, mainly exposed
* through the `Make` and `MakeWithState` modules.
* through the `Global` and `GlobalWithState` modules.
*/
private import DataFlowImplCommon
@@ -73,10 +73,10 @@ signature module ConfigSig {
*/
default FlowFeature getAFeature() { none() }
/** Holds if sources should be grouped in the result of `hasFlowPath`. */
/** Holds if sources should be grouped in the result of `flowPath`. */
default predicate sourceGrouping(Node source, string sourceGroup) { none() }
/** Holds if sinks should be grouped in the result of `hasFlowPath`. */
/** Holds if sinks should be grouped in the result of `flowPath`. */
default predicate sinkGrouping(Node sink, string sinkGroup) { none() }
/**
@@ -166,10 +166,10 @@ signature module StateConfigSig {
*/
default FlowFeature getAFeature() { none() }
/** Holds if sources should be grouped in the result of `hasFlowPath`. */
/** Holds if sources should be grouped in the result of `flowPath`. */
default predicate sourceGrouping(Node source, string sourceGroup) { none() }
/** Holds if sinks should be grouped in the result of `hasFlowPath`. */
/** Holds if sinks should be grouped in the result of `flowPath`. */
default predicate sinkGrouping(Node sink, string sinkGroup) { none() }
/**
@@ -182,15 +182,15 @@ signature module StateConfigSig {
}
/**
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
* Gets the exploration limit for `partialFlow` and `partialFlowRev`
* measured in approximate number of interprocedural steps.
*/
signature int explorationLimitSig();
/**
* The output of a data flow computation.
* The output of a global data flow computation.
*/
signature module DataFlowSig {
signature module GlobalFlowSig {
/**
* A `Node` augmented with a call context (except for sinks) and an access path.
* Only those `PathNode`s that are reachable from a source, and which can reach a sink, are generated.
@@ -203,28 +203,28 @@ signature module DataFlowSig {
* The corresponding paths are generated from the end-points and the graph
* included in the module `PathGraph`.
*/
predicate hasFlowPath(PathNode source, PathNode sink);
predicate flowPath(PathNode source, PathNode sink);
/**
* Holds if data can flow from `source` to `sink`.
*/
predicate hasFlow(Node source, Node sink);
predicate flow(Node source, Node sink);
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowTo(Node sink);
predicate flowTo(Node sink);
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowToExpr(DataFlowExpr sink);
predicate flowToExpr(DataFlowExpr sink);
}
/**
* Constructs a standard data flow computation.
* Constructs a global data flow computation.
*/
module Make<ConfigSig Config> implements DataFlowSig {
module Global<ConfigSig Config> implements GlobalFlowSig {
private module C implements FullStateConfigSig {
import DefaultState<Config>
import Config
@@ -233,10 +233,15 @@ module Make<ConfigSig Config> implements DataFlowSig {
import Impl<C>
}
/** DEPRECATED: Use `Global` instead. */
deprecated module Make<ConfigSig Config> implements GlobalFlowSig {
import Global<Config>
}
/**
* Constructs a data flow computation using flow state.
* Constructs a global data flow computation using flow state.
*/
module MakeWithState<StateConfigSig Config> implements DataFlowSig {
module GlobalWithState<StateConfigSig Config> implements GlobalFlowSig {
private module C implements FullStateConfigSig {
import Config
}
@@ -244,6 +249,11 @@ module MakeWithState<StateConfigSig Config> implements DataFlowSig {
import Impl<C>
}
/** DEPRECATED: Use `GlobalWithState` instead. */
deprecated module MakeWithState<StateConfigSig Config> implements GlobalFlowSig {
import GlobalWithState<Config>
}
signature class PathNodeSig {
/** Gets a textual representation of this element. */
string toString();

View File

@@ -271,3 +271,13 @@ Function viableImplInCallContext(CallInstruction call, CallInstruction ctx) {
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
pragma[inline]
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
/**
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
*
* This is a temporary hook to support technical debt in the Go language; do not use.
*/
pragma[inline]
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
any()
}

View File

@@ -8,6 +8,7 @@ private import DataFlowImplCommon
private import DataFlowImplSpecific::Private
private import DataFlowImplSpecific::Public
private import DataFlowImplCommonPublic
private import codeql.util.Unit
import DataFlow
/**
@@ -91,10 +92,10 @@ signature module FullStateConfigSig {
*/
FlowFeature getAFeature();
/** Holds if sources should be grouped in the result of `hasFlowPath`. */
/** Holds if sources should be grouped in the result of `flowPath`. */
predicate sourceGrouping(Node source, string sourceGroup);
/** Holds if sinks should be grouped in the result of `hasFlowPath`. */
/** Holds if sinks should be grouped in the result of `flowPath`. */
predicate sinkGrouping(Node sink, string sinkGroup);
/**
@@ -418,6 +419,10 @@ module Impl<FullStateConfigSig Config> {
)
}
private predicate sourceCallCtx(CallContext cc) {
if hasSourceCallCtx() then cc instanceof CallContextSomeCall else cc instanceof CallContextAny
}
private predicate hasSinkCallCtx() {
exists(FlowFeature feature | feature = Config::getAFeature() |
feature instanceof FeatureHasSinkCallContext or
@@ -441,11 +446,7 @@ module Impl<FullStateConfigSig Config> {
}
private module Stage1 implements StageSig {
class Ap extends int {
// workaround for bad functionality-induced joins (happens when using `Unit`)
pragma[nomagic]
Ap() { this in [0 .. 1] and this < 1 }
}
class Ap = Unit;
private class Cc = boolean;
@@ -1141,19 +1142,13 @@ module Impl<FullStateConfigSig Config> {
import Param
/* Begin: Stage logic. */
// use an alias as a workaround for bad functionality-induced joins
pragma[nomagic]
private predicate revFlowApAlias(NodeEx node, ApApprox apa) {
PrevStage::revFlowAp(node, apa)
}
pragma[nomagic]
private predicate flowIntoCallApa(
DataFlowCall call, ArgNodeEx arg, ParamNodeEx p, boolean allowsFieldFlow, ApApprox apa
) {
flowIntoCall(call, arg, p, allowsFieldFlow) and
PrevStage::revFlowAp(p, pragma[only_bind_into](apa)) and
revFlowApAlias(arg, pragma[only_bind_into](apa))
PrevStage::revFlowAp(arg, pragma[only_bind_into](apa))
}
pragma[nomagic]
@@ -1163,7 +1158,7 @@ module Impl<FullStateConfigSig Config> {
) {
flowOutOfCall(call, ret, kind, out, allowsFieldFlow) and
PrevStage::revFlowAp(out, pragma[only_bind_into](apa)) and
revFlowApAlias(ret, pragma[only_bind_into](apa))
PrevStage::revFlowAp(ret, pragma[only_bind_into](apa))
}
pragma[nomagic]
@@ -1691,16 +1686,6 @@ module Impl<FullStateConfigSig Config> {
pragma[nomagic]
predicate revFlowAp(NodeEx node, Ap ap) { revFlow(node, _, _, _, ap) }
// use an alias as a workaround for bad functionality-induced joins
pragma[nomagic]
additional predicate revFlowAlias(NodeEx node) { revFlow(node, _, _, _, _) }
// use an alias as a workaround for bad functionality-induced joins
pragma[nomagic]
additional predicate revFlowAlias(NodeEx node, FlowState state, Ap ap) {
revFlow(node, state, ap)
}
private predicate fwdConsCand(TypedContent tc, Ap ap) { storeStepFwd(_, ap, tc, _, _) }
private predicate revConsCand(TypedContent tc, Ap ap) { storeStepCand(_, ap, tc, _, _) }
@@ -1974,7 +1959,7 @@ module Impl<FullStateConfigSig Config> {
) {
flowOutOfCallNodeCand1(call, node1, kind, node2, allowsFieldFlow) and
Stage2::revFlow(node2) and
Stage2::revFlowAlias(node1)
Stage2::revFlow(node1)
}
pragma[nomagic]
@@ -1983,7 +1968,7 @@ module Impl<FullStateConfigSig Config> {
) {
flowIntoCallNodeCand1(call, node1, node2, allowsFieldFlow) and
Stage2::revFlow(node2) and
Stage2::revFlowAlias(node1)
Stage2::revFlow(node1)
}
private module LocalFlowBigStep {
@@ -2065,11 +2050,11 @@ module Impl<FullStateConfigSig Config> {
additionalLocalFlowStepNodeCand1(node1, node2) and
state1 = state2 and
Stage2::revFlow(node1, pragma[only_bind_into](state1), false) and
Stage2::revFlowAlias(node2, pragma[only_bind_into](state2), false)
Stage2::revFlow(node2, pragma[only_bind_into](state2), false)
or
additionalLocalStateStep(node1, state1, node2, state2) and
Stage2::revFlow(node1, state1, false) and
Stage2::revFlowAlias(node2, state2, false)
Stage2::revFlow(node2, state2, false)
}
/**
@@ -2262,7 +2247,7 @@ module Impl<FullStateConfigSig Config> {
) {
localFlowBigStep(node1, state1, node2, state2, preservesValue, ap.getType(), _) and
PrevStage::revFlow(node1, pragma[only_bind_into](state1), _) and
PrevStage::revFlowAlias(node2, pragma[only_bind_into](state2), _) and
PrevStage::revFlow(node2, pragma[only_bind_into](state2), _) and
exists(lcc)
}
@@ -2273,7 +2258,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowOutOfCallNodeCand2(call, node1, kind, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2284,7 +2269,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowIntoCallNodeCand2(call, node1, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2586,7 +2571,7 @@ module Impl<FullStateConfigSig Config> {
) {
localFlowBigStep(node1, state1, node2, state2, preservesValue, ap.getType(), lcc) and
PrevStage::revFlow(node1, pragma[only_bind_into](state1), _) and
PrevStage::revFlowAlias(node2, pragma[only_bind_into](state2), _)
PrevStage::revFlow(node2, pragma[only_bind_into](state2), _)
}
pragma[nomagic]
@@ -2596,7 +2581,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowOutOfCallNodeCand2(call, node1, kind, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2607,7 +2592,7 @@ module Impl<FullStateConfigSig Config> {
exists(FlowState state |
flowIntoCallNodeCand2(call, node1, node2, allowsFieldFlow) and
PrevStage::revFlow(node2, pragma[only_bind_into](state), _) and
PrevStage::revFlowAlias(node1, pragma[only_bind_into](state), _)
PrevStage::revFlow(node1, pragma[only_bind_into](state), _)
)
}
@@ -2804,11 +2789,7 @@ module Impl<FullStateConfigSig Config> {
// A PathNode is introduced by a source ...
Stage5::revFlow(node, state) and
sourceNode(node, state) and
(
if hasSourceCallCtx()
then cc instanceof CallContextSomeCall
else cc instanceof CallContextAny
) and
sourceCallCtx(cc) and
sc instanceof SummaryCtxNone and
ap = TAccessPathNil(node.getDataFlowType())
or
@@ -3214,11 +3195,7 @@ module Impl<FullStateConfigSig Config> {
override predicate isSource() {
sourceNode(node, state) and
(
if hasSourceCallCtx()
then cc instanceof CallContextSomeCall
else cc instanceof CallContextAny
) and
sourceCallCtx(cc) and
sc instanceof SummaryCtxNone and
ap = TAccessPathNil(node.getDataFlowType())
}
@@ -3653,7 +3630,7 @@ module Impl<FullStateConfigSig Config> {
* The corresponding paths are generated from the end-points and the graph
* included in the module `PathGraph`.
*/
predicate hasFlowPath(PathNode source, PathNode sink) {
predicate flowPath(PathNode source, PathNode sink) {
exists(PathNodeImpl flowsource, PathNodeImpl flowsink |
source = flowsource and sink = flowsink
|
@@ -3663,6 +3640,9 @@ module Impl<FullStateConfigSig Config> {
)
}
/** DEPRECATED: Use `flowPath` instead. */
deprecated predicate hasFlowPath = flowPath/2;
private predicate flowsTo(PathNodeImpl flowsource, PathNodeSink flowsink, Node source, Node sink) {
flowsource.isSource() and
flowsource.getNodeEx().asNode() = source and
@@ -3673,17 +3653,26 @@ module Impl<FullStateConfigSig Config> {
/**
* Holds if data can flow from `source` to `sink`.
*/
predicate hasFlow(Node source, Node sink) { flowsTo(_, _, source, sink) }
predicate flow(Node source, Node sink) { flowsTo(_, _, source, sink) }
/** DEPRECATED: Use `flow` instead. */
deprecated predicate hasFlow = flow/2;
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowTo(Node sink) { sink = any(PathNodeSink n).getNodeEx().asNode() }
predicate flowTo(Node sink) { sink = any(PathNodeSink n).getNodeEx().asNode() }
/** DEPRECATED: Use `flowTo` instead. */
deprecated predicate hasFlowTo = flowTo/1;
/**
* Holds if data can flow from some source to `sink`.
*/
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
predicate flowToExpr(DataFlowExpr sink) { flowTo(exprNode(sink)) }
/** DEPRECATED: Use `flowToExpr` instead. */
deprecated predicate hasFlowToExpr = flowToExpr/1;
private predicate finalStats(
boolean fwd, int nodes, int fields, int conscand, int states, int tuples
@@ -4594,7 +4583,7 @@ module Impl<FullStateConfigSig Config> {
*
* To use this in a `path-problem` query, import the module `PartialPathGraph`.
*/
predicate hasPartialFlow(PartialPathNode source, PartialPathNode node, int dist) {
predicate partialFlow(PartialPathNode source, PartialPathNode node, int dist) {
partialFlow(source, node) and
dist = node.getSourceDistance()
}
@@ -4614,7 +4603,7 @@ module Impl<FullStateConfigSig Config> {
* Note that reverse flow has slightly lower precision than the corresponding
* forward flow, as reverse flow disregards type pruning among other features.
*/
predicate hasPartialFlowRev(PartialPathNode node, PartialPathNode sink, int dist) {
predicate partialFlowRev(PartialPathNode node, PartialPathNode sink, int dist) {
revPartialFlow(node, sink) and
dist = node.getSinkDistance()
}

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -1,5 +1,5 @@
/**
* DEPRECATED: Use `Make` and `MakeWithState` instead.
* DEPRECATED: Use `Global` and `GlobalWithState` instead.
*
* Provides a `Configuration` class backwards-compatible interface to the data
* flow library.
@@ -11,6 +11,7 @@ import DataFlowImplSpecific::Public
private import DataFlowImpl
import DataFlowImplCommonPublic
import FlowStateString
private import codeql.util.Unit
/**
* A configuration of interprocedural data flow analysis. This defines
@@ -328,7 +329,6 @@ private module Config implements FullStateConfigSig {
}
private import Impl<Config> as I
import I
/**
* A `Node` augmented with a call context (except for sinks), an access path, and a configuration.
@@ -379,6 +379,8 @@ class PathNode instanceof I::PathNode {
final predicate isSinkGroup(string group) { super.isSinkGroup(group) }
}
module PathGraph = I::PathGraph;
private predicate hasFlow(Node source, Node sink, Configuration config) {
exists(PathNode source0, PathNode sink0 |
hasFlowPath(source0, sink0, config) and
@@ -388,7 +390,7 @@ private predicate hasFlow(Node source, Node sink, Configuration config) {
}
private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) {
hasFlowPath(source, sink) and source.getConfiguration() = config
I::flowPath(source, sink) and source.getConfiguration() = config
}
private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) }

View File

@@ -140,10 +140,8 @@ private module LambdaFlow {
}
pragma[nomagic]
private TReturnPositionSimple viableReturnPosLambda(
DataFlowCall call, DataFlowCallOption lastCall, ReturnKind kind
) {
result = TReturnPositionSimple0(viableCallableLambda(call, lastCall), kind)
private TReturnPositionSimple viableReturnPosLambda(DataFlowCall call, ReturnKind kind) {
result = TReturnPositionSimple0(viableCallableLambda(call, _), kind)
}
private predicate viableReturnPosOutNonLambda(
@@ -155,11 +153,12 @@ private module LambdaFlow {
)
}
pragma[nomagic]
private predicate viableReturnPosOutLambda(
DataFlowCall call, DataFlowCallOption lastCall, TReturnPositionSimple pos, OutNode out
DataFlowCall call, TReturnPositionSimple pos, OutNode out
) {
exists(ReturnKind kind |
pos = viableReturnPosLambda(call, lastCall, kind) and
pos = viableReturnPosLambda(call, kind) and
out = getAnOutNode(call, kind)
)
}
@@ -188,6 +187,7 @@ private module LambdaFlow {
else any()
}
pragma[assume_small_delta]
pragma[nomagic]
predicate revLambdaFlow0(
DataFlowCall lambdaCall, LambdaCallKind kind, Node node, DataFlowType t, boolean toReturn,
@@ -274,6 +274,7 @@ private module LambdaFlow {
)
}
pragma[assume_small_delta]
pragma[nomagic]
predicate revLambdaFlowOut(
DataFlowCall lambdaCall, LambdaCallKind kind, TReturnPositionSimple pos, DataFlowType t,
@@ -285,7 +286,7 @@ private module LambdaFlow {
or
// non-linear recursion
revLambdaFlowOutLambdaCall(lambdaCall, kind, out, t, toJump, call, lastCall) and
viableReturnPosOutLambda(call, _, pos, out)
viableReturnPosOutLambda(call, pos, out)
)
}
@@ -424,7 +425,8 @@ private module Cached {
exists(ParameterPosition ppos |
viableParam(call, ppos, p) and
argumentPositionMatch(call, arg, ppos) and
compatibleTypes(getNodeDataFlowType(arg), getNodeDataFlowType(p))
compatibleTypes(getNodeDataFlowType(arg), getNodeDataFlowType(p)) and
golangSpecificParamArgFilter(call, p, arg)
)
}

View File

@@ -6,6 +6,7 @@ private import DataFlowImplConsistency
private import semmle.code.cpp.ir.internal.IRCppLanguage
private import SsaInternals as Ssa
private import DataFlowImplCommon as DataFlowImplCommon
private import codeql.util.Unit
cached
private module Cached {
@@ -799,15 +800,6 @@ int accessPathLimit() { result = 5 }
*/
predicate forceHighPrecision(Content c) { none() }
/** The unit type. */
private newtype TUnit = TMkUnit()
/** The trivial type with a single element. */
class Unit extends TUnit {
/** Gets a textual representation of this element. */
string toString() { result = "unit" }
}
/** Holds if `n` should be hidden from path explanations. */
predicate nodeIsHidden(Node n) {
n instanceof OperandNode and

View File

@@ -9,7 +9,6 @@ import cpp
import semmle.code.cpp.security.Security
private import semmle.code.cpp.ir.dataflow.DataFlow
private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private import semmle.code.cpp.ir.dataflow.DataFlow3
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.ir.dataflow.ResolveCall
private import semmle.code.cpp.controlflow.IRGuards
@@ -90,65 +89,64 @@ private predicate conflatePointerAndPointee(DataFlow::Node nodeFrom, DataFlow::N
)
}
private class DefaultTaintTrackingCfg extends TaintTracking::Configuration {
DefaultTaintTrackingCfg() { this = "DefaultTaintTrackingCfg" }
private module DefaultTaintTrackingConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { source = getNodeForSource(_) }
override predicate isSource(DataFlow::Node source) { source = getNodeForSource(_) }
predicate isSink(DataFlow::Node sink) { exists(adjustedSink(sink)) }
override predicate isSink(DataFlow::Node sink) { exists(adjustedSink(sink)) }
predicate isBarrier(DataFlow::Node node) { nodeIsBarrier(node) }
override predicate isSanitizer(DataFlow::Node node) { nodeIsBarrier(node) }
predicate isBarrierIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
override predicate isSanitizerIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
override predicate isAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
conflatePointerAndPointee(nodeFrom, nodeTo)
}
}
private class ToGlobalVarTaintTrackingCfg extends TaintTracking::Configuration {
ToGlobalVarTaintTrackingCfg() { this = "GlobalVarTaintTrackingCfg" }
private module DefaultTaintTrackingFlow = TaintTracking::Global<DefaultTaintTrackingConfig>;
override predicate isSource(DataFlow::Node source) { source = getNodeForSource(_) }
private module ToGlobalVarTaintTrackingConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { source = getNodeForSource(_) }
override predicate isSink(DataFlow::Node sink) {
sink.asVariable() instanceof GlobalOrNamespaceVariable
}
predicate isSink(DataFlow::Node sink) { sink.asVariable() instanceof GlobalOrNamespaceVariable }
override predicate isAdditionalTaintStep(DataFlow::Node n1, DataFlow::Node n2) {
predicate isAdditionalFlowStep(DataFlow::Node n1, DataFlow::Node n2) {
writesVariable(n1.asInstruction(), n2.asVariable().(GlobalOrNamespaceVariable))
or
readsVariable(n2.asInstruction(), n1.asVariable().(GlobalOrNamespaceVariable))
}
override predicate isSanitizer(DataFlow::Node node) { nodeIsBarrier(node) }
predicate isBarrier(DataFlow::Node node) { nodeIsBarrier(node) }
override predicate isSanitizerIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
predicate isBarrierIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
}
private class FromGlobalVarTaintTrackingCfg extends TaintTracking2::Configuration {
FromGlobalVarTaintTrackingCfg() { this = "FromGlobalVarTaintTrackingCfg" }
private module ToGlobalVarTaintTrackingFlow = TaintTracking::Global<ToGlobalVarTaintTrackingConfig>;
override predicate isSource(DataFlow::Node source) {
private module FromGlobalVarTaintTrackingConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) {
// This set of sources should be reasonably small, which is good for
// performance since the set of sinks is very large.
exists(ToGlobalVarTaintTrackingCfg otherCfg | otherCfg.hasFlowTo(source))
ToGlobalVarTaintTrackingFlow::flowTo(source)
}
override predicate isSink(DataFlow::Node sink) { exists(adjustedSink(sink)) }
predicate isSink(DataFlow::Node sink) { exists(adjustedSink(sink)) }
override predicate isAdditionalTaintStep(DataFlow::Node n1, DataFlow::Node n2) {
predicate isAdditionalFlowStep(DataFlow::Node n1, DataFlow::Node n2) {
// Additional step for flow out of variables. There is no flow _into_
// variables in this configuration, so this step only serves to take flow
// out of a variable that's a source.
readsVariable(n2.asInstruction(), n1.asVariable())
}
override predicate isSanitizer(DataFlow::Node node) { nodeIsBarrier(node) }
predicate isBarrier(DataFlow::Node node) { nodeIsBarrier(node) }
override predicate isSanitizerIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
predicate isBarrierIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
}
private module FromGlobalVarTaintTrackingFlow =
TaintTracking::Global<FromGlobalVarTaintTrackingConfig>;
private predicate readsVariable(LoadInstruction load, Variable var) {
load.getSourceAddress().(VariableAddressInstruction).getAstVariable() = var
}
@@ -332,8 +330,8 @@ private import Cached
*/
cached
predicate tainted(Expr source, Element tainted) {
exists(DefaultTaintTrackingCfg cfg, DataFlow::Node sink |
cfg.hasFlow(getNodeForSource(source), sink) and
exists(DataFlow::Node sink |
DefaultTaintTrackingFlow::flow(getNodeForSource(source), sink) and
tainted = adjustedSink(sink)
)
}
@@ -359,12 +357,11 @@ predicate taintedIncludingGlobalVars(Expr source, Element tainted, string global
globalVar = ""
or
exists(
ToGlobalVarTaintTrackingCfg toCfg, FromGlobalVarTaintTrackingCfg fromCfg,
DataFlow::VariableNode variableNode, GlobalOrNamespaceVariable global, DataFlow::Node sink
|
global = variableNode.getVariable() and
toCfg.hasFlow(getNodeForSource(source), variableNode) and
fromCfg.hasFlow(variableNode, sink) and
ToGlobalVarTaintTrackingFlow::flow(getNodeForSource(source), variableNode) and
FromGlobalVarTaintTrackingFlow::flow(variableNode, sink) and
tainted = adjustedSink(sink) and
global = globalVarFromId(globalVar)
)
@@ -422,20 +419,18 @@ module TaintedWithPath {
string toString() { result = "TaintTrackingConfiguration" }
}
private class AdjustedConfiguration extends TaintTracking3::Configuration {
AdjustedConfiguration() { this = "AdjustedConfiguration" }
override predicate isSource(DataFlow::Node source) {
private module AdjustedConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) {
exists(TaintTrackingConfiguration cfg, Expr e |
cfg.isSource(e) and source = getNodeForExpr(e)
)
}
override predicate isSink(DataFlow::Node sink) {
predicate isSink(DataFlow::Node sink) {
exists(TaintTrackingConfiguration cfg | cfg.isSink(adjustedSink(sink)))
}
override predicate isAdditionalTaintStep(DataFlow::Node n1, DataFlow::Node n2) {
predicate isAdditionalFlowStep(DataFlow::Node n1, DataFlow::Node n2) {
conflatePointerAndPointee(n1, n2)
or
// Steps into and out of global variables
@@ -448,13 +443,15 @@ module TaintedWithPath {
additionalTaintStep(n1, n2)
}
override predicate isSanitizer(DataFlow::Node node) {
predicate isBarrier(DataFlow::Node node) {
exists(TaintTrackingConfiguration cfg, Expr e | cfg.isBarrier(e) and node = getNodeForExpr(e))
}
override predicate isSanitizerIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
predicate isBarrierIn(DataFlow::Node node) { nodeIsBarrierIn(node) }
}
private module AdjustedFlow = TaintTracking::Global<AdjustedConfig>;
/*
* A sink `Element` may map to multiple `DataFlowX::PathNode`s via (the
* inverse of) `adjustedSink`. For example, an `Expr` maps to all its
@@ -470,12 +467,12 @@ module TaintedWithPath {
*/
private newtype TPathNode =
TWrapPathNode(DataFlow3::PathNode n) or
TWrapPathNode(AdjustedFlow::PathNode n) or
// There's a single newtype constructor for both sources and sinks since
// that makes it easiest to deal with the case where source = sink.
TEndpointPathNode(Element e) {
exists(AdjustedConfiguration cfg, DataFlow3::Node sourceNode, DataFlow3::Node sinkNode |
cfg.hasFlow(sourceNode, sinkNode)
exists(DataFlow::Node sourceNode, DataFlow::Node sinkNode |
AdjustedFlow::flow(sourceNode, sinkNode)
|
sourceNode = getNodeForExpr(e) and
exists(TaintTrackingConfiguration ttCfg | ttCfg.isSource(e))
@@ -524,7 +521,7 @@ module TaintedWithPath {
}
private class WrapPathNode extends PathNode, TWrapPathNode {
DataFlow3::PathNode inner() { this = TWrapPathNode(result) }
AdjustedFlow::PathNode inner() { this = TWrapPathNode(result) }
override string toString() { result = this.inner().toString() }
@@ -561,25 +558,25 @@ module TaintedWithPath {
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
query predicate edges(PathNode a, PathNode b) {
DataFlow3::PathGraph::edges(a.(WrapPathNode).inner(), b.(WrapPathNode).inner())
AdjustedFlow::PathGraph::edges(a.(WrapPathNode).inner(), b.(WrapPathNode).inner())
or
// To avoid showing trivial-looking steps, we _replace_ the last node instead
// of adding an edge out of it.
exists(WrapPathNode sinkNode |
DataFlow3::PathGraph::edges(a.(WrapPathNode).inner(), sinkNode.inner()) and
AdjustedFlow::PathGraph::edges(a.(WrapPathNode).inner(), sinkNode.inner()) and
b.(FinalPathNode).inner() = adjustedSink(sinkNode.inner().getNode())
)
or
// Same for the first node
exists(WrapPathNode sourceNode |
DataFlow3::PathGraph::edges(sourceNode.inner(), b.(WrapPathNode).inner()) and
AdjustedFlow::PathGraph::edges(sourceNode.inner(), b.(WrapPathNode).inner()) and
sourceNode.inner().getNode() = getNodeForExpr(a.(InitialPathNode).inner())
)
or
// Finally, handle the case where the path goes directly from a source to a
// sink, meaning that they both need to be translated.
exists(WrapPathNode sinkNode, WrapPathNode sourceNode |
DataFlow3::PathGraph::edges(sourceNode.inner(), sinkNode.inner()) and
AdjustedFlow::PathGraph::edges(sourceNode.inner(), sinkNode.inner()) and
sourceNode.inner().getNode() = getNodeForExpr(a.(InitialPathNode).inner()) and
b.(FinalPathNode).inner() = adjustedSink(sinkNode.inner().getNode())
)
@@ -590,20 +587,20 @@ module TaintedWithPath {
* from `par` to `ret` within it, in the graph of data flow path explanations.
*/
query predicate subpaths(PathNode arg, PathNode par, PathNode ret, PathNode out) {
DataFlow3::PathGraph::subpaths(arg.(WrapPathNode).inner(), par.(WrapPathNode).inner(),
AdjustedFlow::PathGraph::subpaths(arg.(WrapPathNode).inner(), par.(WrapPathNode).inner(),
ret.(WrapPathNode).inner(), out.(WrapPathNode).inner())
or
// To avoid showing trivial-looking steps, we _replace_ the last node instead
// of adding an edge out of it.
exists(WrapPathNode sinkNode |
DataFlow3::PathGraph::subpaths(arg.(WrapPathNode).inner(), par.(WrapPathNode).inner(),
AdjustedFlow::PathGraph::subpaths(arg.(WrapPathNode).inner(), par.(WrapPathNode).inner(),
ret.(WrapPathNode).inner(), sinkNode.inner()) and
out.(FinalPathNode).inner() = adjustedSink(sinkNode.inner().getNode())
)
or
// Same for the first node
exists(WrapPathNode sourceNode |
DataFlow3::PathGraph::subpaths(sourceNode.inner(), par.(WrapPathNode).inner(),
AdjustedFlow::PathGraph::subpaths(sourceNode.inner(), par.(WrapPathNode).inner(),
ret.(WrapPathNode).inner(), out.(WrapPathNode).inner()) and
sourceNode.inner().getNode() = getNodeForExpr(arg.(InitialPathNode).inner())
)
@@ -611,7 +608,7 @@ module TaintedWithPath {
// Finally, handle the case where the path goes directly from a source to a
// sink, meaning that they both need to be translated.
exists(WrapPathNode sinkNode, WrapPathNode sourceNode |
DataFlow3::PathGraph::subpaths(sourceNode.inner(), par.(WrapPathNode).inner(),
AdjustedFlow::PathGraph::subpaths(sourceNode.inner(), par.(WrapPathNode).inner(),
ret.(WrapPathNode).inner(), sinkNode.inner()) and
sourceNode.inner().getNode() = getNodeForExpr(arg.(InitialPathNode).inner()) and
out.(FinalPathNode).inner() = adjustedSink(sinkNode.inner().getNode())
@@ -634,10 +631,10 @@ module TaintedWithPath {
* the computation.
*/
predicate taintedWithPath(Expr source, Element tainted, PathNode sourceNode, PathNode sinkNode) {
exists(AdjustedConfiguration cfg, DataFlow3::Node flowSource, DataFlow3::Node flowSink |
exists(DataFlow::Node flowSource, DataFlow::Node flowSink |
source = sourceNode.(InitialPathNode).inner() and
flowSource = getNodeForExpr(source) and
cfg.hasFlow(flowSource, flowSink) and
AdjustedFlow::flow(flowSource, flowSink) and
tainted = adjustedSink(flowSink) and
tainted = sinkNode.(FinalPathNode).inner()
)
@@ -660,8 +657,8 @@ module TaintedWithPath {
* through a global variable.
*/
predicate taintedWithoutGlobals(Element tainted) {
exists(AdjustedConfiguration cfg, PathNode sourceNode, FinalPathNode sinkNode |
cfg.isSource(sourceNode.(WrapPathNode).inner().getNode()) and
exists(PathNode sourceNode, FinalPathNode sinkNode |
AdjustedConfig::isSource(sourceNode.(WrapPathNode).inner().getNode()) and
edgesWithoutGlobals+(sourceNode, sinkNode) and
tainted = sinkNode.inner()
)

View File

@@ -33,9 +33,9 @@ private module AddTaintDefaults<DataFlowInternal::FullStateConfigSig Config> imp
}
/**
* Constructs a standard taint tracking computation.
* Constructs a global taint tracking computation.
*/
module Make<DataFlow::ConfigSig Config> implements DataFlow::DataFlowSig {
module Global<DataFlow::ConfigSig Config> implements DataFlow::GlobalFlowSig {
private module Config0 implements DataFlowInternal::FullStateConfigSig {
import DataFlowInternal::DefaultState<Config>
import Config
@@ -48,10 +48,15 @@ module Make<DataFlow::ConfigSig Config> implements DataFlow::DataFlowSig {
import DataFlowInternal::Impl<C>
}
/** DEPRECATED: Use `Global` instead. */
deprecated module Make<DataFlow::ConfigSig Config> implements DataFlow::GlobalFlowSig {
import Global<Config>
}
/**
* Constructs a taint tracking computation using flow state.
* Constructs a global taint tracking computation using flow state.
*/
module MakeWithState<DataFlow::StateConfigSig Config> implements DataFlow::DataFlowSig {
module GlobalWithState<DataFlow::StateConfigSig Config> implements DataFlow::GlobalFlowSig {
private module Config0 implements DataFlowInternal::FullStateConfigSig {
import Config
}
@@ -62,3 +67,8 @@ module MakeWithState<DataFlow::StateConfigSig Config> implements DataFlow::DataF
import DataFlowInternal::Impl<C>
}
/** DEPRECATED: Use `GlobalWithState` instead. */
deprecated module MakeWithState<DataFlow::StateConfigSig Config> implements DataFlow::GlobalFlowSig {
import GlobalWithState<Config>
}

View File

@@ -1,6 +1,7 @@
private import IR
import InstructionConsistency // module is below
import IRTypeConsistency // module is in IRType.qll
import internal.IRConsistencyImports
module InstructionConsistency {
private import internal.InstructionImports as Imports
@@ -28,7 +29,7 @@ module InstructionConsistency {
PresentIRFunction() { this = TPresentIRFunction(irFunc) }
override string toString() {
result = concat(Language::getIdentityString(irFunc.getFunction()), "; ")
result = concat(LanguageDebug::getIdentityString(irFunc.getFunction()), "; ")
}
override Language::Location getLocation() {

View File

@@ -149,7 +149,9 @@ private class PrintableIRFunction extends PrintableIRNode, TPrintableIRFunction
override Language::Location getLocation() { result = irFunc.getLocation() }
override string getLabel() { result = Language::getIdentityString(irFunc.getFunction()) }
override string getLabel() {
result = Imports::LanguageDebug::getIdentityString(irFunc.getFunction())
}
override int getOrder() {
this =

View File

@@ -159,26 +159,56 @@ private predicate fieldAddressValueNumber(
tvalueNumber(instr.getObjectAddress()) = objectAddress
}
pragma[nomagic]
private predicate binaryValueNumber0(
BinaryInstruction instr, IRFunction irFunc, Opcode opcode, boolean isLeft,
TValueNumber valueNumber
) {
not instr instanceof PointerArithmeticInstruction and
instr.getEnclosingIRFunction() = irFunc and
instr.getOpcode() = opcode and
(
isLeft = true and
tvalueNumber(instr.getLeft()) = valueNumber
or
isLeft = false and
tvalueNumber(instr.getRight()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate binaryValueNumber(
BinaryInstruction instr, IRFunction irFunc, Opcode opcode, TValueNumber leftOperand,
TValueNumber rightOperand
) {
instr.getEnclosingIRFunction() = irFunc and
not instr instanceof PointerArithmeticInstruction and
instr.getOpcode() = opcode and
tvalueNumber(instr.getLeft()) = leftOperand and
tvalueNumber(instr.getRight()) = rightOperand
binaryValueNumber0(instr, irFunc, opcode, true, leftOperand) and
binaryValueNumber0(instr, irFunc, opcode, false, rightOperand)
}
private predicate pointerArithmeticValueNumber(
pragma[nomagic]
private predicate pointerArithmeticValueNumber0(
PointerArithmeticInstruction instr, IRFunction irFunc, Opcode opcode, int elementSize,
TValueNumber leftOperand, TValueNumber rightOperand
boolean isLeft, TValueNumber valueNumber
) {
instr.getEnclosingIRFunction() = irFunc and
instr.getOpcode() = opcode and
instr.getElementSize() = elementSize and
tvalueNumber(instr.getLeft()) = leftOperand and
tvalueNumber(instr.getRight()) = rightOperand
(
isLeft = true and
tvalueNumber(instr.getLeft()) = valueNumber
or
isLeft = false and
tvalueNumber(instr.getRight()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate pointerArithmeticValueNumber(
PointerArithmeticInstruction instr, IRFunction irFunc, Opcode opcode, int elementSize,
TValueNumber leftOperand, TValueNumber rightOperand
) {
pointerArithmeticValueNumber0(instr, irFunc, opcode, elementSize, true, leftOperand) and
pointerArithmeticValueNumber0(instr, irFunc, opcode, elementSize, false, rightOperand)
}
private predicate unaryValueNumber(
@@ -203,14 +233,29 @@ private predicate inheritanceConversionValueNumber(
unique( | | instr.getDerivedClass()) = derivedClass
}
pragma[nomagic]
private predicate loadTotalOverlapValueNumber0(
LoadTotalOverlapInstruction instr, IRFunction irFunc, IRType type, TValueNumber valueNumber,
boolean isAddress
) {
instr.getEnclosingIRFunction() = irFunc and
instr.getResultIRType() = type and
(
isAddress = true and
tvalueNumberOfOperand(instr.getSourceAddressOperand()) = valueNumber
or
isAddress = false and
tvalueNumber(instr.getSourceValueOperand().getAnyDef()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate loadTotalOverlapValueNumber(
LoadTotalOverlapInstruction instr, IRFunction irFunc, IRType type, TValueNumber memOperand,
TValueNumber operand
) {
instr.getEnclosingIRFunction() = irFunc and
tvalueNumber(instr.getAnOperand().(MemoryOperand).getAnyDef()) = memOperand and
tvalueNumberOfOperand(instr.getAnOperand().(AddressOperand)) = operand and
instr.getResultIRType() = type
loadTotalOverlapValueNumber0(instr, irFunc, type, operand, true) and
loadTotalOverlapValueNumber0(instr, irFunc, type, memOperand, false)
}
/**

View File

@@ -1,7 +1,7 @@
import AliasAnalysis
import semmle.code.cpp.Location
import semmle.code.cpp.ir.internal.Overlap
private import semmle.code.cpp.ir.internal.IRCppLanguage as Language
private import semmle.code.cpp.Print
private import semmle.code.cpp.ir.implementation.unaliased_ssa.IR
private import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.SSAConstruction as OldSsa
private import semmle.code.cpp.ir.internal.IntegerConstant as Ints

View File

@@ -0,0 +1 @@
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -1 +1,2 @@
import semmle.code.cpp.ir.IRConfiguration as IRConfiguration
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -1,2 +1,55 @@
private import SSAConstruction as Ssa
import Ssa::SsaConsistency
import SsaConsistency
import SSAConsistencyImports
module SsaConsistency {
/**
* Holds if a `MemoryOperand` has more than one `MemoryLocation` assigned by alias analysis.
*/
query predicate multipleOperandMemoryLocations(
OldIR::MemoryOperand operand, string message, OldIR::IRFunction func, string funcText
) {
exists(int locationCount |
locationCount = strictcount(Alias::getOperandMemoryLocation(operand)) and
locationCount > 1 and
func = operand.getEnclosingIRFunction() and
funcText = LanguageDebug::getIdentityString(func.getFunction()) and
message =
operand.getUse().toString() + " " + "Operand has " + locationCount.toString() +
" memory accesses in function '$@': " +
strictconcat(Alias::getOperandMemoryLocation(operand).toString(), ", ")
)
}
/**
* Holds if a `MemoryLocation` does not have an associated `VirtualVariable`.
*/
query predicate missingVirtualVariableForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
not exists(location.getVirtualVariable()) and
func = location.getIRFunction() and
funcText = LanguageDebug::getIdentityString(func.getFunction()) and
message = "Memory location has no virtual variable in function '$@'."
}
/**
* Holds if a `MemoryLocation` is a member of more than one `VirtualVariable`.
*/
query predicate multipleVirtualVariablesForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
exists(int vvarCount |
vvarCount = strictcount(location.getVirtualVariable()) and
vvarCount > 1 and
func = location.getIRFunction() and
funcText = LanguageDebug::getIdentityString(func.getFunction()) and
message =
"Memory location has " + vvarCount.toString() + " virtual variables in function '$@': (" +
concat(Alias::VirtualVariable vvar |
vvar = location.getVirtualVariable()
|
vvar.toString(), ", "
) + ")."
)
}
}

View File

@@ -0,0 +1,3 @@
import semmle.code.cpp.ir.implementation.raw.IR as OldIR
import AliasedSSA as Alias
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -996,7 +996,7 @@ deprecated predicate canReuseSSAForMemoryResult = canReuseSsaForMemoryResult/1;
/**
* Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
* `DebugSSA` module, which is then imported by PrintSSA.
* `DebugSsa` module, which is then imported by PrintSSA.
*/
module DebugSsa {
import PhiInsertion
@@ -1063,62 +1063,6 @@ private module CachedForDebugging {
int maxValue() { result = 2147483647 }
}
module SsaConsistency {
/**
* Holds if a `MemoryOperand` has more than one `MemoryLocation` assigned by alias analysis.
*/
query predicate multipleOperandMemoryLocations(
OldIR::MemoryOperand operand, string message, OldIR::IRFunction func, string funcText
) {
exists(int locationCount |
locationCount = strictcount(Alias::getOperandMemoryLocation(operand)) and
locationCount > 1 and
func = operand.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction()) and
message =
operand.getUse().toString() + " " + "Operand has " + locationCount.toString() +
" memory accesses in function '$@': " +
strictconcat(Alias::getOperandMemoryLocation(operand).toString(), ", ")
)
}
/**
* Holds if a `MemoryLocation` does not have an associated `VirtualVariable`.
*/
query predicate missingVirtualVariableForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
not exists(location.getVirtualVariable()) and
func = location.getIRFunction() and
funcText = Language::getIdentityString(func.getFunction()) and
message = "Memory location has no virtual variable in function '$@'."
}
/**
* Holds if a `MemoryLocation` is a member of more than one `VirtualVariable`.
*/
query predicate multipleVirtualVariablesForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
exists(int vvarCount |
vvarCount = strictcount(location.getVirtualVariable()) and
vvarCount > 1 and
func = location.getIRFunction() and
funcText = Language::getIdentityString(func.getFunction()) and
message =
"Memory location has " + vvarCount.toString() + " virtual variables in function '$@': (" +
concat(Alias::VirtualVariable vvar |
vvar = location.getVirtualVariable()
|
vvar.toString(), ", "
) + ")."
)
}
}
/** DEPRECATED: Alias for SsaConsistency */
deprecated module SSAConsistency = SsaConsistency;
/**
* Provides the portion of the parameterized IR interface that is used to construct the SSA stages
* of the IR. The raw stage of the IR does not expose these predicates.

View File

@@ -1,6 +1,7 @@
private import IR
import InstructionConsistency // module is below
import IRTypeConsistency // module is in IRType.qll
import internal.IRConsistencyImports
module InstructionConsistency {
private import internal.InstructionImports as Imports
@@ -28,7 +29,7 @@ module InstructionConsistency {
PresentIRFunction() { this = TPresentIRFunction(irFunc) }
override string toString() {
result = concat(Language::getIdentityString(irFunc.getFunction()), "; ")
result = concat(LanguageDebug::getIdentityString(irFunc.getFunction()), "; ")
}
override Language::Location getLocation() {

View File

@@ -149,7 +149,9 @@ private class PrintableIRFunction extends PrintableIRNode, TPrintableIRFunction
override Language::Location getLocation() { result = irFunc.getLocation() }
override string getLabel() { result = Language::getIdentityString(irFunc.getFunction()) }
override string getLabel() {
result = Imports::LanguageDebug::getIdentityString(irFunc.getFunction())
}
override int getOrder() {
this =

View File

@@ -159,26 +159,56 @@ private predicate fieldAddressValueNumber(
tvalueNumber(instr.getObjectAddress()) = objectAddress
}
pragma[nomagic]
private predicate binaryValueNumber0(
BinaryInstruction instr, IRFunction irFunc, Opcode opcode, boolean isLeft,
TValueNumber valueNumber
) {
not instr instanceof PointerArithmeticInstruction and
instr.getEnclosingIRFunction() = irFunc and
instr.getOpcode() = opcode and
(
isLeft = true and
tvalueNumber(instr.getLeft()) = valueNumber
or
isLeft = false and
tvalueNumber(instr.getRight()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate binaryValueNumber(
BinaryInstruction instr, IRFunction irFunc, Opcode opcode, TValueNumber leftOperand,
TValueNumber rightOperand
) {
instr.getEnclosingIRFunction() = irFunc and
not instr instanceof PointerArithmeticInstruction and
instr.getOpcode() = opcode and
tvalueNumber(instr.getLeft()) = leftOperand and
tvalueNumber(instr.getRight()) = rightOperand
binaryValueNumber0(instr, irFunc, opcode, true, leftOperand) and
binaryValueNumber0(instr, irFunc, opcode, false, rightOperand)
}
private predicate pointerArithmeticValueNumber(
pragma[nomagic]
private predicate pointerArithmeticValueNumber0(
PointerArithmeticInstruction instr, IRFunction irFunc, Opcode opcode, int elementSize,
TValueNumber leftOperand, TValueNumber rightOperand
boolean isLeft, TValueNumber valueNumber
) {
instr.getEnclosingIRFunction() = irFunc and
instr.getOpcode() = opcode and
instr.getElementSize() = elementSize and
tvalueNumber(instr.getLeft()) = leftOperand and
tvalueNumber(instr.getRight()) = rightOperand
(
isLeft = true and
tvalueNumber(instr.getLeft()) = valueNumber
or
isLeft = false and
tvalueNumber(instr.getRight()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate pointerArithmeticValueNumber(
PointerArithmeticInstruction instr, IRFunction irFunc, Opcode opcode, int elementSize,
TValueNumber leftOperand, TValueNumber rightOperand
) {
pointerArithmeticValueNumber0(instr, irFunc, opcode, elementSize, true, leftOperand) and
pointerArithmeticValueNumber0(instr, irFunc, opcode, elementSize, false, rightOperand)
}
private predicate unaryValueNumber(
@@ -203,14 +233,29 @@ private predicate inheritanceConversionValueNumber(
unique( | | instr.getDerivedClass()) = derivedClass
}
pragma[nomagic]
private predicate loadTotalOverlapValueNumber0(
LoadTotalOverlapInstruction instr, IRFunction irFunc, IRType type, TValueNumber valueNumber,
boolean isAddress
) {
instr.getEnclosingIRFunction() = irFunc and
instr.getResultIRType() = type and
(
isAddress = true and
tvalueNumberOfOperand(instr.getSourceAddressOperand()) = valueNumber
or
isAddress = false and
tvalueNumber(instr.getSourceValueOperand().getAnyDef()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate loadTotalOverlapValueNumber(
LoadTotalOverlapInstruction instr, IRFunction irFunc, IRType type, TValueNumber memOperand,
TValueNumber operand
) {
instr.getEnclosingIRFunction() = irFunc and
tvalueNumber(instr.getAnOperand().(MemoryOperand).getAnyDef()) = memOperand and
tvalueNumberOfOperand(instr.getAnOperand().(AddressOperand)) = operand and
instr.getResultIRType() = type
loadTotalOverlapValueNumber0(instr, irFunc, type, operand, true) and
loadTotalOverlapValueNumber0(instr, irFunc, type, memOperand, false)
}
/**

View File

@@ -0,0 +1 @@
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -1 +1,2 @@
import semmle.code.cpp.ir.IRConfiguration as IRConfiguration
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -606,9 +606,9 @@ newtype TTranslatedElement =
not ignoreExpr(expr) and
(
exists(Initializer init | init.getExpr().getFullyConverted() = expr) or
exists(ClassAggregateLiteral initList | initList.getFieldExpr(_).getFullyConverted() = expr) or
exists(ClassAggregateLiteral initList | initList.getAFieldExpr(_).getFullyConverted() = expr) or
exists(ArrayOrVectorAggregateLiteral initList |
initList.getElementExpr(_).getFullyConverted() = expr
initList.getAnElementExpr(_).getFullyConverted() = expr
) or
exists(ReturnStmt returnStmt | returnStmt.getExpr().getFullyConverted() = expr) or
exists(ConstructorFieldInit fieldInit | fieldInit.getExpr().getFullyConverted() = expr) or
@@ -619,18 +619,19 @@ newtype TTranslatedElement =
)
} or
// The initialization of a field via a member of an initializer list.
TTranslatedExplicitFieldInitialization(Expr ast, Field field, Expr expr) {
TTranslatedExplicitFieldInitialization(Expr ast, Field field, Expr expr, int position) {
exists(ClassAggregateLiteral initList |
not ignoreExpr(initList) and
ast = initList and
expr = initList.getFieldExpr(field).getFullyConverted()
expr = initList.getFieldExpr(field, position).getFullyConverted()
)
or
exists(ConstructorFieldInit init |
not ignoreExpr(init) and
ast = init and
field = init.getTarget() and
expr = init.getExpr().getFullyConverted()
expr = init.getExpr().getFullyConverted() and
position = -1
)
} or
// The value initialization of a field due to an omitted member of an
@@ -643,9 +644,11 @@ newtype TTranslatedElement =
)
} or
// The initialization of an array element via a member of an initializer list.
TTranslatedExplicitElementInitialization(ArrayOrVectorAggregateLiteral initList, int elementIndex) {
TTranslatedExplicitElementInitialization(
ArrayOrVectorAggregateLiteral initList, int elementIndex, int position
) {
not ignoreExpr(initList) and
exists(initList.getElementExpr(elementIndex))
exists(initList.getElementExpr(elementIndex, position))
} or
// The value initialization of a range of array elements that were omitted
// from an initializer list.
@@ -782,7 +785,7 @@ private int getNextExplicitlyInitializedElementAfter(
ArrayOrVectorAggregateLiteral initList, int afterElementIndex
) {
isFirstValueInitializedElementInRange(initList, afterElementIndex) and
result = min(int i | exists(initList.getElementExpr(i)) and i > afterElementIndex)
result = min(int i | exists(initList.getAnElementExpr(i)) and i > afterElementIndex)
}
/**
@@ -795,7 +798,7 @@ private predicate isFirstValueInitializedElementInRange(
initList.isValueInitialized(elementIndex) and
(
elementIndex = 0 or
exists(initList.getElementExpr(elementIndex - 1))
exists(initList.getAnElementExpr(elementIndex - 1))
)
}

View File

@@ -201,11 +201,13 @@ class TranslatedClassListInitialization extends TranslatedListInitialization {
override ClassAggregateLiteral expr;
override TranslatedElement getChild(int id) {
exists(TranslatedFieldInitialization fieldInit |
result = fieldInit and
fieldInit = getTranslatedFieldInitialization(expr, _) and
fieldInit.getOrder() = id
)
result =
rank[id + 1](TranslatedFieldInitialization fieldInit, int ord |
fieldInit = getTranslatedFieldInitialization(expr, _) and
fieldInit.getOrder() = ord
|
fieldInit order by ord, fieldInit.getPosition()
)
}
}
@@ -222,7 +224,7 @@ class TranslatedArrayListInitialization extends TranslatedListInitialization {
rank[id + 1](TranslatedElementInitialization init |
init.getInitList() = expr
|
init order by init.getElementIndex()
init order by init.getElementIndex(), init.getPosition()
)
}
}
@@ -522,6 +524,9 @@ abstract class TranslatedFieldInitialization extends TranslatedElement {
final InstructionTag getFieldAddressTag() { result = InitializerFieldAddressTag() }
final Field getField() { result = field }
/** Gets the position in the initializer list, or `-1` if the initialization is implicit. */
int getPosition() { result = -1 }
}
/**
@@ -532,9 +537,10 @@ class TranslatedExplicitFieldInitialization extends TranslatedFieldInitializatio
InitializationContext, TTranslatedExplicitFieldInitialization
{
Expr expr;
int position;
TranslatedExplicitFieldInitialization() {
this = TTranslatedExplicitFieldInitialization(ast, field, expr)
this = TTranslatedExplicitFieldInitialization(ast, field, expr, position)
}
override Instruction getTargetAddress() { result = getInstruction(getFieldAddressTag()) }
@@ -556,6 +562,8 @@ class TranslatedExplicitFieldInitialization extends TranslatedFieldInitializatio
private TranslatedInitialization getInitialization() {
result = getTranslatedInitialization(expr)
}
override int getPosition() { result = position }
}
private string getZeroValue(Type type) {
@@ -689,6 +697,8 @@ abstract class TranslatedElementInitialization extends TranslatedElement {
abstract int getElementIndex();
int getPosition() { result = -1 }
final InstructionTag getElementAddressTag() { result = InitializerElementAddressTag() }
final InstructionTag getElementIndexTag() { result = InitializerElementIndexTag() }
@@ -706,9 +716,10 @@ class TranslatedExplicitElementInitialization extends TranslatedElementInitializ
TTranslatedExplicitElementInitialization, InitializationContext
{
int elementIndex;
int position;
TranslatedExplicitElementInitialization() {
this = TTranslatedExplicitElementInitialization(initList, elementIndex)
this = TTranslatedExplicitElementInitialization(initList, elementIndex, position)
}
override Instruction getTargetAddress() { result = getInstruction(getElementAddressTag()) }
@@ -731,8 +742,13 @@ class TranslatedExplicitElementInitialization extends TranslatedElementInitializ
override int getElementIndex() { result = elementIndex }
override int getPosition() { result = position }
TranslatedInitialization getInitialization() {
result = getTranslatedInitialization(initList.getElementExpr(elementIndex).getFullyConverted())
result =
getTranslatedInitialization(initList
.getElementExpr(elementIndex, position)
.getFullyConverted())
}
}

View File

@@ -1105,3 +1105,49 @@ class TranslatedAsmStmt extends TranslatedStmt {
)
}
}
class TranslatedVlaDimensionStmt extends TranslatedStmt {
override VlaDimensionStmt stmt;
override TranslatedExpr getChild(int id) {
id = 0 and
result = getTranslatedExpr(stmt.getDimensionExpr().getFullyConverted())
}
override Instruction getFirstInstruction() { result = this.getChild(0).getFirstInstruction() }
override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType resultType) {
none()
}
override Instruction getInstructionSuccessor(InstructionTag tag, EdgeKind kind) { none() }
override Instruction getChildSuccessor(TranslatedElement child) {
child = this.getChild(0) and
result = this.getParent().getChildSuccessor(this)
}
}
class TranslatedVlaDeclarationStmt extends TranslatedStmt {
override VlaDeclStmt stmt;
override TranslatedExpr getChild(int id) { none() }
override Instruction getFirstInstruction() { result = this.getInstruction(OnlyInstructionTag()) }
override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType resultType) {
// TODO: This needs a new kind of instruction that represents initialization of a VLA.
// For now we just emit a `NoOp` instruction so that the CFG isn't incomplete.
tag = OnlyInstructionTag() and
opcode instanceof Opcode::NoOp and
resultType = getVoidType()
}
override Instruction getInstructionSuccessor(InstructionTag tag, EdgeKind kind) {
tag = OnlyInstructionTag() and
result = this.getParent().getChildSuccessor(this) and
kind instanceof GotoEdge
}
override Instruction getChildSuccessor(TranslatedElement child) { none() }
}

View File

@@ -1,6 +1,7 @@
private import IR
import InstructionConsistency // module is below
import IRTypeConsistency // module is in IRType.qll
import internal.IRConsistencyImports
module InstructionConsistency {
private import internal.InstructionImports as Imports
@@ -28,7 +29,7 @@ module InstructionConsistency {
PresentIRFunction() { this = TPresentIRFunction(irFunc) }
override string toString() {
result = concat(Language::getIdentityString(irFunc.getFunction()), "; ")
result = concat(LanguageDebug::getIdentityString(irFunc.getFunction()), "; ")
}
override Language::Location getLocation() {

View File

@@ -149,7 +149,9 @@ private class PrintableIRFunction extends PrintableIRNode, TPrintableIRFunction
override Language::Location getLocation() { result = irFunc.getLocation() }
override string getLabel() { result = Language::getIdentityString(irFunc.getFunction()) }
override string getLabel() {
result = Imports::LanguageDebug::getIdentityString(irFunc.getFunction())
}
override int getOrder() {
this =

View File

@@ -159,26 +159,56 @@ private predicate fieldAddressValueNumber(
tvalueNumber(instr.getObjectAddress()) = objectAddress
}
pragma[nomagic]
private predicate binaryValueNumber0(
BinaryInstruction instr, IRFunction irFunc, Opcode opcode, boolean isLeft,
TValueNumber valueNumber
) {
not instr instanceof PointerArithmeticInstruction and
instr.getEnclosingIRFunction() = irFunc and
instr.getOpcode() = opcode and
(
isLeft = true and
tvalueNumber(instr.getLeft()) = valueNumber
or
isLeft = false and
tvalueNumber(instr.getRight()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate binaryValueNumber(
BinaryInstruction instr, IRFunction irFunc, Opcode opcode, TValueNumber leftOperand,
TValueNumber rightOperand
) {
instr.getEnclosingIRFunction() = irFunc and
not instr instanceof PointerArithmeticInstruction and
instr.getOpcode() = opcode and
tvalueNumber(instr.getLeft()) = leftOperand and
tvalueNumber(instr.getRight()) = rightOperand
binaryValueNumber0(instr, irFunc, opcode, true, leftOperand) and
binaryValueNumber0(instr, irFunc, opcode, false, rightOperand)
}
private predicate pointerArithmeticValueNumber(
pragma[nomagic]
private predicate pointerArithmeticValueNumber0(
PointerArithmeticInstruction instr, IRFunction irFunc, Opcode opcode, int elementSize,
TValueNumber leftOperand, TValueNumber rightOperand
boolean isLeft, TValueNumber valueNumber
) {
instr.getEnclosingIRFunction() = irFunc and
instr.getOpcode() = opcode and
instr.getElementSize() = elementSize and
tvalueNumber(instr.getLeft()) = leftOperand and
tvalueNumber(instr.getRight()) = rightOperand
(
isLeft = true and
tvalueNumber(instr.getLeft()) = valueNumber
or
isLeft = false and
tvalueNumber(instr.getRight()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate pointerArithmeticValueNumber(
PointerArithmeticInstruction instr, IRFunction irFunc, Opcode opcode, int elementSize,
TValueNumber leftOperand, TValueNumber rightOperand
) {
pointerArithmeticValueNumber0(instr, irFunc, opcode, elementSize, true, leftOperand) and
pointerArithmeticValueNumber0(instr, irFunc, opcode, elementSize, false, rightOperand)
}
private predicate unaryValueNumber(
@@ -203,14 +233,29 @@ private predicate inheritanceConversionValueNumber(
unique( | | instr.getDerivedClass()) = derivedClass
}
pragma[nomagic]
private predicate loadTotalOverlapValueNumber0(
LoadTotalOverlapInstruction instr, IRFunction irFunc, IRType type, TValueNumber valueNumber,
boolean isAddress
) {
instr.getEnclosingIRFunction() = irFunc and
instr.getResultIRType() = type and
(
isAddress = true and
tvalueNumberOfOperand(instr.getSourceAddressOperand()) = valueNumber
or
isAddress = false and
tvalueNumber(instr.getSourceValueOperand().getAnyDef()) = valueNumber
)
}
pragma[assume_small_delta]
private predicate loadTotalOverlapValueNumber(
LoadTotalOverlapInstruction instr, IRFunction irFunc, IRType type, TValueNumber memOperand,
TValueNumber operand
) {
instr.getEnclosingIRFunction() = irFunc and
tvalueNumber(instr.getAnOperand().(MemoryOperand).getAnyDef()) = memOperand and
tvalueNumberOfOperand(instr.getAnOperand().(AddressOperand)) = operand and
instr.getResultIRType() = type
loadTotalOverlapValueNumber0(instr, irFunc, type, operand, true) and
loadTotalOverlapValueNumber0(instr, irFunc, type, memOperand, false)
}
/**

View File

@@ -0,0 +1 @@
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -1 +1,2 @@
import semmle.code.cpp.ir.IRConfiguration as IRConfiguration
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -1,2 +1,55 @@
private import SSAConstruction as Ssa
import Ssa::SsaConsistency
import SsaConsistency
import SSAConsistencyImports
module SsaConsistency {
/**
* Holds if a `MemoryOperand` has more than one `MemoryLocation` assigned by alias analysis.
*/
query predicate multipleOperandMemoryLocations(
OldIR::MemoryOperand operand, string message, OldIR::IRFunction func, string funcText
) {
exists(int locationCount |
locationCount = strictcount(Alias::getOperandMemoryLocation(operand)) and
locationCount > 1 and
func = operand.getEnclosingIRFunction() and
funcText = LanguageDebug::getIdentityString(func.getFunction()) and
message =
operand.getUse().toString() + " " + "Operand has " + locationCount.toString() +
" memory accesses in function '$@': " +
strictconcat(Alias::getOperandMemoryLocation(operand).toString(), ", ")
)
}
/**
* Holds if a `MemoryLocation` does not have an associated `VirtualVariable`.
*/
query predicate missingVirtualVariableForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
not exists(location.getVirtualVariable()) and
func = location.getIRFunction() and
funcText = LanguageDebug::getIdentityString(func.getFunction()) and
message = "Memory location has no virtual variable in function '$@'."
}
/**
* Holds if a `MemoryLocation` is a member of more than one `VirtualVariable`.
*/
query predicate multipleVirtualVariablesForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
exists(int vvarCount |
vvarCount = strictcount(location.getVirtualVariable()) and
vvarCount > 1 and
func = location.getIRFunction() and
funcText = LanguageDebug::getIdentityString(func.getFunction()) and
message =
"Memory location has " + vvarCount.toString() + " virtual variables in function '$@': (" +
concat(Alias::VirtualVariable vvar |
vvar = location.getVirtualVariable()
|
vvar.toString(), ", "
) + ")."
)
}
}

View File

@@ -0,0 +1,3 @@
import semmle.code.cpp.ir.implementation.raw.IR as OldIR
import SimpleSSA as Alias
import semmle.code.cpp.ir.internal.IRCppLanguageDebug as LanguageDebug

View File

@@ -996,7 +996,7 @@ deprecated predicate canReuseSSAForMemoryResult = canReuseSsaForMemoryResult/1;
/**
* Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
* `DebugSSA` module, which is then imported by PrintSSA.
* `DebugSsa` module, which is then imported by PrintSSA.
*/
module DebugSsa {
import PhiInsertion
@@ -1063,62 +1063,6 @@ private module CachedForDebugging {
int maxValue() { result = 2147483647 }
}
module SsaConsistency {
/**
* Holds if a `MemoryOperand` has more than one `MemoryLocation` assigned by alias analysis.
*/
query predicate multipleOperandMemoryLocations(
OldIR::MemoryOperand operand, string message, OldIR::IRFunction func, string funcText
) {
exists(int locationCount |
locationCount = strictcount(Alias::getOperandMemoryLocation(operand)) and
locationCount > 1 and
func = operand.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction()) and
message =
operand.getUse().toString() + " " + "Operand has " + locationCount.toString() +
" memory accesses in function '$@': " +
strictconcat(Alias::getOperandMemoryLocation(operand).toString(), ", ")
)
}
/**
* Holds if a `MemoryLocation` does not have an associated `VirtualVariable`.
*/
query predicate missingVirtualVariableForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
not exists(location.getVirtualVariable()) and
func = location.getIRFunction() and
funcText = Language::getIdentityString(func.getFunction()) and
message = "Memory location has no virtual variable in function '$@'."
}
/**
* Holds if a `MemoryLocation` is a member of more than one `VirtualVariable`.
*/
query predicate multipleVirtualVariablesForMemoryLocation(
Alias::MemoryLocation location, string message, OldIR::IRFunction func, string funcText
) {
exists(int vvarCount |
vvarCount = strictcount(location.getVirtualVariable()) and
vvarCount > 1 and
func = location.getIRFunction() and
funcText = Language::getIdentityString(func.getFunction()) and
message =
"Memory location has " + vvarCount.toString() + " virtual variables in function '$@': (" +
concat(Alias::VirtualVariable vvar |
vvar = location.getVirtualVariable()
|
vvar.toString(), ", "
) + ")."
)
}
}
/** DEPRECATED: Alias for SsaConsistency */
deprecated module SSAConsistency = SsaConsistency;
/**
* Provides the portion of the parameterized IR interface that is used to construct the SSA stages
* of the IR. The raw stage of the IR does not expose these predicates.

View File

@@ -1,5 +1,4 @@
private import cpp
private import semmle.code.cpp.Print
private import semmle.code.cpp.ir.implementation.IRType
private import semmle.code.cpp.ir.implementation.raw.internal.IRConstruction::Raw as Raw
@@ -538,12 +537,14 @@ CppType getCanonicalOpaqueType(Type tag, int byteSize) {
}
/**
* Gets a string that uniquely identifies an `IROpaqueType` tag. This may be different from the usual
* `toString()` of the tag in order to ensure uniqueness.
* Gets a string that uniquely identifies an `IROpaqueType` tag. Using `toString` here might
* not be sufficient to ensure uniqueness, but suffices for our current debugging purposes.
* To ensure uniqueness `getOpaqueTagIdentityString` from `semmle.code.cpp.Print` could be used,
* but that comes at the cost of importing all the `Dump` classes defined in that library.
*/
string getOpaqueTagIdentityString(Type tag) {
hasOpaqueType(tag, _) and
result = getTypeIdentityString(tag)
result = tag.toString()
}
module LanguageTypeConsistency {

View File

@@ -1,5 +1,4 @@
private import cpp as Cpp
private import semmle.code.cpp.Print as Print
private import IRUtilities
private import semmle.code.cpp.ir.implementation.IRType
private import semmle.code.cpp.ir.implementation.raw.internal.IRConstruction as IRConstruction
@@ -65,8 +64,6 @@ class Expr = Cpp::Expr;
class Class = Cpp::Class; // Used for inheritance conversions
predicate getIdentityString = Print::getIdentityString/1;
predicate hasCaseEdge(string minValue, string maxValue) { hasCaseEdge(_, minValue, maxValue) }
predicate hasPositionalArgIndex(int argIndex) {

View File

@@ -0,0 +1,3 @@
private import semmle.code.cpp.Print as Print
predicate getIdentityString = Print::getIdentityString/1;

View File

@@ -5,9 +5,9 @@
private import cpp
private import semmle.code.cpp.ir.IR
private import experimental.semmle.code.cpp.semantic.SemanticBound
private import experimental.semmle.code.cpp.semantic.SemanticExprSpecific
private import RangeAnalysis
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticBound
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticExprSpecific
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.RangeAnalysis
/**
* Gets the lower bound of the expression.

View File

@@ -5,6 +5,7 @@
private import SemanticExpr
private import SemanticExprSpecific::SemanticExprConfig as Specific
private import SemanticSSA
private import SemanticLocation
/**
* A valid base for an expression bound.
@@ -14,6 +15,8 @@ private import SemanticSSA
class SemBound instanceof Specific::Bound {
final string toString() { result = super.toString() }
final SemLocation getLocation() { result = super.getLocation() }
final SemExpr getExpr(int delta) { result = Specific::getBoundExpr(this, delta) }
}

View File

@@ -5,19 +5,99 @@
private import cpp as Cpp
private import semmle.code.cpp.ir.IR as IR
private import Semantic
private import experimental.semmle.code.cpp.rangeanalysis.Bound as IRBound
private import analysis.Bound as IRBound
private import semmle.code.cpp.controlflow.IRGuards as IRGuards
private import semmle.code.cpp.ir.ValueNumbering
module SemanticExprConfig {
class Location = Cpp::Location;
class Expr = IR::Instruction;
/** A `ConvertInstruction` or a `CopyValueInstruction`. */
private class Conversion extends IR::UnaryInstruction {
Conversion() {
this instanceof IR::CopyValueInstruction
or
this instanceof IR::ConvertInstruction
}
/** Holds if this instruction converts a value of type `tFrom` to a value of type `tTo`. */
predicate converts(SemType tFrom, SemType tTo) {
tFrom = getSemanticType(this.getUnary().getResultIRType()) and
tTo = getSemanticType(this.getResultIRType())
}
}
/**
* Gets a conversion-like instruction that consumes `op`, and
* which is guaranteed to not overflow.
*/
private IR::Instruction safeConversion(IR::Operand op) {
exists(Conversion conv, SemType tFrom, SemType tTo |
conv.converts(tFrom, tTo) and
conversionCannotOverflow(tFrom, tTo) and
conv.getUnaryOperand() = op and
result = conv
)
}
/** Holds if `i1 = i2` or if `i2` is a safe conversion that consumes `i1`. */
private predicate idOrSafeConversion(IR::Instruction i1, IR::Instruction i2) {
not i1.getResultIRType() instanceof IR::IRVoidType and
(
i1 = i2
or
i2 = safeConversion(i1.getAUse()) and
i1.getBlock() = i2.getBlock()
)
}
module Equiv = QlBuiltins::EquivalenceRelation<IR::Instruction, idOrSafeConversion/2>;
/**
* The expressions on which we perform range analysis.
*/
class Expr extends Equiv::EquivalenceClass {
/** Gets the n'th instruction in this equivalence class. */
private IR::Instruction getInstruction(int n) {
result =
rank[n + 1](IR::Instruction instr, int i, IR::IRBlock block |
this = Equiv::getEquivalenceClass(instr) and block.getInstruction(i) = instr
|
instr order by i
)
}
/** Gets a textual representation of this element. */
string toString() { result = this.getUnconverted().toString() }
/** Gets the basic block of this expression. */
IR::IRBlock getBlock() { result = this.getUnconverted().getBlock() }
/** Gets the unconverted instruction associated with this expression. */
IR::Instruction getUnconverted() { result = this.getInstruction(0) }
/**
* Gets the final instruction associated with this expression. This
* represents the result after applying all the safe conversions.
*/
IR::Instruction getConverted() {
exists(int n |
result = this.getInstruction(n) and
not exists(this.getInstruction(n + 1))
)
}
/** Gets the type of the result produced by this instruction. */
IR::IRType getResultIRType() { result = this.getConverted().getResultIRType() }
/** Gets the location of the source code for this expression. */
Location getLocation() { result = this.getUnconverted().getLocation() }
}
SemBasicBlock getExprBasicBlock(Expr e) { result = getSemanticBasicBlock(e.getBlock()) }
private predicate anyConstantExpr(Expr expr, SemType type, string value) {
exists(IR::ConstantInstruction instr | instr = expr |
exists(IR::ConstantInstruction instr | getSemanticExpr(instr) = expr |
type = getSemanticType(instr.getResultIRType()) and
value = instr.getValue()
)
@@ -58,41 +138,46 @@ module SemanticExprConfig {
predicate nullLiteral(Expr expr, SemAddressType type) { anyConstantExpr(expr, type, _) }
predicate stringLiteral(Expr expr, SemType type, string value) {
anyConstantExpr(expr, type, value) and expr instanceof IR::StringConstantInstruction
anyConstantExpr(expr, type, value) and
expr.getUnconverted() instanceof IR::StringConstantInstruction
}
predicate binaryExpr(Expr expr, Opcode opcode, SemType type, Expr leftOperand, Expr rightOperand) {
exists(IR::BinaryInstruction instr | instr = expr |
exists(IR::BinaryInstruction instr |
instr = expr.getUnconverted() and
type = getSemanticType(instr.getResultIRType()) and
leftOperand = instr.getLeft() and
rightOperand = instr.getRight() and
leftOperand = getSemanticExpr(instr.getLeft()) and
rightOperand = getSemanticExpr(instr.getRight()) and
// REVIEW: Merge the two `Opcode` types.
opcode.toString() = instr.getOpcode().toString()
)
}
predicate unaryExpr(Expr expr, Opcode opcode, SemType type, Expr operand) {
type = getSemanticType(expr.getResultIRType()) and
(
exists(IR::UnaryInstruction instr | instr = expr |
operand = instr.getUnary() and
// REVIEW: Merge the two operand types.
opcode.toString() = instr.getOpcode().toString()
)
or
exists(IR::StoreInstruction instr | instr = expr |
operand = instr.getSourceValue() and
opcode instanceof Opcode::Store
)
exists(IR::UnaryInstruction instr | instr = expr.getUnconverted() |
type = getSemanticType(instr.getResultIRType()) and
operand = getSemanticExpr(instr.getUnary()) and
// REVIEW: Merge the two operand types.
opcode.toString() = instr.getOpcode().toString()
)
or
exists(IR::StoreInstruction instr | instr = expr.getUnconverted() |
type = getSemanticType(instr.getResultIRType()) and
operand = getSemanticExpr(instr.getSourceValue()) and
opcode instanceof Opcode::Store
)
}
predicate nullaryExpr(Expr expr, Opcode opcode, SemType type) {
type = getSemanticType(expr.getResultIRType()) and
(
expr instanceof IR::LoadInstruction and opcode instanceof Opcode::Load
or
expr instanceof IR::InitializeParameterInstruction and
exists(IR::LoadInstruction load |
load = expr.getUnconverted() and
type = getSemanticType(load.getResultIRType()) and
opcode instanceof Opcode::Load
)
or
exists(IR::InitializeParameterInstruction init |
init = expr.getUnconverted() and
type = getSemanticType(init.getResultIRType()) and
opcode instanceof Opcode::InitializeParameter
)
}
@@ -122,8 +207,10 @@ module SemanticExprConfig {
newtype TSsaVariable =
TSsaInstruction(IR::Instruction instr) { instr.hasMemoryResult() } or
TSsaOperand(IR::Operand op) { op.isDefinitionInexact() } or
TSsaPointerArithmeticGuard(IR::PointerArithmeticInstruction instr) {
exists(Guard g, IR::Operand use | use = instr.getAUse() |
TSsaPointerArithmeticGuard(ValueNumber instr) {
exists(Guard g, IR::Operand use |
use = instr.getAUse() and use.getIRType() instanceof IR::IRAddressType
|
g.comparesLt(use, _, _, _, _) or
g.comparesLt(_, use, _, _, _) or
g.comparesEq(use, _, _, _, _) or
@@ -138,7 +225,7 @@ module SemanticExprConfig {
IR::Instruction asInstruction() { none() }
IR::PointerArithmeticInstruction asPointerArithGuard() { none() }
ValueNumber asPointerArithGuard() { none() }
IR::Operand asOperand() { none() }
}
@@ -156,15 +243,15 @@ module SemanticExprConfig {
}
class SsaPointerArithmeticGuard extends SsaVariable, TSsaPointerArithmeticGuard {
IR::PointerArithmeticInstruction instr;
ValueNumber vn;
SsaPointerArithmeticGuard() { this = TSsaPointerArithmeticGuard(instr) }
SsaPointerArithmeticGuard() { this = TSsaPointerArithmeticGuard(vn) }
final override string toString() { result = instr.toString() }
final override string toString() { result = vn.toString() }
final override Location getLocation() { result = instr.getLocation() }
final override Location getLocation() { result = vn.getLocation() }
final override IR::PointerArithmeticInstruction asPointerArithGuard() { result = instr }
final override ValueNumber asPointerArithGuard() { result = vn }
}
class SsaOperand extends SsaVariable, TSsaOperand {
@@ -179,7 +266,9 @@ module SemanticExprConfig {
final override IR::Operand asOperand() { result = op }
}
predicate explicitUpdate(SsaVariable v, Expr sourceExpr) { v.asInstruction() = sourceExpr }
predicate explicitUpdate(SsaVariable v, Expr sourceExpr) {
getSemanticExpr(v.asInstruction()) = sourceExpr
}
predicate phi(SsaVariable v) { v.asInstruction() instanceof IR::PhiInstruction }
@@ -192,9 +281,9 @@ module SemanticExprConfig {
}
Expr getAUse(SsaVariable v) {
result.(IR::LoadInstruction).getSourceValue() = v.asInstruction()
result.getUnconverted().(IR::LoadInstruction).getSourceValue() = v.asInstruction()
or
result = valueNumber(v.asPointerArithGuard()).getAnInstruction()
result.getUnconverted() = v.asPointerArithGuard().getAnInstruction()
}
SemType getSsaVariableType(SsaVariable v) {
@@ -236,7 +325,7 @@ module SemanticExprConfig {
final override predicate hasRead(SsaVariable v) {
exists(IR::Operand operand |
operand.getDef() = v.asInstruction() or
operand.getDef() = valueNumber(v.asPointerArithGuard()).getAnInstruction()
operand.getDef() = v.asPointerArithGuard().getAnInstruction()
|
not operand instanceof IR::PhiInputOperand and
operand.getUse().getBlock() = block
@@ -257,7 +346,7 @@ module SemanticExprConfig {
final override predicate hasRead(SsaVariable v) {
exists(IR::PhiInputOperand operand |
operand.getDef() = v.asInstruction() or
operand.getDef() = valueNumber(v.asPointerArithGuard()).getAnInstruction()
operand.getDef() = v.asPointerArithGuard().getAnInstruction()
|
operand.getPredecessorBlock() = pred and
operand.getUse().getBlock() = succ
@@ -303,17 +392,21 @@ module SemanticExprConfig {
}
Expr getBoundExpr(Bound bound, int delta) {
result = bound.(IRBound::Bound).getInstruction(delta)
result = getSemanticExpr(bound.(IRBound::Bound).getInstruction(delta))
}
class Guard = IRGuards::IRGuardCondition;
predicate guard(Guard guard, BasicBlock block) { block = guard.getBlock() }
Expr getGuardAsExpr(Guard guard) { result = guard }
Expr getGuardAsExpr(Guard guard) { result = getSemanticExpr(guard) }
predicate equalityGuard(Guard guard, Expr e1, Expr e2, boolean polarity) {
guard.comparesEq(e1.getAUse(), e2.getAUse(), 0, true, polarity)
exists(IR::Instruction left, IR::Instruction right |
getSemanticExpr(left) = e1 and
getSemanticExpr(right) = e2 and
guard.comparesEq(left.getAUse(), right.getAUse(), 0, true, polarity)
)
}
predicate guardDirectlyControlsBlock(Guard guard, BasicBlock controlled, boolean branch) {
@@ -324,16 +417,17 @@ module SemanticExprConfig {
guard.controlsEdge(bb1, bb2, branch)
}
Guard comparisonGuard(Expr e) { result = e }
Guard comparisonGuard(Expr e) { getSemanticExpr(result) = e }
predicate implies_v2(Guard g1, boolean b1, Guard g2, boolean b2) {
none() // TODO
}
/** Gets the expression associated with `instr`. */
SemExpr getSemanticExpr(IR::Instruction instr) { result = Equiv::getEquivalenceClass(instr) }
}
SemExpr getSemanticExpr(IR::Instruction instr) { result = instr }
IR::Instruction getCppInstruction(SemExpr e) { e = result }
predicate getSemanticExpr = SemanticExprConfig::getSemanticExpr/1;
SemBasicBlock getSemanticBasicBlock(IR::IRBlock block) { result = block }

View File

@@ -0,0 +1,23 @@
private import semmle.code.cpp.Location
class SemLocation instanceof Location {
/**
* Gets a textual representation of this element.
*
* The format is "file://filePath:startLine:startColumn:endLine:endColumn".
*/
string toString() { result = super.toString() }
/**
* Holds if this element is at the specified location.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `filepath`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}

View File

@@ -250,16 +250,26 @@ SemType getSemanticType(Specific::Type type) {
Specific::unknownType(type) and result = TSemUnknownType()
}
private class SemNumericOrBooleanType extends SemSizedType {
SemNumericOrBooleanType() {
this instanceof SemNumericType
or
this instanceof SemBooleanType
}
}
/**
* Holds if the conversion from `fromType` to `toType` can never overflow or underflow.
*/
predicate conversionCannotOverflow(SemNumericType fromType, SemNumericType toType) {
predicate conversionCannotOverflow(SemNumericOrBooleanType fromType, SemNumericOrBooleanType toType) {
// Identity cast
fromType = toType
or
// Treat any cast to an FP type as safe. It can lose precision, but not overflow.
toType instanceof SemFloatingPointType and fromType = any(SemNumericType n)
or
fromType instanceof SemBooleanType and toType instanceof SemIntegerType
or
exists(SemIntegerType fromInteger, SemIntegerType toInteger, int fromSize, int toSize |
fromInteger = fromType and
toInteger = toType and

View File

@@ -0,0 +1,86 @@
import cpp
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.ir.ValueNumbering
private newtype TBound =
TBoundZero() or
TBoundValueNumber(ValueNumber vn) {
exists(Instruction i |
vn.getAnInstruction() = i and
(
i.getResultIRType() instanceof IRIntegerType or
i.getResultIRType() instanceof IRAddressType
) and
not vn.getAnInstruction() instanceof ConstantInstruction
|
i instanceof PhiInstruction
or
i instanceof InitializeParameterInstruction
or
i instanceof CallInstruction
or
i instanceof VariableAddressInstruction
or
i instanceof FieldAddressInstruction
or
i.(LoadInstruction).getSourceAddress() instanceof VariableAddressInstruction
or
i.(LoadInstruction).getSourceAddress() instanceof FieldAddressInstruction
or
i.getAUse() instanceof ArgumentOperand
or
i instanceof PointerArithmeticInstruction
or
i.getAUse() instanceof AddressOperand
)
}
/**
* A bound that may be inferred for an expression plus/minus an integer delta.
*/
abstract class Bound extends TBound {
abstract string toString();
/** Gets an expression that equals this bound plus `delta`. */
abstract Instruction getInstruction(int delta);
/** Gets an expression that equals this bound. */
Instruction getInstruction() { result = getInstruction(0) }
abstract Location getLocation();
}
/**
* The bound that corresponds to the integer 0. This is used to represent all
* integer bounds as bounds are always accompanied by an added integer delta.
*/
class ZeroBound extends Bound, TBoundZero {
override string toString() { result = "0" }
override Instruction getInstruction(int delta) {
result.(ConstantValueInstruction).getValue().toInt() = delta
}
override Location getLocation() { result instanceof UnknownDefaultLocation }
}
/**
* A bound corresponding to the value of an `Instruction`.
*/
class ValueNumberBound extends Bound, TBoundValueNumber {
ValueNumber vn;
ValueNumberBound() { this = TBoundValueNumber(vn) }
/** Gets an `Instruction` that equals this bound. */
override Instruction getInstruction(int delta) {
this = TBoundValueNumber(valueNumber(result)) and delta = 0
}
override string toString() { result = "ValueNumberBound" }
override Location getLocation() { result = vn.getLocation() }
/** Gets the value number that equals this bound. */
ValueNumber getValueNumber() { result = vn }
}

View File

@@ -2,7 +2,7 @@
* Simple constant analysis using the Semantic interface.
*/
private import experimental.semmle.code.cpp.semantic.Semantic
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
private import ConstantAnalysisSpecific as Specific
/** An expression that always has the same integer value. */

View File

@@ -2,7 +2,7 @@
* C++-specific implementation of constant analysis.
*/
private import experimental.semmle.code.cpp.semantic.Semantic
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
/**
* Gets the constant integer value of the specified expression, if any.

View File

@@ -0,0 +1,20 @@
private import RangeAnalysisStage
module FloatDelta implements DeltaSig {
class Delta = float;
bindingset[d]
bindingset[result]
float toFloat(Delta d) { result = d }
bindingset[d]
bindingset[result]
int toInt(Delta d) { result = d }
bindingset[n]
bindingset[result]
Delta fromInt(int n) { result = n }
bindingset[f]
Delta fromFloat(float f) { result = f }
}

View File

@@ -1,7 +1,7 @@
private import RangeAnalysisStage
module FloatDelta implements DeltaSig {
class Delta = float;
module IntDelta implements DeltaSig {
class Delta = int;
bindingset[d]
bindingset[result]

View File

@@ -11,7 +11,7 @@
*/
private import ModulusAnalysisSpecific::Private
private import experimental.semmle.code.cpp.semantic.Semantic
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
private import ConstantAnalysis
private import RangeUtils
private import RangeAnalysisStage

View File

@@ -2,7 +2,7 @@
* C++-specific implementation of modulus analysis.
*/
module Private {
private import experimental.semmle.code.cpp.semantic.Semantic
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
predicate ignoreExprModulus(SemExpr e) { none() }
}

View File

@@ -0,0 +1,2 @@
import RangeAnalysisImpl
import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticBound

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