Compare commits

..

4505 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
Asger F
940e492766 Merge pull request #12551 from github/release-prep/2.12.5
Release preparation for version 2.12.5
2023-03-17 11:23:25 +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
Jeroen Ketema
66b03dbd1d Apply suggestions from code review 2023-03-16 14:29:16 +01:00
Jeroen Ketema
e7079b35bc Apply suggestions from code review 2023-03-16 14:28:17 +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
github-actions[bot]
fe4d27e8cc Release preparation for version 2.12.5 2023-03-16 12:58:50 +00: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
Jeroen Ketema
8aa9207281 Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-16 10:28:44 +01:00
Tom Hvitved
a13b6ed230 Merge pull request #12536 from hvitved/dataflow/call-enclosing-callable-consistency-check
Data flow: Add consistency check for `DataFlowCall::getEnclosingCallable`
2023-03-16 10:19:42 +01:00
Geoffrey White
7feab09ea9 Swift: Specialize the additional taint step a bit more. 2023-03-16 08:57:31 +00:00
Rasmus Wriedt Larsen
b3a49ab143 Merge pull request #12467 from RasmusWL/kwargs-parameter-position-fixup
Python/Ruby: Use new parameter position for synthetic hash-splat instead
2023-03-16 09:52:46 +01:00
Mathias Vorreiter Pedersen
eec1e9ffcd C++: Fix change note. 2023-03-16 08:01:07 +00:00
Mathias Vorreiter Pedersen
7585a3862f Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-16 07:57:20 +00:00
Mathias Vorreiter Pedersen
58602927bd C++: Add change note. 2023-03-16 07:57:03 +00:00
Tom Hvitved
404ead8a18 Python: Update expected test output 2023-03-16 08:40:53 +01:00
Tom Hvitved
b3ef1e9372 C++: Update expected test output 2023-03-16 08:40:53 +01:00
Tom Hvitved
64f13fa08f C#: Exclude call inside static field initializers from consistency check 2023-03-16 08:40:53 +01:00
Tom Hvitved
9f798902bd Data flow: Add consistency check for DataFlowCall::getEnclosingCallable 2023-03-16 08:40:53 +01: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
Henry Mercer
720eed398b Merge pull request #12523 from github/henrymercer/polish-diagnostics
Polish diagnostic messages
2023-03-15 15:06:52 +00:00
Robert Marsh
45fdf69461 C++: add SemLocation so SemBound is copy-shareable 2023-03-15 10:38:47 -04:00
Mathias Vorreiter Pedersen
3376d2aa12 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-15 14:12:01 +00:00
Mathias Vorreiter Pedersen
dffde8f8b8 Merge pull request #12532 from MathiasVP/local-flow-for-getAdditionalFlowIntoCallNodeTerm
C++: Use local flow instead of GVN in `getAdditionalFlowIntoCallNodeTerm`
2023-03-15 14:10:49 +00:00
Mathias Vorreiter Pedersen
08419b77af C++: Respond to PR reviews. 2023-03-15 14:07:04 +00:00
Anders Schack-Mulligen
bc9942eb75 Merge pull request #12530 from aschackmull/java/refactor-dataflow-queries-3
Java: Refactor more dataflow queries to the new API (take 3)
2023-03-15 14:57:29 +01: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
Tom Hvitved
a6e9d111a5 Merge pull request #12534 from hvitved/swift/summary-call-encl-callable
Swift: Fix `SummaryCall::getEnclosingCallable`
2023-03-15 14:35:00 +01:00
Tom Hvitved
96639c594f Swift: Fix SummaryCall::getEnclosingCallable 2023-03-15 13:58:12 +01:00
Arthur Baars
fe34ec1378 Ruby: fix formatting errors 2023-03-15 13:45:06 +01:00
Henry Mercer
5de0eae992 Ruby: Update diagnostic source names for consistency 2023-03-15 12:05:09 +00:00
Henry Mercer
a90f4915a7 C#: Add new lines before call to action 2023-03-15 12:00:47 +00:00
Henry Mercer
0de4259bff Revert "Ruby: Use rb prefix in diagnostic IDs for consistency with queries"
This reverts commit a6509c7a37.
2023-03-15 12:00:47 +00:00
Tony Torralba
c5a1905302 Fix stubs 2023-03-15 12:43:45 +01:00
Anders Schack-Mulligen
ecf5591bc6 Merge pull request #12527 from aschackmull/java/remove-dataflow-for-serializability
Java: Delete `DataFlowForSerializability` and `DataFlowForOnActivityResult`
2023-03-15 12:37:17 +01:00
Mathias Vorreiter Pedersen
913ff201f1 Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into local-flow-for-getAdditionalFlowIntoCallNodeTerm 2023-03-15 11:15:16 +00:00
Mathias Vorreiter Pedersen
11932a54e8 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-15 11:13:49 +00:00
Tony Torralba
341590f9ad org.kohsuke.stapler.framework.io tests 2023-03-15 11:43:52 +01:00
Mathias Vorreiter Pedersen
9bd3347a3c C++: Remove import. 2023-03-15 10:33:47 +00: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
Mathias Vorreiter Pedersen
623f6ff701 C++: Move things around so that 'getAdditionalFlowIntoCallNodeTerm' is in the same stage as 'DataFlowImplCommon'. 2023-03-15 10:01:47 +00:00
Mathias Vorreiter Pedersen
deb43c21e6 C++: Use local flow instead of GVN to find parameters that are used in switch statements. 2023-03-15 10:00:47 +00:00
erik-krogh
2133d1a5ab Merge branch 'main' into more-shell-taint 2023-03-15 10:54:30 +01:00
Anders Schack-Mulligen
6408d7cbbe Java: Refactor RsaWithoutOaep. 2023-03-15 10:37:54 +01:00
Anders Schack-Mulligen
b3b5c2c767 Java: Refactor UnsafeContentUriResolution. 2023-03-15 10:32:58 +01:00
Anders Schack-Mulligen
4b814ec71c Java: Refactor SensitiveCommunication.ql. 2023-03-15 10:32:35 +01:00
Anders Schack-Mulligen
ca8e013618 Java: Refactor FragmentInjection. 2023-03-15 10:23:21 +01:00
erik-krogh
a72436f6f1 recognize more express URL related sources 2023-03-15 10:14:31 +01:00
Anders Schack-Mulligen
5bd530f570 Java: Refactor IntentUriPermissionManipulation. 2023-03-15 10:13:28 +01:00
Anders Schack-Mulligen
b14b95cd79 Java: Refactor LogInjection 2023-03-15 10:10:02 +01:00
Anders Schack-Mulligen
abf3abdc65 Java: Delete DataFlowForOnActivityResult. 2023-03-15 09:47:21 +01:00
Anders Schack-Mulligen
bea7c43584 Java: Delete DataFlowForSerializability 2023-03-15 09:42:02 +01:00
Anders Schack-Mulligen
e8a7139020 Merge pull request #12476 from aschackmull/java/refactor-dataflow-queries-2
Java: Refactor more dataflow queries to the new API
2023-03-15 09:40:32 +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
Arthur Baars
fbe9823a42 Merge branch 'main' into henrymercer/polish-diagnostics 2023-03-14 23:42:33 +01:00
Henry Mercer
1454890a58 C#: Add new paragraphs before call to action 2023-03-14 21:52:23 +00:00
Henry Mercer
1394abcf98 JS: Update diagnostics IDs for consistency with rules 2023-03-14 21:44:19 +00:00
Henry Mercer
1f63c5d5e4 JS: Update parse error diagnostic name for consistency 2023-03-14 21:43:32 +00:00
Robert Marsh
623e39031c C++: fix ModulusAnalysis test 2023-03-14 16:46:09 -04:00
Harry Maclean
604d5f0c71 Merge pull request #12510 from hmac/merge-ruby-extractor
Ruby: Merge extractor crates
2023-03-15 09:41:07 +13:00
Harry Maclean
fd43ba0827 Update .github/workflows/ruby-build.yml
Co-authored-by: Arthur Baars <aibaars@github.com>
2023-03-15 09:28:53 +13:00
Harry Maclean
6dcc884fe1 Ruby: Small doc change
This is primarily to bust the actions cache, to test a change in the
ruby-build workflow.
2023-03-15 08:42:24 +13:00
Harry Maclean
eefc4866ea Ruby: build query pack in temporary directory
This ensures we don't clobber any existing directories in the repo.
2023-03-15 08:20:23 +13:00
Harry Maclean
aaeb8a0aa0 Merge pull request #12493 from hmac/ar-sinks 2023-03-15 07:59:07 +13:00
Geoffrey White
959f93a766 Merge pull request #12520 from geoffw0/basetypefix
Swift: Fix result type of NominalType.getABaseType.
2023-03-14 18:23:54 +00:00
Geoffrey White
a391c01d36 Swift: Fix result type of NominalType.getABaseType. 2023-03-14 17:36:30 +00:00
Henry Mercer
bc106873c1 C#: Fix casing of "CodeQL Action" 2023-03-14 17:24:30 +00:00
Henry Mercer
7e4f77bfb3 C#: Only serialize the location if it is present 2023-03-14 17:23:00 +00: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
Henry Mercer
a6509c7a37 Ruby: Use rb prefix in diagnostic IDs for consistency with queries 2023-03-14 17:13:50 +00:00
Henry Mercer
769f9051af Ruby: Serialize severities as lowercase 2023-03-14 17:09:25 +00:00
Henry Mercer
6fbc8261f2 Java: Add a full stop 2023-03-14 17:03:42 +00:00
Henry Mercer
770924455e Java: Use Dotcom help links 2023-03-14 17:00:48 +00:00
Henry Mercer
ce96f009b7 Java: Capitalise HTTPS 2023-03-14 16:58:24 +00:00
Henry Mercer
819e0dfbf0 Java: Use "relevant" instead of "suspicious" 2023-03-14 16:54:14 +00:00
Henry Mercer
110cb64b7a Java: Avoid reference to other diagnostics 2023-03-14 16:52:58 +00:00
Henry Mercer
4c329b7b62 Java: Remove "please" in diagnostics
Per review from docs team
2023-03-14 16:46:06 +00: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
Anders Schack-Mulligen
30163e4f60 Merge pull request #12515 from aschackmull/java/neutral-dispatch
Java: Remove low-confidence dispatch to known neutrals.
2023-03-14 15:35:05 +01:00
Tom Hvitved
c132891669 Merge pull request #12513 from hvitved/dataflow/lambda-flow-no-expects-content
Data flow: Exclude `expectsContent` nodes from lambda flow
2023-03-14 15:28:35 +01:00
Asger F
feb7c49006 Merge pull request #12382 from asgerf/js/import-assertion
JS: Support import assertions
2023-03-14 14:56:32 +01:00
Ian Lynagh
32e8b130ad Merge pull request #12501 from tamasvajk/java/javadoc_printast
Java: Fix printAST to handle javadoc belonging to multiple elements
2023-03-14 13:42:22 +00:00
Anders Schack-Mulligen
a9d2b936af Java: Add qldoc. 2023-03-14 14:15:15 +01: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
Asger F
d953ad63fe Merge pull request #12445 from asgerf/js/react-forward-ref
JS: Handle forwardRef in React
2023-03-14 13:21:16 +01:00
Asger F
d74da30fc7 JS: Include trap test for trailing commas 2023-03-14 13:15:12 +01:00
Asger F
8ab3f39b5e Merge pull request #12423 from asgerf/js/trusted-types-global-flow
JS: Track trusted types policy callbacks
2023-03-14 13:09:50 +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
Paolo Tranquilli
5ff7a898a6 Merge pull request #12516 from github/redsun82/swift-specialize-generic-decl
Swift: make `AnyGenericType::getDecl`'s type more specific
2023-03-14 12:23:02 +01:00
Tony Torralba
d54abddab1 java.nio.file tests 2023-03-14 12:22:56 +01:00
AlexDenisov
decd5c1ae7 Merge pull request #12508 from github/redsun82/swift-deduplication-test
Swift: add an initial draft for a deduplication test
2023-03-14 11:56:23 +01:00
Tony Torralba
2e7ad99059 Fix java.nio.file models 2023-03-14 11:51:44 +01:00
Paolo Tranquilli
54b6c6f8f7 Swift: make AnyGenericType::getDecl's type more specific
As shown by the extractor's code not needing any change, the DB values
already had that more specific type, which is why the upgrade/downgrade
scripts are actually no-ops.
2023-03-14 11:49:07 +01:00
Tony Torralba
452b9d11db java.net tests 2023-03-14 11:43:23 +01:00
Anders Schack-Mulligen
dbfc256f40 Java: Remove low-confidence dispatch to known neutrals. 2023-03-14 11:34:07 +01:00
Paolo Tranquilli
91ce88e2d9 Swift: make deduplication test cross-platform 2023-03-14 11:24:03 +01:00
Edward Minnix III
de1ecf943e Merge pull request #11915 from egregius313/egregius313/arbitrary-apk-installation
Java: Arbitrary APK installation
2023-03-14 06:23:51 -04:00
Paolo Tranquilli
cc608f764d Swift: add missing include 2023-03-14 11:23:33 +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
Tony Torralba
dd0723c36b Merge pull request #12511 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-14 10:05:32 +01:00
Tom Hvitved
bdd56f1b6e Data flow: Sync files 2023-03-14 10:01:56 +01:00
Tom Hvitved
8dd99b951b Data flow: Exclude expectsContent nodes from lambda flow 2023-03-14 10:01:11 +01:00
erik-krogh
984a589954 don't depend on the callgraph in KernelArraySummary 2023-03-14 09:20:24 +01:00
Tom Hvitved
08557974ae Merge pull request #12499 from hvitved/ruby/more-constructor-flow
Ruby: Add missing flow through `self.new` constructor calls
2023-03-14 09:14:42 +01:00
erik-krogh
4307889b1f specialize allowImplicitRead in unsafe-shell-command-construction to fix performance 2023-03-14 08:42:11 +01:00
Erik Krogh Kristensen
04f422ea5d Merge pull request #12047 from erik-krogh/py-shell
Py: add unsafe-shell-command-construction
2023-03-14 07:48:38 +01:00
Harry Maclean
999b12f78b Ruby: better errors in generator
Provide more context if a file cannot be opened by the generator.
2023-03-14 18:12:01 +13:00
Harry Maclean
7ee7a0df34 Ruby: fix prefix in create-extractor-pack scripts 2023-03-14 18:12:01 +13:00
github-actions[bot]
2c93ab99d8 Add changed framework coverage reports 2023-03-14 00:15:57 +00:00
Harry Maclean
d814e15a2f Ruby: Refactor 2023-03-14 12:58:32 +13:00
Harry Maclean
f19e48d473 Ruby: Update binary prefixes in build 2023-03-14 12:53:37 +13:00
Harry Maclean
4de31e8577 Ruby: Ensure right directory for extractor build 2023-03-14 12:40:37 +13:00
Harry Maclean
f3272239bd Ruby: Format rust files 2023-03-14 12:31:50 +13:00
Harry Maclean
cd9927cf66 Ruby: Update create-extractor-pack 2023-03-14 12:23:09 +13:00
Harry Maclean
0e5dcddb98 Ruby: Fix cargo fmt step in build 2023-03-14 12:17:04 +13:00
Harry Maclean
5c59692b3a Ruby: Update workflow for new extractor location 2023-03-14 12:10:56 +13:00
Harry Maclean
e070bd512e Ruby: Move some support files to new extractor 2023-03-14 12:07:39 +13:00
Harry Maclean
194edd76e5 Ruby: Put all binaries in same directory 2023-03-14 12:03:46 +13:00
Harry Maclean
a7e276343e Ruby: Update .gitignore for moved extractor 2023-03-14 12:03:03 +13:00
Harry Maclean
f53c31398c Ruby: Fix imports in extractor 2023-03-14 12:02:11 +13:00
Harry Maclean
15bd825805 Ruby: finish reorganising extractor files 2023-03-14 11:49:18 +13:00
Harry Maclean
6f23111320 Ruby: Remove old Cargo.toml files 2023-03-14 11:47:21 +13:00
Harry Maclean
983b84276b Ruby: Lift extractor binaries 2023-03-14 11:45:46 +13:00
Harry Maclean
1a71c3f174 Ruby: Merge extractor crates
This just moves the files, so as not to confuse git when we make changes
to them.
2023-03-14 11:43:17 +13: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
Anders Schack-Mulligen
5792b4d363 Merge pull request #12503 from aschackmull/java/qltest-callback-instance-sideeffect
Java: Add a qltest demonstrating side-effect on a callback instance.
2023-03-13 17:26:12 +01:00
Mathias Vorreiter Pedersen
d96dbea7be Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-13 17:19:13 +01:00
Mathias Vorreiter Pedersen
136769d647 Merge pull request #12507 from MathiasVP/fix-as-expr-performance-2
C++: Map some indirect nodes to expressions in `localExprFlowStep`
2023-03-13 16:03:48 +00:00
Paolo Tranquilli
fcd14a78ab Swift: add an initial draft for a deduplication test 2023-03-13 15:55:45 +01:00
Mathias Vorreiter Pedersen
a5051655a1 C++: Autoformat. 2023-03-13 15:41:17 +01:00
Ian Lynagh
70b85a3e00 Merge pull request #12431 from igfoo/igfoo/double_interception
Kotlin: Test double interceptions
2023-03-13 14:30:49 +00: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
erik-krogh
6a5d6eb5c2 lower precision of py/shell-command-constructed-from-input to medium 2023-03-13 14:56:42 +01:00
erik-krogh
d001cc40d3 Merge branch 'main' into py-shell 2023-03-13 14:56:04 +01:00
Mathias Vorreiter Pedersen
00450d10bb Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-13 14:50:17 +01:00
Mathias Vorreiter Pedersen
58c1518fbd C++: Fix QLDoc. 2023-03-13 14:45:00 +01:00
Mathias Vorreiter Pedersen
97462a3fa0 C++: Include more expressions in 'asExpr' in local expression flow. 2023-03-13 14:29:11 +01:00
Tamas Vajk
c57fcfb8fb Java: Fix printAST to handle javadoc belonging to multiple elements 2023-03-13 14:26:33 +01:00
Stephan Brandauer
05b0cc2231 Update MaD Declarations after Triage 2023-03-13 14:21:29 +01:00
Tony Torralba
705691b096 Merge pull request #12446 from github/java/update-mad-decls-after-triage-2023-03-08T14-51-59
Java: Update MaD Declarations after Triage
2023-03-13 14:07:59 +01:00
Robert Marsh
64f23ebb4d Merge pull request #12436 from MathiasVP/ir-range-analysis-for-unary-minus
C++: IR-based range analysis for unary minus
2023-03-13 09:02:38 -04: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
Anders Schack-Mulligen
f54b02edb3 Java: Add a qltest demonstrating side-effect on a callback instance. 2023-03-13 13:22:18 +01:00
Anders Schack-Mulligen
0c95ab2cdc Merge pull request #12474 from hvitved/dataflow/call-back-post-update
Data flow: Synthesize post-update nodes for callback arguments inside summarized callables
2023-03-13 13:21:52 +01:00
Ian Lynagh
4fbc747f93 Kotlin: Move kotlin_double_interception test to posix_only
It's failing on Windows
2023-03-13 11:57:57 +00:00
Ian Lynagh
fd8f7e071b Kotlin: Tweak double_interception test 2023-03-13 11:57:57 +00:00
Ian Lynagh
fae4a8f37b Kotlin: double interception test: Fix for old python versions 2023-03-13 11:57:57 +00:00
Ian Lynagh
8b6047dfd1 Kotlin: Handle double-interceptions without failing 2023-03-13 11:57:57 +00:00
Ian Lynagh
81e71c4669 Kotlin: Add a test for double niterception 2023-03-13 11:57:57 +00:00
dependabot[bot]
6e75df4088 Merge pull request #12494 from github/dependabot/cargo/ruby/serde-1.0.155 2023-03-13 11:49:00 +00:00
Erik Krogh Kristensen
060c37b6a2 Merge pull request #12345 from erik-krogh/delOldDeps
delete old deprecations
2023-03-13 12:48:24 +01:00
Tom Hvitved
163bb2b94d Add change note 2023-03-13 12:45:46 +01:00
Tom Hvitved
714b61b63e Ruby: Add missing flow through self.new constructor calls 2023-03-13 12:45:46 +01:00
dependabot[bot]
219bac74bf Bump serde from 1.0.154 to 1.0.155 in /ruby
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.154 to 1.0.155.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.154...v1.0.155)

---
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-13 11:36:09 +00:00
dependabot[bot]
de84dddfc1 Merge pull request #12495 from github/dependabot/cargo/ql/serde-1.0.155 2023-03-13 11:32:03 +00:00
Arthur Baars
e0a49e2999 Merge pull request #12486 from aibaars/windows-long-paths
Ruby: support long paths on Windows
2023-03-13 12:18:50 +01:00
Tamas Vajk
e44aca0b33 Java: Add printAST test with javadoc 2023-03-13 12:02:50 +01:00
Arthur Baars
41a53ec109 Address comments 2023-03-13 11:50:03 +01:00
Geoffrey White
e4837f7da9 Merge pull request #12489 from geoffw0/typealiastests
Swift: Skeleton + tests for type alias support
2023-03-13 10:38:43 +00:00
Asger F
5461f94c6c Merge pull request #12424 from asgerf/js/html-sanitizer-for-sql
JS: Add html sanitizers as a taint step in a few queries
2023-03-13 11:36:19 +01:00
Asger F
41dd63adc7 Handle forwardRef in React 2023-03-13 11:30:18 +01:00
Anders Schack-Mulligen
7c0e89ffdd Java: Refactor ArithmeticTainted.ql, TempDirLocalInformationDisclosure.ql 2023-03-13 11:27:14 +01:00
Anders Schack-Mulligen
da273269cb Java: Refactor PolynomialReDoS.ql 2023-03-13 11:27:14 +01:00
Anders Schack-Mulligen
f53a05bf13 Merge pull request #12475 from aschackmull/dataflow/mergepathgraph
Dataflow: Add MergePathGraph module.
2023-03-13 11:26:24 +01:00
Jeroen Ketema
a0fca20f0d Merge pull request #12498 from jketema/frontend-tests
C++: Update `.expected` after frontend changes
2023-03-13 11:25:58 +01:00
Anders Schack-Mulligen
c380ecbbbc Data flow: Add change notes. 2023-03-13 11:09:13 +01:00
erik-krogh
6c1ebd999e Merge branch 'main' into delOldDeps 2023-03-13 11:00:29 +01:00
Erik Krogh Kristensen
25e6b976c8 Merge pull request #12405 from github/dependabot/cargo/ql/rayon-1.7.0
Bump rayon from 1.6.1 to 1.7.0 in /ql
2023-03-13 10:57:11 +01:00
Geoffrey White
7512d81331 Merge pull request #12484 from geoffw0/summarydetail
Swift: Update swift/summary/summary-statistics to DataFlow::ConfigSig
2023-03-13 09:54:54 +00:00
Tom Hvitved
6ee231fac5 Ruby: Add more tests for flow through constructors 2023-03-13 10:52:01 +01:00
Geoffrey White
0d1be2294c Merge branch 'main' into typealiastests 2023-03-13 09:38:54 +00:00
Geoffrey White
8d666d00c2 Swift: Update codegen. 2023-03-13 09:21:44 +00:00
Geoffrey White
9a5dbd078e Merge pull request #12485 from geoffw0/qldocraw
Swift: Add generated QLDoc to the Raw.qll file.
2023-03-13 09:10:55 +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
Jeroen Ketema
bd47c4f9ec C++: Update .expected after frontend changes 2023-03-13 09:40:10 +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
Tony Torralba
e834f9302e Fix Apache Commons HTTP Client and SQL Injection tests 2023-03-13 09:36:53 +01: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
Harry Maclean
9c3d141c9c Ruby: Add change note 2023-03-13 18:57:55 +13:00
dependabot[bot]
7ab3bb1239 Bump serde from 1.0.154 to 1.0.155 in /ql
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.154 to 1.0.155.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.154...v1.0.155)

---
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-13 04:10:45 +00:00
Harry Maclean
fe995dd99b Ruby: ActiveRecord::Connection.execute SQL sink 2023-03-13 09:03:54 +13:00
Harry Maclean
025cd34dab Ruby: Taint flow through ActionController params
We were not recognising "require" as returning a Parameters instance.
2023-03-13 08:52:41 +13:00
Harry Maclean
2d95b6a049 Ruby: Add count_by_sql as SQL sink 2023-03-13 08:40:32 +13:00
Harry Maclean
c97dccf0de Ruby: Add reorder as a SQL sink
In recent versions of Rails this method doesn't seem to be vulnerable,
but it may be in previous versions. There's a slight FP risk here, but
I think it is small.
2023-03-13 08:38:17 +13:00
Mathias Vorreiter Pedersen
ab58d4c11f Merge pull request #12415 from github/rdmarsh2/swift/constructor-flow 2023-03-10 23:16:37 +00:00
Arthur Baars
c67bfff33b Ruby: strip \\?\ from display paths 2023-03-10 22:32:11 +01:00
Arthur Baars
4bfcc31ef0 Ruby: support long paths on Windows 2023-03-10 22:32:11 +01:00
Ed Minnix
59eea2a4a3 Change FlowState classes to use IPAs instead of string 2023-03-10 15:24:04 -05:00
Ed Minnix
b6eeac5bc8 Update names to new naming convention 2023-03-10 15:13:58 -05:00
Robert Marsh
d9732361fc Swift: autoformat 2023-03-10 19:28:01 +00:00
Robert Marsh
d4e3f7f738 C++: fix missing bounds in new range analysis 2023-03-10 14:23:08 -05:00
Geoffrey White
fbde174a89 Swift: Autoformat. 2023-03-10 19:02:54 +00:00
Arthur Baars
50ff82fe51 Merge pull request #12482 from github/revert-12245-calumgrant/codeowners-dynamic
Revert "Update CODEOWNERS for dynamic teams"
2023-03-10 19:44:12 +01:00
Geoffrey White
7ddd08fb1e Swift: Extend an extractor test as well. 2023-03-10 18:35:03 +00:00
Geoffrey White
f6e7837cb8 Swift: Extend the PrintAST test as well. 2023-03-10 18:28:11 +00:00
Geoffrey White
0c900e4b8a Swift: Add a test for aliased types. 2023-03-10 18:26:48 +00:00
Mathias Vorreiter Pedersen
d4269251be Swift: Add QL skeleton for aliased types. 2023-03-10 18:15:40 +00:00
Arthur Baars
7b8ac609f7 Merge pull request #12478 from aibaars/js-fix-npe
JS: fix NPE
2023-03-10 18:49:46 +01:00
Geoffrey White
c2f6ee320f Swift: Add QLDoc to the Raw.qll file. 2023-03-10 17:43:30 +00:00
Robert Marsh
e931d59bea Merge pull request #12479 from jketema/simple-range-analysis-wrapper
C++: Introduce wrapper for the semantic range analysis mimicking the simple one
2023-03-10 10:01:28 -05:00
Edward Minnix III
e2acc26419 Apply docs review suggestions
- Punctuation
- Rewording

Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-10 09:47:47 -05:00
Calum Grant
1b2ba15753 Revert "Update CODEOWNERS for dynamic teams" 2023-03-10 14:39:22 +00:00
Geoffrey White
7bd0f53df9 Swift: Update swift/summary/summary-statistics to DataFlow::ConfigSig. 2023-03-10 14:39:03 +00:00
Taus
998827f491 Merge pull request #12481 from aschackmull/all/autoformat-ignore-blame
Ignore auto-format commits in git blame.
2023-03-10 15:36:04 +01:00
Owen Mansel-Chan
286a56c9b3 Merge pull request #12450 from owen-mc/unexpected-directory-layout
Diagnostic for imports with relative package paths
2023-03-10 14:35:02 +00:00
Anders Schack-Mulligen
1e64748ffe Dataflow: Autoformat. 2023-03-10 15:12:19 +01:00
Anders Schack-Mulligen
955cc5a1be Ignore auto-format commits in git blame. 2023-03-10 15:08:49 +01:00
Anders Schack-Mulligen
289f921171 Dataflow: Sync. 2023-03-10 14:56:54 +01:00
Anders Schack-Mulligen
a836444bc6 Dataflow: Add some qldoc. 2023-03-10 14:56:54 +01:00
Anders Schack-Mulligen
00f0879ff5 Dataflow: Sync. 2023-03-10 14:56:54 +01:00
Anders Schack-Mulligen
cce3728edf Dataflow: Add MergePathGraph module. 2023-03-10 14:56:54 +01:00
Anders Schack-Mulligen
52e4076684 Merge pull request #12427 from aschackmull/java/refactor-dataflow-queries-1
Java: Refactor some dataflow queries to the new API
2023-03-10 14:40:14 +01:00
Jeroen Ketema
faecf44870 C++: Add predicate implementations we get for free from simple range analysis 2023-03-10 14:31:15 +01:00
Geoffrey White
7f06109a4f Swift: Add detail to the swift/summary/summary-statistics query. 2023-03-10 13:20:25 +00:00
Jeroen Ketema
0e45c9982b C++: Introduce wrapper for the semantic range analysis mimicking the simple one 2023-03-10 13:30:24 +01:00
Owen Mansel-Chan
674799af8c Implement diagnostic for relative package paths 2023-03-10 12:20:44 +00:00
Owen Mansel-Chan
d6712b2111 Add test for unexpected directory layout error 2023-03-10 12:20:43 +00:00
Arthur Baars
1a70297662 JS: fix NPE 2023-03-10 12:52:41 +01:00
Tom Hvitved
32a699e34a Data flow: Sync files 2023-03-10 12:43:21 +01:00
Tom Hvitved
6eea906bbf Data flow: Synthesize post-update nodes for callback arguments inside summarized callables 2023-03-10 12:43:21 +01:00
Anders Schack-Mulligen
64dd8b9488 Merge branch 'main' into java/refactor-dataflow-queries-1 2023-03-10 12:38:06 +01:00
Tony Torralba
746c2d1fca Add change note 2023-03-10 12:35:14 +01:00
Tony Torralba
f07f0888aa Fix tests 2023-03-10 12:35:13 +01:00
Tony Torralba
393a0759db More stubs 2023-03-10 12:35:13 +01:00
Tony Torralba
8aa80882ea Sync files 2023-03-10 12:35:13 +01:00
Tony Torralba
8065714ebe Add tests 2023-03-10 12:35:13 +01:00
Tony Torralba
eef3dc81df Add stubs 2023-03-10 12:35:13 +01:00
Tony Torralba
698dfa46fc Minor fixes to the models 2023-03-10 12:35:13 +01:00
Tony Torralba
77d9bac52d Support ai-generated summaries 2023-03-10 12:35:13 +01:00
Stephan Brandauer
0c19da926c Update MaD Declarations after Triage 2023-03-10 12:35:13 +01:00
Anders Schack-Mulligen
83569911ae Merge pull request #12230 from aschackmull/all/autoformat
Mass autoformat with class and module declarations format fix
2023-03-10 12:29:34 +01:00
Tony Torralba
ec7e486a3b Swift: update generated files' hashes 2023-03-10 11:10:34 +01:00
Anders Schack-Mulligen
159d8e978c Dataflow: one more autoformat post rebase 2023-03-10 10:04:35 +01:00
Harry Maclean
4a6bceccf5 Merge pull request #7017 from github/nickrolfe/extractor_options
Ruby: expose TRAP compression option
2023-03-10 21:46:53 +13:00
Anders Schack-Mulligen
3640b6d3a8 Shared: Autoformat 2023-03-10 09:41:20 +01:00
Anders Schack-Mulligen
711d7057f7 Swift: Autoformat 2023-03-10 09:41:20 +01:00
Anders Schack-Mulligen
08c658e66b Go: Autoformat 2023-03-10 09:41:20 +01:00
Anders Schack-Mulligen
a5d229903d Ruby: Autoformat 2023-03-10 09:41:20 +01:00
Anders Schack-Mulligen
8d97fe9ed3 JavaScript: Autoformat 2023-03-10 09:41:20 +01:00
Anders Schack-Mulligen
21d5fa836b Python: Autoformat 2023-03-10 09:41:17 +01:00
Anders Schack-Mulligen
ef97e539ec C/C++: Autoformat 2023-03-10 09:39:41 +01:00
Anders Schack-Mulligen
5ad7ed49dd C#: Autoformat 2023-03-10 09:39:41 +01:00
Anders Schack-Mulligen
730eae9521 Java: Autoformat 2023-03-10 09:39:41 +01:00
Harry Maclean
9cf2acface Ruby: Make trap option title consistent with C# 2023-03-10 21:11:58 +13:00
Harry Maclean
cf64e0e85f Ruby: trap_compression -> trap.compression
Change the trap_compression extractor option to be an object `trap` with
a nested option `compression`. This means that on the command line you
would supply the option as follows:

    codeql database create --extractor-option trap.compression=gzip

This is a little less jarring than the previous design, which would use
underscores amonst the hyphens:

    codeql database create --extractor-option trap_compression=gzip
2023-03-10 19:18:49 +13:00
Nick Rolfe
7649772935 Expose TRAP compression option via the new extractor options feature. 2023-03-10 19:09:51 +13:00
Arthur Baars
348165205c Merge pull request #12442 from aibaars/diagnostics-tests
Ruby: add some integration tests for diagnostic messages
2023-03-09 21:58:42 +01:00
Henry Mercer
a816b813d1 Merge pull request #12470 from github/codeql-ci/atm/release-0.4.9
JS: Bump version numbers of ML-powered packs after 0.4.9 release
2023-03-09 18:40:31 +00:00
Mathias Vorreiter Pedersen
d25a312557 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-09 18:38:00 +00:00
Mathias Vorreiter Pedersen
d89b8ba446 Merge pull request #12469 from MathiasVP/speedup-CleartextSqliteDatabase
C++: Restrict sinks in `cpp/cleartext-storage-database`
2023-03-09 18:33:51 +00:00
Michael B. Gale
d627358f7e Merge pull request #12453 from github/mbg/csharp/fix-env-prop 2023-03-09 17:55:48 +00: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
Henry Mercer
079451142e Merge branch 'main' into codeql-ci/atm/release-0.4.9 2023-03-09 16:08:22 +00:00
Jeroen Ketema
67a07e98a2 Merge pull request #12339 from jketema/new-docs
C++: Add copy of dataflow docs for new use-use dataflow library
2023-03-09 16:56:43 +01:00
yoff
b3fa844322 Merge pull request #12461 from yoff/python/add-api-test-captured
python: add test documenting effect of scopes
2023-03-09 16:55:27 +01:00
github-actions[bot]
a82aaea514 JS: Bump version of ML-powered library and query packs to 0.4.10 2023-03-09 15:54:49 +00:00
Jeroen Ketema
13483be5ed Merge pull request #12465 from jketema/get-a-use-2
C++: Use `getAUse` in `getIRRepresentationOfIndirectOperand`
2023-03-09 16:54:32 +01:00
Owen Mansel-Chan
250a0a71e1 Merge pull request #12466 from owen-mc/update-go-diagnostics
The source name of a diagnostic should not change
2023-03-09 15:51:32 +00:00
Edward Minnix III
3ee14f914b Merge pull request #50 from egregius313/egregius313/refactor-apk-query-using-dataflow-modules
Convert dataflow configurations in Arbitrary APK Installation query to use new module-configuration
2023-03-09 10:50:02 -05:00
github-actions[bot]
f0bb25bfce JS: Bump patch version of ML-powered library and query packs 2023-03-09 15:46:31 +00:00
Edward Minnix III
e8f1f364c5 Refactor to module api for PathNodes
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-09 10:45:55 -05:00
Ed Minnix
cb53ff70a6 Remove unused imports 2023-03-09 10:44:59 -05:00
Mathias Vorreiter Pedersen
84a61d1e02 C++: No need for 'matches'. 2023-03-09 15:36:26 +00:00
Mathias Vorreiter Pedersen
59402eb754 Merge pull request #12462 from MathiasVP/disable-std-order-in-fwd-flow-stage-1
DataFlow: Disable standard order in `Stage1::fwdFlow`
2023-03-09 15:30:05 +00:00
Arthur Baars
eadc605c0e Merge pull request #12460 from github/dependabot/cargo/ql/serde-1.0.154
Bump serde from 1.0.152 to 1.0.154 in /ql
2023-03-09 16:25:18 +01:00
Jeroen Ketema
a40a578576 Update docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp.rst 2023-03-09 16:24:13 +01:00
Mathias Vorreiter Pedersen
2931e5dea8 C++: Reduce duplication by blocking flow into sources (since we'll already be considering flow starting at those sources) and out of sinks (since we'll already be alerting on this sink if it's relevant). 2023-03-09 14:59:13 +00:00
Mathias Vorreiter Pedersen
03ba7ea851 C++: Move the weird global property 'not sqlite_encryption_used()' from the sink definition to the source definition. The dataflow library starts tracking flow from the sources, so it's better to to rule out the entire database in the source definition than in the sink definition. 2023-03-09 14:59:13 +00:00
Mathias Vorreiter Pedersen
7819a7d2bc C++: Severely restrict the set of sinks in 'cpp/cleartext-storage-database'. This reduces the number of sinks considered on the 'sysown/proxysql' from > 62000 sinks to ~1000 sinks. 2023-03-09 14:59:13 +00:00
Alex Ford
5ef71f9d28 Merge pull request #12306 from alexrford/rb/more-expr-nodes
Ruby: ensure that all Ast `Expr`s have a dataflow node type more precise than `ExprNode`
2023-03-09 14:54:34 +00:00
Rasmus Wriedt Larsen
293f791611 Python: Remove solved consistency work-around
This has not been needed for some time now, but hadn't been removed
before now.
2023-03-09 15:45:20 +01:00
Asger F
6e744093e2 Merge pull request #12398 from github/post-release-prep/codeql-cli-2.12.4
Post-release preparation for codeql-cli-2.12.4
2023-03-09 15:38:21 +01:00
Jeroen Ketema
de97ae38dc C++: C++: Use getAUse in getIRRepresentationOfIndirectOperand 2023-03-09 15:15:00 +01:00
Rasmus Wriedt Larsen
38fe9b71b9 Ruby: Use new parameter position for synthetic hash-splat instead
We wanted to ensure that a callable did not have multiple parameters
with same parameter position. Originally we fixed this with
e0bd210797. This commit reverts that and
solves it by introducing a new parameter position instead.
2023-03-09 15:05:07 +01:00
Owen Mansel-Chan
f87b307ddb The source name of a diagnostic should not change 2023-03-09 14:00:52 +00:00
Rasmus Wriedt Larsen
bdda0f574b Python: Use new parameter position for synthetic **kwargs instead
We wanted to ensure that a callable did not have multiple parameters
with same parameter position. Originally we fixed this with
02b3a1b515 (like Ruby). This commit
reverts that and solves it by introducing a new parameter position
instead.
2023-03-09 15:00:20 +01:00
Jeroen Ketema
30ad113d4c Merge pull request #12454 from jketema/get-a-use
C++: Use `getAUse` in `getIRRepresentationOfOperand`
2023-03-09 14:14:23 +01:00
dependabot[bot]
dd3e357ad3 Bump serde from 1.0.152 to 1.0.154 in /ql
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.152 to 1.0.154.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.152...v1.0.154)

---
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-09 12:30:57 +00:00
dependabot[bot]
a731a82a10 Merge pull request #12459 from github/dependabot/cargo/ruby/serde-1.0.154 2023-03-09 12:28:57 +00:00
Arthur Baars
c98e0fa0b4 Ruby: fix comment 2023-03-09 13:14:57 +01:00
Arthur Baars
8096f86224 Ruby: lower severity of parse error to warning 2023-03-09 13:14:57 +01:00
Arthur Baars
942cd7c275 Merge pull request #12113 from erik-krogh/diagnostics
JS: Implement diagnostics
2023-03-09 12:57:06 +01:00
Geoffrey White
da338c26ba Swift: Add a few more test cases for sensitive data. 2023-03-09 11:39:22 +00:00
Mathias Vorreiter Pedersen
2bbeb7383f Merge pull request #12452 from MathiasVP/inline-this-could-access-member
C++: Inline `thisCouldAccessMember`
2023-03-09 11:38:50 +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
Mathias Vorreiter Pedersen
1f77f77153 DataFlow: Sync identical files. 2023-03-09 10:41:15 +00:00
Mathias Vorreiter Pedersen
c7b41ca470 C++: Disable standard order for 'fwdFlow' in stage 1 of dataflow. 2023-03-09 10:41:06 +00:00
Owen Mansel-Chan
55003300fe Merge pull request #12341 from owen-mc/go-tools-status
Go: tools status page support
2023-03-09 09:59:01 +00:00
Jeroen Ketema
e5ce27fbf9 C++: Fix a number of instances where a dataflow node did not have a location 2023-03-09 10:32:30 +01:00
Jeroen Ketema
31fa230c0d C++: Remove toStringImpl predicate that is overridden in every subclass 2023-03-09 10:29:17 +01:00
Jeroen Ketema
4ee13a3234 C++: Remove getLocationImpl predicate that is always overridden
Also remove the predicate referred to in ints implementation, as it is no
longer used.
2023-03-09 10:27:15 +01:00
Jeroen Ketema
791f5913d2 C++: Fix multiple getLocation consistency error in use-use dataflow 2023-03-09 10:25:02 +01:00
Mathias Vorreiter Pedersen
f19f7967c2 C++: Fix join order.
Before (I stopped midway):

```
(72s) Tuple counts for _#Class#bacd9b46::Class::getADerivedClass#0#dispredPlus#ff_#Declaration#4bfb53be::AccessHolder::getE__#antijoin_rhs#1/3@fb0627h8 after 1m4s:
  ...

  20000     ~0%       {5} r28 = r26 UNION r27
  224367484 ~7%       {9} r29 = JOIN r28 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff_1023#join_rhs ON FIRST 1 OUTPUT Rhs.3, "protected", Lhs.1 'arg0', Lhs.2 'arg1', Lhs.3 'arg2', Lhs.0, Lhs.4, Rhs.1, Rhs.2

  111914129 ~0%       {7} r30 = JOIN r29 WITH specifiers ON FIRST 2 OUTPUT Lhs.6, Lhs.2 'arg0', Lhs.3 'arg1', Lhs.4 'arg2', Lhs.5, Lhs.7, Lhs.8

  123503367 ~0%       {8} r31 = JOIN r30 WITH Declaration#4bfb53be::DirectAccessHolder::isFriendOfOrEqualTo#1#dispred#ff ON FIRST 1 OUTPUT Lhs.3 'arg2', Rhs.1, Lhs.1 'arg0', Lhs.2 'arg1', Lhs.4, Lhs.0, Lhs.5, Lhs.6
  331748250 ~0%       {10} r32 = JOIN r31 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 2 OUTPUT Lhs.2 'arg0', Lhs.3 'arg1', Lhs.0 'arg2', Lhs.4, Lhs.5, Lhs.6, Lhs.7, Lhs.1, Rhs.2, Rhs.3
  331748250 ~0%       {10} r33 = SELECT r32 ON In.8 = In.9
  331748250 ~2%       {9} r34 = SCAN r33 OUTPUT In.7, In.5, In.8, In.0 'arg0', In.1 'arg1', In.2 'arg2', In.3, In.4, In.6
  38000     ~4%       {10} r35 = JOIN r34 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 3 OUTPUT Rhs.3, Lhs.3 'arg0', Lhs.4 'arg1', Lhs.5 'arg2', Lhs.6, Lhs.7, Lhs.1, Lhs.8, Lhs.0, Lhs.2
  37500     ~0%       {11} r36 = JOIN r35 WITH specifiers ON FIRST 1 OUTPUT Lhs.1 'arg0', Lhs.2 'arg1', Lhs.3 'arg2', Lhs.4, Lhs.5, Lhs.6, Lhs.7, Lhs.8, Lhs.9, Lhs.0, Rhs.1
  28973     ~0%       {11} r37 = SELECT r36 ON In.10 >= "protected"
  28973     ~98%      {6} r38 = SCAN r37 OUTPUT In.8, "public", In.0 'arg0', In.1 'arg1', In.2 'arg2', In.6

  111913629 ~6%       {7} r39 = JOIN r29 WITH specifiers ON FIRST 2 OUTPUT Lhs.6, Lhs.4 'arg2', Lhs.2 'arg0', Lhs.3 'arg1', Lhs.5, Lhs.7, Lhs.8
  110582830 ~0%       {8} r40 = JOIN r39 WITH Declaration#4bfb53be::DirectAccessHolder::isFriendOfOrEqualTo#1#dispred#ff ON FIRST 2 OUTPUT Lhs.1 'arg2', Lhs.5, Lhs.6, Lhs.2 'arg0', Lhs.3 'arg1', Lhs.1 'arg2', Lhs.4, Lhs.0

  123503367 ~0%       {8} r41 = JOIN r30 WITH Declaration#4bfb53be::DirectAccessHolder::isFriendOfOrEqualTo#1#dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.3 'arg2', Lhs.1 'arg0', Lhs.2 'arg1', Lhs.4, Lhs.0, Lhs.5, Lhs.6
  0         ~0%       {8} r42 = JOIN r41 WITH #Class#bacd9b46::Class::getADerivedClass#0#dispredPlus#ff ON FIRST 2 OUTPUT Lhs.0, Lhs.6, Lhs.7, Lhs.2 'arg0', Lhs.3 'arg1', Lhs.1 'arg2', Lhs.4, Lhs.5

  110582830 ~0%       {8} r43 = r40 UNION r42
  15000     ~6%       {8} r44 = JOIN r43 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 3 OUTPUT Lhs.5 'arg2', Lhs.1, Lhs.3 'arg0', Lhs.4 'arg1', Lhs.6, Lhs.7, Lhs.2, Lhs.0
  ...
```

After:

```
Tuple counts for _#Class#bacd9b46::Class::getADerivedClass#0#dispredPlus#ff_#Declaration#4bfb53be::AccessHolder::getE__#antijoin_rhs#1/3@997a3ai9 after 744ms:
  ...

  78600   ~8%       {6} r29 = r26 UNION r28
  437816  ~0%       {9} r30 = JOIN r29 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 1 OUTPUT Lhs.1 'arg0', Lhs.2 'arg1', Lhs.0 'arg2', Lhs.3, Lhs.4, Lhs.5, Rhs.1, Rhs.2, Rhs.3
  430928  ~0%       {9} r31 = SELECT r30 ON In.7 = In.8
  430928  ~0%       {7} r32 = SCAN r31 OUTPUT In.5, In.6, In.0 'arg0', In.1 'arg1', In.2 'arg2', In.3, In.7
  1096333 ~0%       {7} r33 = JOIN r32 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 2 OUTPUT Lhs.1, Lhs.5, Rhs.2, Lhs.2 'arg0', Lhs.3 'arg1', Lhs.4 'arg2', Lhs.6
  777970  ~0%       {8} r34 = JOIN r33 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 3 OUTPUT Lhs.0, Lhs.1, Lhs.2, Rhs.3, Lhs.3 'arg0', Lhs.4 'arg1', Lhs.5 'arg2', Lhs.6

  334217  ~0%       {6} r35 = JOIN r14 WITH Declaration#4bfb53be::DirectAccessHolder::isFriendOfOrEqualTo#1#dispred#ff ON FIRST 1 OUTPUT Lhs.3 'arg2', Rhs.1, Lhs.1 'arg0', Lhs.2 'arg1', Lhs.4, Lhs.0
  235623  ~0%       {8} r36 = JOIN r35 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 2 OUTPUT Lhs.2 'arg0', Lhs.3 'arg1', Lhs.0 'arg2', Lhs.4, Lhs.5, Lhs.1, Rhs.2, Rhs.3
  235623  ~0%       {8} r37 = SELECT r36 ON In.6 = In.7
  235623  ~0%       {7} r38 = SCAN r37 OUTPUT In.5, In.6, In.0 'arg0', In.1 'arg1', In.2 'arg2', In.3, In.4
  437303  ~0%       {9} r39 = JOIN r38 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff_0213#join_rhs ON FIRST 2 OUTPUT Rhs.3, Lhs.2 'arg0', Lhs.3 'arg1', Lhs.4 'arg2', Lhs.5, Lhs.6, Lhs.0, Lhs.1, Rhs.2
  437303  ~4%       {10} r40 = JOIN r39 WITH specifiers ON FIRST 1 OUTPUT Lhs.1 'arg0', Lhs.2 'arg1', Lhs.3 'arg2', Lhs.4, Lhs.5, Lhs.6, Lhs.7, Lhs.8, Lhs.0, Rhs.1
  352102  ~1%       {10} r41 = SELECT r40 ON In.9 >= "protected"
  352102  ~0%       {6} r42 = SCAN r41 OUTPUT In.7, In.3, In.0 'arg0', In.1 'arg1', In.2 'arg2', In.6
  775332  ~0%       {8} r43 = JOIN r42 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 2 OUTPUT Lhs.0, Lhs.1, Rhs.2, Rhs.3, Lhs.2 'arg0', Lhs.3 'arg1', Lhs.4 'arg2', Lhs.5

  1553302 ~51%      {8} r44 = r34 UNION r43
  1553302 ~152%     {7} r45 = JOIN r44 WITH Class#bacd9b46::Class::accessOfBaseMember#2#dispred#ffff ON FIRST 4 OUTPUT Lhs.7, "public", Lhs.4 'arg0', Lhs.5 'arg1', Lhs.6 'arg2', Lhs.2, Lhs.3
  ...
```
2023-03-09 09:23:56 +00:00
Rasmus Lerchedahl Petersen
32d95834d1 python: add test documenting effect of scopes 2023-03-09 10:19:44 +01:00
Jeroen Ketema
55da3257bf C++: Fix multiple toString consistency error in use-use dataflow 2023-03-09 10:08:25 +01:00
Jeroen Ketema
a2248cb5a0 C++: Use getAUse in getIRRepresentationOfOperand 2023-03-09 09:45:54 +01:00
Jeroen Ketema
fadd23a2a0 Merge pull request #12443 from jketema/even-more-configsig
C++: Update more queries with `DataFlow::ConfigSig`
2023-03-09 08:54:31 +01:00
dependabot[bot]
060cd9fada Bump serde from 1.0.152 to 1.0.154 in /ruby
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.152 to 1.0.154.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.152...v1.0.154)

---
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-09 04:06:43 +00:00
Ed Minnix
48ca1d0b72 Convert the taint tracking configurations to modules 2023-03-08 19:51:54 -05:00
Ed Minnix
ae0b4970ac Remove commented out code 2023-03-08 19:21:58 -05:00
Ed Minnix
da43a61506 Convert dataflow configuration to using new module-configuration 2023-03-08 19:19:00 -05:00
Chris Smowton
db5bd98781 Return on failure to create file 2023-03-08 22:48:57 +00:00
Owen Mansel-Chan
820de5d36f Remove fatal/panic exits from diagnostic code 2023-03-08 22:00:34 +00:00
Ed Minnix
eeb9a88c3a Renamed test file to follow camel casing convention 2023-03-08 13:56:25 -05:00
Ed Minnix
f680a2ecbf Update test java file to support InlineExpectationsTest 2023-03-08 13:50:02 -05:00
Jeroen Ketema
57c8f5111d C++: Address docs review comments 2023-03-08 19:38:25 +01:00
Ed Minnix
bfd430b446 Remove qlref tests 2023-03-08 13:21:31 -05:00
Ed Minnix
24c9a516c9 Add QLdoc to ArbitraryApkInstallationQuery.qll 2023-03-08 13:21:09 -05:00
Chris Smowton
cacae957b5 Merge pull request #12441 from smowton/smowton/fix/golang-incorrect-integer-conversion-sanitizer
Go: fix incorrect-integer-conversion sanitizer
2023-03-08 18:19:46 +00:00
Jeroen Ketema
3f905f2675 Update docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-08 19:10:11 +01:00
Michael B. Gale
695160d480 Remove check for stdout redirection 2023-03-08 18:09:09 +00:00
Jeroen Ketema
f6e05836f1 Update docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-08 19:08:35 +01:00
Jeroen Ketema
2ecc8a5abe Update docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-03-08 19:08:19 +01:00
Mathias Vorreiter Pedersen
540ce1f0db Contrary to what the QLDoc says, this predicate was way too large to be
evaluated on the 'quick-lint/quick-lint-js' project.

Before:
```
Most expensive predicates for completed query RuleOfTwo.ql:
        time  | evals |   max @ iter | predicate
        ------|-------|--------------|----------
        25m9s |       |              | Declaration#4bfb53be::DirectAccessHolder::thisCouldAccessMember#3#dispred#ffff@8a38e2tm
        17m1s |       |              | Declaration#4bfb53be::DirectAccessHolder::thisCouldAccessMember#3#dispred#fffb@0796c497
         3.5s |   130 | 116ms @ 3    | Declaration#4bfb53be::DirectAccessHolder::thisCanAccessClassTrans#fff@926a68j9
         3.3s |       |              | Declaration#4bfb53be::DirectAccessHolder::thisCouldAccessMember#3#dispred#fffb_1230#join_rhs@25e9ffj8
         1.7s |     3 |  1.7s @ 1    | Element#496c7fc2::ElementBase::toString#0#dispred#ff@fcd81c49
         1.3s |       |              | Declaration#4bfb53be::DirectAccessHolder::thisCouldAccessMember#3#dispred#fffb_0132#join_rhs@9c2065t1
         1.3s |       |              | Declaration#4bfb53be::DirectAccessHolder::thisCouldAccessMember#3#dispred#ffff_0132#join_rhs@672330eh
         1.1s |       |              | Declaration#4bfb53be::DirectAccessHolder::thisCanAccessClassTrans#fff_102#join_rhs@f7d5464o
        829ms |   336 |  85ms @ 6    | Enclosing#c50c5fbf::exprEnclosingElement#1#ff@e34d9wq1
        615ms |       |              | Expr#ef463c5d::Expr::getType#ff@e265e79q
```

After:
```
Most expensive predicates for completed query RuleOfTwo.ql:
        time  | evals |  max @ iter | predicate
        ------|-------|-------------|----------
        11.8s |       |             | _#Class#bacd9b46::Class::getADerivedClass#0#dispredPlus#ff_#Declaration#4bfb53be::AccessHolder::getE__#antijoin_rhs#1@fb0627h8
        4.8s |       |             | _#Class#bacd9b46::Class::getADerivedClass#0#dispredPlus#ff_#Declaration#4bfb53be::AccessHolder::getE__#antijoin_rhs#4@c43dbeia
        3.8s |       |             | _#Class#bacd9b46::Class::getADerivedClass#0#dispredPlus#ff_#Declaration#4bfb53be::AccessHolder::getE__#antijoin_rhs#3@313e5963
        3.4s |   130 | 93ms @ 3    | Declaration#4bfb53be::DirectAccessHolder::thisCanAccessClassTrans#fff@a0289bfg
        1.5s |     3 | 1.5s @ 1    | Element#496c7fc2::ElementBase::toString#0#dispred#ff@fcd81c49
        806ms |       |             | Declaration#4bfb53be::DirectAccessHolder::thisCanAccessClassTrans#fff_021#join_rhs@cc1b76s7
        721ms |   336 | 61ms @ 5    | Enclosing#c50c5fbf::exprEnclosingElement#1#ff@e34d9wq1
        489ms |       |             | Expr#ef463c5d::Expr::getType#ff@e265e79q
        337ms |   130 | 62ms @ 5    | Class#bacd9b46::Class::accessOfBaseMemberMulti#ffff@0165b0dr
        329ms |       |             | Variable#7a968d4e::ParameterDeclarationEntry::getAnonymousParameterDescription#0#dispred#ff@0f12bdvq
        211ms |       |             | exprs_10#join_rhs@5481143i
```
2023-03-08 17:44:19 +00:00
Ed Minnix
882e909862 Renamed ArbitraryAPKInstallation to ArbitraryApkInstallation 2023-03-08 12:16:46 -05:00
Ed Minnix
5fb5f1b23b Begin InlineExpectationsTest 2023-03-08 12:14:45 -05:00
Ed Minnix
3ea167cadf Split ArbitraryApkInstallation file into 3 files 2023-03-08 12:12:11 -05:00
Edward Minnix III
2d1088e923 Change severity level to error
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-08 12:12:11 -05:00
Ed Minnix
0eaad4136e Add RemoteFlowSource as a valid source 2023-03-08 12:12:11 -05:00
Ed Minnix
4d51e4fed0 Change description wording 2023-03-08 12:12:11 -05:00
Ed Minnix
10cd6328dc Add missing QLDocs 2023-03-08 12:12:11 -05:00
Edward Minnix III
8ec5b5b7fa Apply suggestions from code review
Co-authored-by: Jami <57204504+jcogs33@users.noreply.github.com>
2023-03-08 12:12:10 -05:00
Ed Minnix
8fcf00b73d Test improvements 2023-03-08 12:12:10 -05:00
Ed Minnix
fa416564c7 Documentation and examples 2023-03-08 12:12:10 -05:00
Ed Minnix
d3d712fbff Remove Url#parse as a source 2023-03-08 12:12:10 -05:00
Ed Minnix
5f4e8e3e6a Add test cases relating to intents with the ACTION_INSTALL_PACKAGE action 2023-03-08 12:12:10 -05:00
Ed Minnix
f03e90f894 Remove http(s) literal sources 2023-03-08 12:12:10 -05:00
Edward Minnix III
839b88a4bc Formatting, capitalization, and typos
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-03-08 12:12:10 -05:00
Ed Minnix
b606271a61 Additional documentation 2023-03-08 12:12:10 -05:00
Ed Minnix
01b20b3a26 Added external storage test case 2023-03-08 12:12:10 -05:00
Ed Minnix
c448481bf7 Added test expectations 2023-03-08 12:12:10 -05:00
Ed Minnix
12f78dbed4 Add DataFlow::PathGraph import 2023-03-08 12:12:10 -05:00
Ed Minnix
cd5a46123e Add a change note 2023-03-08 12:12:10 -05:00
Ed Minnix
2d6cdff14b Add period to alert message 2023-03-08 12:12:10 -05:00
Ed Minnix
0ec4df28f5 Add query metadata 2023-03-08 12:12:10 -05:00
Ed Minnix
3f589722c2 Refactor query to change returned source 2023-03-08 12:12:10 -05:00
Ed Minnix
618b608962 Arbitrary APK Installation MVP 2023-03-08 12:12:10 -05:00
Owen Mansel-Chan
9fc119cc55 Rearrange diagnostic error message
The context should come in the middle and the call to action should come
last.
2023-03-08 17:09:52 +00:00
Robert Marsh
6bfa08c5cc Merge branch 'main' into rdmarsh2/swift/constructor-flow 2023-03-08 16:40:11 +00:00
Owen Mansel-Chan
63d3b3ff2a Fix diagnostic-limit-reached visibility and location 2023-03-08 16:34:29 +00:00
Owen Mansel-Chan
0d6f17ec90 Do not use field internal, which is deprecated 2023-03-08 16:34:01 +00: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
Robert Marsh
3bf3876c14 Swift: fix FPs with inout params in inits 2023-03-08 16:20:39 +00:00
Owen Mansel-Chan
17c550bc88 Address review comments 2023-03-08 15:51:45 +00:00
Arthur Baars
7ab0f88f78 JS: add link to docs to parse error diagnostic 2023-03-08 16:47:43 +01:00
Arthur Baars
ebf0bb889b Ruby: add some integration tests for diagnostic messages 2023-03-08 16:35:43 +01:00
Arthur Baars
e5be8ab1e5 JS: add integration test for diagnostic messages 2023-03-08 16:04:49 +01:00
Jeroen Ketema
30cbc91092 C++: Update XXE XML query with DataFlow::ConfigSig 2023-03-08 15:04:53 +01:00
Jeroen Ketema
6f2407412e C++: Update some dataflow tests to use DataFlow::ConfigSig 2023-03-08 15:04:53 +01:00
Jeroen Ketema
8253f2d343 C++: Update UnsafeDaclSecurityDescriptor with DataFlow::ConfigSig 2023-03-08 15:04:53 +01:00
Jeroen Ketema
7fe1a9431c C++: Update PotentiallyExposedSystemData with DataFlow::ConfigSig 2023-03-08 15:04:53 +01:00
Jeroen Ketema
53aa34bdd3 C++: Update UnsafeCreateProcessCall with DataFlow::ConfigSig 2023-03-08 15:04:53 +01:00
Jeroen Ketema
af612a12de C++: Update TlsSettingsMisconfiguration with DataFlow::ConfigSig 2023-03-08 15:04:52 +01:00
Jeroen Ketema
4363a8ea30 C++: Update leap year queries with DataFlow::ConfigSig 2023-03-08 15:04:52 +01:00
Jeroen Ketema
e65ba13da4 C++: Update NonConstantFormat with DataFlow::ConfigSig 2023-03-08 15:04:52 +01:00
Jeroen Ketema
661160a98e C++: Update PrivateCleartextWrite with DataFlow::ConfigSig 2023-03-08 15:04:45 +01:00
Michael B. Gale
ce937e78c0 Merge pull request #12383 from github/mbg/csharp/fix/diag-filename
C#: Append process id to diagnostics filename
2023-03-08 14:04:29 +00:00
Arthur Baars
22c6c53993 Merge pull request #12434 from aibaars/diagnostics-links
Ruby: add some links to diagnostic messages
2023-03-08 14:41:46 +01:00
Mathias Vorreiter Pedersen
a247a8b3ea Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-08 13:35:35 +00:00
Mathias Vorreiter Pedersen
e68bb53a6b Merge pull request #12435 from jketema/more-config
C++: Convert a number of data flow based queries to use `ConfigSig`
2023-03-08 13:25:54 +00:00
Mathias Vorreiter Pedersen
619266d04b C++: Fix floating point imprecision. 2023-03-08 13:24:01 +00:00
Mathias Vorreiter Pedersen
ce0f2b1788 C++: Accept test changes. 2023-03-08 13:23:58 +00:00
Mathias Vorreiter Pedersen
b0cb65403b C++: Add range analysis for unary minus. 2023-03-08 13:23:18 +00:00
Mathias Vorreiter Pedersen
4cb5bea2c6 C++: Add simple negation test cases. 2023-03-08 13:23:05 +00:00
Michael Nebel
29ee1bda50 Merge pull request #12369 from michaelnebel/csharp/unsafestubs
C#: .NET 7 Runtime and ASP.NET 7 stubs.
2023-03-08 13:54:23 +01:00
Michael Nebel
6adc04eca0 Merge pull request #12370 from michaelnebel/csharp/unsafemember
C#: Improve the `unsafe` predicate on Modifiable.
2023-03-08 13:47:59 +01:00
Anders Schack-Mulligen
e7f85673e9 Java: Fix tests and make modules private 2023-03-08 13:35:25 +01:00
Michael B. Gale
71d0a2378b Append process id to diagnostics filename 2023-03-08 12:15:46 +00:00
Arthur Baars
2d6f3ed6c2 Address comments 2023-03-08 13:10:03 +01:00
Mathias Vorreiter Pedersen
c84d88f5aa Merge pull request #12429 from MathiasVP/actually-implement-language-specific-flow-into-call-node-cand1
C++: Implement `getAdditionalFlowIntoCallNodeTerm`
2023-03-08 11:58:56 +00:00
yoff
a45a0ee50d Merge pull request #12425 from RasmusWL/arg-passing-problem
Python: Add test of keyword argument with same name as positional-only parameter
2023-03-08 12:01:26 +01:00
Maiky
5a9a90d00b Move query to experimental 2023-03-08 11:50:04 +01:00
Mathias Vorreiter Pedersen
8308c661b4 Merge pull request #12432 from MathiasVP/fix-ir-uninitialized-node
C++: Fix `asUninitialized`
2023-03-08 10:03:46 +00:00
Chris Smowton
a63a4c29e2 Go: fix incorrect-integer-conversion sanitizer
This was amended as part of https://github.com/github/codeql/pull/12186, but the conversion was inadequate because the new implementation didn't work when a sink (type conversion) led directly to a non-`localTaintStep` step, such as a store step or an interprocedural step. Here I move the sink back one step to the argument of the type
conversion and sanitize the result of the conversion instead, to ensure there is always a unique local successor to a sink.

This should eliminate unexpected extra results that resulted from https://github.com/github/codeql/pull/12186. Independently there are also *lost* results that stem from needing a higher `fieldFlowBranchLimit` that are not addressed in this PR, but raising that limit is a performance risk and so I will address this separately.
2023-03-08 09:48:35 +00:00
Maiky
d9d63bbdc6 Change ERB to Erb 2023-03-08 10:41:24 +01:00
Mathias Vorreiter Pedersen
5a6b94eda2 C++: Respond to PR reviews. 2023-03-08 09:38:56 +00: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
Michael Nebel
0714310661 C#: Add some more test examples. 2023-03-08 10:14:49 +01:00
Mathias Vorreiter Pedersen
263b208282 C++: Disambiguate a test annotation. 2023-03-08 09:07:07 +00:00
Michael Nebel
7ce5c0d55d C#: Add change note. 2023-03-08 10:02:28 +01:00
Michael Nebel
c88f52c63e C#: Add stubs test case. 2023-03-08 10:02:27 +01:00
Michael Nebel
b6d97b07bf C#: Also print the unsafe keyword for eg. classes when creating stubs. 2023-03-08 10:02:27 +01:00
Michael Nebel
67e7b8fc23 C#: If a type (or any child of a type) is a pointer like type then it is unsafe. 2023-03-08 10:02:27 +01:00
Jeroen Ketema
5391b13db9 C++: Make dataflow configuration modules private in qll files 2023-03-08 09:18:09 +01:00
Jeroen Ketema
0f8a12f3ac C++: Add change note for deprecated data flow configurations in qll files 2023-03-08 09:00:43 +01:00
Robert Marsh
94d80b0e87 Swift: accept LocalTaint test for constructor flow 2023-03-07 21:17:26 +00:00
Robert Marsh
86fd21de45 Swift: respond to PR comments on constructor flow 2023-03-07 21:17:01 +00:00
Paolo Tranquilli
a4c0a0353f Merge pull request #12426 from github/redsun82/cpp-file-permissions-example
C++: fix example code for `FilePermissions.qll`
2023-03-07 19:55:46 +01:00
Jeroen Ketema
13bdd9c0c6 C++: Fix query compliation
Apparently some queries we skipped in the testing I did locally.
2023-03-07 19:16:10 +01:00
Jeroen Ketema
57c5d5f2c7 C++: Add QLDoc on configuration modules where the original class had one 2023-03-07 19:01:05 +01:00
Jeroen Ketema
0c39d1e5ca C++: Fix query formatting 2023-03-07 18:55:58 +01:00
Jeroen Ketema
2eb2e11ef7 C++: Fix query compilation 2023-03-07 18:53:07 +01:00
AlexDenisov
6a985a3df9 Merge pull request #12392 from github/alexdenisov/mangle-builtin-types
Swift: mangle builtin types
2023-03-07 18:22:13 +01:00
Jeroen Ketema
fb57914751 C++: Convert a number of data flow based queries to use ConfigSig 2023-03-07 18:21:52 +01:00
Arthur Baars
858aa9ae63 Ruby: add some links to diagnostic messages 2023-03-07 17:55:13 +01:00
Mathias Vorreiter Pedersen
cc0b8bbebb Merge pull request #12430 from MathiasVP/no-to-string-on-state-in-cast-array-pointer-arith
C++: Convert `cpp/upcast-array-pointer-arithmetic` to the new API
2023-03-07 16:48:15 +00:00
Alex Denisov
1283bcb860 Swift: mangle builtin types 2023-03-07 17:45:08 +01:00
AlexDenisov
d469b9711d Merge pull request #12388 from github/alexdenisov/introduce-type-mangling
Swift: introduce type mangling
2023-03-07 17:44:30 +01:00
Owen Mansel-Chan
07098bf8bf Minor refactor in diagnostics.go 2023-03-07 16:38:53 +00:00
Owen Mansel-Chan
2edccec693 Do not link to GitHub AE version of documentation 2023-03-07 16:38:53 +00:00
Owen Mansel-Chan
c28f51f820 Remove diagnostics-limit-exceeded test
There is no way to trigger this any more.
2023-03-07 16:38:52 +00:00
Owen Mansel-Chan
05a4fdf6d8 Put all package-not-found errors into one diagnostic 2023-03-07 16:38:52 +00:00
Owen Mansel-Chan
a4c9120a9a Update one of the diagnostic messages 2023-03-07 16:38:52 +00:00
Owen Mansel-Chan
2c5239ff7b Use full stops at the end of diagnostics messages 2023-03-07 16:38:51 +00:00
Owen Mansel-Chan
a7a10de9ea Emit diagnostic to pass fourth integration tests 2023-03-07 16:38:51 +00:00
Owen Mansel-Chan
8d28253175 Add tests for fourth diagnostic (Go files found but not processed) 2023-03-07 16:38:51 +00:00
Owen Mansel-Chan
01a2e74df7 Add test for diagnostic-limit-hit diagnostic 2023-03-07 16:38:50 +00:00
Owen Mansel-Chan
b6a9f87238 Use "go/autobuilder/" as prefix for all diagnostics 2023-03-07 16:38:50 +00:00
Owen Mansel-Chan
4907e5754f Address review comments 2023-03-07 16:38:49 +00:00
Owen Mansel-Chan
2a41e6ae66 Emit diagnostic to pass third inegration tests 2023-03-07 16:38:49 +00:00
Owen Mansel-Chan
4fe4dfbf83 Add tests for third diagnostic (package not found) 2023-03-07 16:38:49 +00:00
Owen Mansel-Chan
c0cc1c3fd5 Emit diagnostic to pass second integration test 2023-03-07 16:38:48 +00:00
Owen Mansel-Chan
3f805d3456 Remove unused param from function 2023-03-07 16:38:48 +00:00
Owen Mansel-Chan
137b2c9ef9 Add test for second diagnostic (newer go version) 2023-03-07 16:38:47 +00:00
Owen Mansel-Chan
cbb2fb9968 Emit diagnostic to pass first integration test 2023-03-07 16:38:47 +00:00
Owen Mansel-Chan
4d3b05e041 Add test for first diagnostic (different OS/arch) 2023-03-07 16:38:46 +00:00
Geoffrey White
72d6f56df1 Merge pull request #12413 from geoffw0/ptrout2
Swift: Permit data flow from all generic arguments
2023-03-07 16:27:12 +00:00
Mathias Vorreiter Pedersen
eea02e1ac1 C++: Accept test changes. 2023-03-07 16:18:43 +00:00
Mathias Vorreiter Pedersen
a39a6ea648 C++: Don't use indirect instructions for asUnitialized. 2023-03-07 16:18:27 +00:00
Mathias Vorreiter Pedersen
ce02de48a0 C++: Fix Code Scanning error. 2023-03-07 14:40:36 +00:00
Mathias Vorreiter Pedersen
f2b311a008 C++: We don't need to check type equivalence at the end anymore: the dataflow state now precisely tracks the types. 2023-03-07 14:31:11 +00:00
Mathias Vorreiter Pedersen
ce6366f023 C++: Use the parameterized module dataflow API in 'cpp/upcast-array-pointer-arithmetic'.
This allows us to swap out the old string state with the Type-based state.
2023-03-07 14:17:12 +00:00
Mathias Vorreiter Pedersen
0d1e061f5a C++: Implement 'getAdditionalFlowIntoCallNodeTerm'. 2023-03-07 13:45:32 +00: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
Mathias Vorreiter Pedersen
63690066c5 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-03-07 13:06:43 +00:00
Mathias Vorreiter Pedersen
b054b9c5cd Merge pull request #12408 from jketema/merge-main
C++: use-use dataflow merge main
2023-03-07 13:05:30 +00:00
Anders Schack-Mulligen
2288eab0fd Java: Refactor BrokenCryptoAlgorithm, MaybeBrokenCryptoAlgorithm 2023-03-07 13:53:36 +01:00
Paolo Tranquilli
c4fd39ec3f C++: fix example code for FilePermissions.qll 2023-03-07 13:50:20 +01:00
Arthur Baars
78a802359e Remove references to 'ruby' in generic extractor code 2023-03-07 13:38:48 +01:00
Anders Schack-Mulligen
50935899fa Java: Refactor XSS.ql 2023-03-07 13:33:00 +01:00
Paolo Tranquilli
bdad847584 Merge pull request #12422 from github/redsun82/cpp-scanf-fp
C++: add false positives to `MissingCheckScanf` test
2023-03-07 13:29:22 +01:00
Rasmus Wriedt Larsen
dda29e99b2 Python: Add test of keyword argument with same name as positional-only parameter
This is a bit of an edge case, but allowed. Since we currently don't
provide information on positional only arguments, we can't do much to
solve it right now.
2023-03-07 13:28:48 +01:00
Asger F
05b5aea477 JS: Changenote 2023-03-07 13:15:44 +01:00
Michael B. Gale
7627a53c49 Merge pull request #12371 from github/mbg/csharp/increase-diagnostic-visibility
C#: Make diagnostics visible everywhere
2023-03-07 12:13:09 +00:00
Michael B. Gale
974fdd305e Merge pull request #12372 from github/mbg/csharp/check-integration-test-diagnostics
C#: Add diagnostic checks to all remaining integration tests
2023-03-07 12:11:47 +00:00
Michael B. Gale
b75f138507 Merge pull request #12385 from github/mbg/csharp/readd-tsp-support
C#: Add support for the tool status page
2023-03-07 12:10:52 +00:00
Asger F
856b50735d JS: Expand test case 2023-03-07 13:04:26 +01:00
Paolo Tranquilli
429518bcea C++: add further FP to test 2023-03-07 12:03:34 +01:00
Paolo Tranquilli
311cf4e7fd C++: add false positives to MissingCheckScanf test
See https://github.com/github/codeql/issues/12412 for the initial
report.
2023-03-07 11:56:05 +01:00
Anders Schack-Mulligen
d839b4038e Java: Refactor TaintedPath.ql 2023-03-07 11:53:03 +01:00
Anders Schack-Mulligen
cc75a1a97e Java: Refactor RequestForgery.ql 2023-03-07 11:39:03 +01:00
Anders Schack-Mulligen
35beadc3bb Java: Refactor SensitiveInfoLog.ql 2023-03-07 11:31:49 +01:00
Michael Nebel
40d31120d9 Merge pull request #12264 from michaelnebel/csharp/nugetnet7
C#: Stub generator improvements.
2023-03-07 11:30:57 +01:00
Jeroen Ketema
3a4c0a2aae Merge pull request #12389 from jketema/more-deprecated
C++: Add `deprecated` to predicates that are deprecated according to the QLDoc
2023-03-07 11:21:43 +01:00
Anders Schack-Mulligen
4408482699 Java: Refactor NumericCastTainted, NumericCastTaintedLocal 2023-03-07 10:42:00 +01:00
Anders Schack-Mulligen
d4e6e77200 Java: Refactor StackTraceExposure, XSS.qll 2023-03-07 10:38:00 +01:00
Anders Schack-Mulligen
c4cf2febfb Java: Refactor ResponseSplitting, ResponseSplittingLocal 2023-03-07 10:37:45 +01:00
Michael Nebel
af12affc36 C#: Re-generate stubs to update comments. 2023-03-07 10:35:13 +01:00
Asger F
0affd898de JS: Track trusted type policy callbacks 2023-03-07 10:22:26 +01:00
Michael Nebel
676c352819 C#: Update expected test output. 2023-03-07 10:19:26 +01:00
Michael Nebel
e85b2ebd20 C#: Replace stub member comment with file level comment. 2023-03-07 10:19:26 +01:00
Michael Nebel
c8f7304d9b C#: Address review comments. 2023-03-07 10:19:25 +01:00
Michael Nebel
e797b5c226 C#: Narrow the set of declarations where we make explicit interface implementations. 2023-03-07 10:19:25 +01:00
Michael Nebel
d8acc7cd17 C#: Stub generator support for explicit interface implementations of explicit conversion operators including test cases. 2023-03-07 10:19:25 +01:00
Michael Nebel
59349ed7c7 C#: Add test cases for static and virtual operators in interfaces and overlapping interface declarations. 2023-03-07 10:19:25 +01:00
Michael Nebel
50570dc3ee C#: Only add explicit interface implementation to the generated stub if it is unique. 2023-03-07 10:19:25 +01:00
Michael Nebel
5ba59fc9a8 C#: Stub generator support for operators in interfaces and interface implementations. 2023-03-07 10:19:25 +01:00
Michael Nebel
b68e78d908 C#: Stub generator support for static virtual and static abstract interface members. 2023-03-07 10:19:25 +01:00
Michael Nebel
aa4b98bbd5 C#: The stub generator should just format whitespaces. 2023-03-07 10:19:25 +01:00
Jeroen Ketema
9ec479a2a0 C++: Update queries to use DataFlow::ConfigSig 2023-03-07 10:15:11 +01:00
Tom Hvitved
9b02eb729f Merge pull request #12419 from hvitved/ruby/stored-xss-config-rewrite
Ruby: Rewrite Stored XSS query to use new data flow interface
2023-03-07 09:46:08 +01:00
Asger F
4f0e17bf97 JS: Add step to a few other queries 2023-03-07 09:39:40 +01:00
Jeroen Ketema
c9bccd9b43 C++: Fix more tests that used deprecated function 2023-03-07 09:01:13 +01:00
Tom Hvitved
b6a709df50 Ruby: Rewrite Stored XSS query to use new data flow interface 2023-03-07 07:23:27 +01:00
Robert Marsh
686f7ccd5a Swift: add flow for self out of constructors 2023-03-06 20:46:36 +00:00
Robert Marsh
9731989421 Swift: add tests for flow through constructors 2023-03-06 20:39:58 +00: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
Arthur Baars
51599b3cae Address review comments 2023-03-06 18:40:29 +01:00
Geoffrey White
2ed140c696 Swift: Update the pointertypes test. 2023-03-06 17:14:14 +00:00
Mathias Vorreiter Pedersen
ff53e53e8c Merge pull request #12236 from MathiasVP/language-specific-field-flow-branch-limit-term
Dataflow: Add a language specific term to `join` and `branch`
2023-03-06 16:59:09 +00:00
Geoffrey White
4d327dbf4f Swift: The PointerType class isn't used any d any more. 2023-03-06 16:36:41 +00:00
Geoffrey White
61340c4b20 Swift: Permit data flow from generic arguments, rather than just pointers. 2023-03-06 16:34:12 +00:00
Geoffrey White
1e5b904514 Swift: Add test cases for mutating pointers inside containers. 2023-03-06 16:17:39 +00:00
Mathias Vorreiter Pedersen
aa09361a42 Merge pull request #12407 from MathiasVP/fix-internal-system-data-tests 2023-03-06 15:45:25 +00:00
Jeroen Ketema
47930f94e2 Merge remote-tracking branch 'upstream/main' into merge-main 2023-03-06 15:20:39 +01:00
Asger F
d4b4d22378 JS: Step through HTML sanitizers in SQL injection query 2023-03-06 15:10:26 +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
Mathias Vorreiter Pedersen
92ad099c1b DataFlow: Remove bindingsets, remove the call column, and swap parameter and argument columns. 2023-03-06 13:47:59 +00:00
Mathias Vorreiter Pedersen
3bf28cc752 DataFlow: Sync identical files. 2023-03-06 13:46:21 +00:00
Mathias Vorreiter Pedersen
9647b6a3f5 Swift: Add stub. 2023-03-06 13:45:04 +00:00
Mathias Vorreiter Pedersen
e6b6369a21 Ruby: Add stub. 2023-03-06 13:44:59 +00:00
Mathias Vorreiter Pedersen
5ebd50044f Python: Add stub. 2023-03-06 13:44:24 +00:00
Mathias Vorreiter Pedersen
4720e2a30a Java: Add stub. 2023-03-06 13:44:24 +00:00
Mathias Vorreiter Pedersen
067abacbb8 Go: Add stub. 2023-03-06 13:44:23 +00:00
Mathias Vorreiter Pedersen
b667e0136f C#: Add stub. 2023-03-06 13:44:23 +00:00
Mathias Vorreiter Pedersen
05314b48e8 C++: Add stub. 2023-03-06 13:44:23 +00:00
Mathias Vorreiter Pedersen
6e8a2a6375 DataFlow: Add a language-specific predicate for modifying 'branch' and 'join'. 2023-03-06 13:44:19 +00:00
Geoffrey White
56b6441ef5 Merge pull request #12391 from geoffw0/ptrout
Swift: Permit data flow out through pointer arguments
2023-03-06 13:37:22 +00:00
Rasmus Lerchedahl Petersen
f8b5a820f4 python: revert change in expected behaviour 2023-03-06 14:31:17 +01:00
Anders Schack-Mulligen
5c7f2ac7f7 Merge pull request #12186 from aschackmull/dataflow/refactor-configuration
Data flow: Refactor configuration
2023-03-06 13:38:59 +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
Mathias Vorreiter Pedersen
d2d91cfb29 C++: Accept test changes. 2023-03-06 11:30:40 +00:00
Mathias Vorreiter Pedersen
8836cbae5b C++: Make sure we use an indirect sink only for the sinks that receive a
pointer to the data. Also fix a bug where we used 'asExpr' instead
of 'asIndirectExpr'.
2023-03-06 11:22:58 +00:00
Rasmus Wriedt Larsen
35bd809baf Merge branch 'main' into import-refined 2023-03-06 11:22:56 +01:00
dependabot[bot]
3538cf89b9 Merge pull request #12404 from github/dependabot/cargo/ql/serde_json-1.0.94 2023-03-06 09:55:33 +00:00
Arthur Baars
d2ab40c184 Merge pull request #12208 from gregxsunday/main
Add ZipSlip and TarSlip query to ruby
2023-03-06 10:40:06 +01:00
dependabot[bot]
ce5e76a3a0 Bump serde_json from 1.0.93 to 1.0.94 in /ql
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.93 to 1.0.94.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.93...v1.0.94)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 09:32:26 +00:00
Anders Schack-Mulligen
557cb17f4d Dataflow: Minor perf fix for single config wrapper. 2023-03-06 10:24:33 +01:00
Calum Grant
b8e123dc08 Merge pull request #12402 from github/dependabot/cargo/ruby/serde_json-1.0.94
Bump serde_json from 1.0.93 to 1.0.94 in /ruby
2023-03-06 09:24:21 +00:00
Anders Schack-Mulligen
d4c5877484 Merge pull request #3 from MathiasVP/fix-exec-tainted
C++: Use refactored dataflow library in `cpp/command-line-injection`
2023-03-06 09:32:34 +01:00
Jeroen Ketema
72d03e4060 C++: Fix test that used deprecated function 2023-03-06 09:07:52 +01:00
dependabot[bot]
d34d7e51e5 Bump rayon from 1.6.1 to 1.7.0 in /ql
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.6.1...rayon-core-v1.7.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 04:18:21 +00:00
dependabot[bot]
f93b304578 Bump serde_json from 1.0.93 to 1.0.94 in /ruby
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.93 to 1.0.94.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.93...v1.0.94)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 04:15:01 +00:00
Dave Bartolomeo
e169702165 Merge branch 'main' into post-release-prep/codeql-cli-2.12.4 2023-03-04 09:20:44 -05:00
github-actions[bot]
af61b45785 Post-release preparation for codeql-cli-2.12.4 2023-03-04 14:16:55 +00:00
Dave Bartolomeo
d589b324c9 Merge pull request #12386 from github/release-prep/2.12.4
Release preparation for version 2.12.4
2023-03-03 16:59:55 -05:00
Dave Bartolomeo
b342e93989 Move change note to appropriate pack 2023-03-03 14:43:00 -05:00
Geoffrey White
6f120a66d0 Merge pull request #12368 from geoffw0/taintarith3
Swift: Fill some gaps in arithmetic / bitwise operations modelling
2023-03-03 18:20:54 +00:00
Geoffrey White
9aaf30691c Merge pull request #12307 from geoffw0/stringconflationtaint
Swift: Update swift/string-length-conflation to taint tracking
2023-03-03 17:27:15 +00:00
Geoffrey White
c29dcefcf2 Swift: Fix .expected file. Locations had changed after the formatting fix. 2023-03-03 17:24:07 +00:00
Geoffrey White
395bf675fe Swift: Make the test work on Linux. 2023-03-03 17:14:57 +00:00
Jeroen Ketema
aa00424b75 C++: Fix experimental query that uses the deprecated freeCall predicate 2023-03-03 17:53:49 +01:00
Geoffrey White
2d889304bb Swift: Some cases in the SqlInjection test are fixed by this. 2023-03-03 16:49:13 +00:00
Geoffrey White
b2bcb2d378 Swift: Fix formatting. 2023-03-03 16:32:21 +00:00
Chris Smowton
d4e02eb846 Merge pull request #12384 from smowton/smowton/admin/java-tsp-message-cleanup
Java TSP: test changes re: formatting improvements
2023-03-03 16:24:35 +00:00
Geoffrey White
6e3040987a Swift: Autoformat. 2023-03-03 16:24:28 +00:00
Geoffrey White
234f17b578 Swift: Use PointerType in data flow's 'modifiable' predicate. 2023-03-03 16:23:49 +00:00
Geoffrey White
3249cee1c9 Swift: Add an overall PointerType. 2023-03-03 16:23:46 +00:00
Geoffrey White
589e0af20a Swift: Test for pointer types. 2023-03-03 16:23:29 +00:00
Geoffrey White
9423c21d46 Swift: Add simple model for pointer types. 2023-03-03 16:23:27 +00:00
Jeroen Ketema
391d9bed5b C++: Add deprecated to predicates that are deprecated according to the QLDoc 2023-03-03 17:15:47 +01:00
Jeroen Ketema
2ee8344e92 Merge pull request #12387 from jketema/qualified-deprecation
C++: Properly deprecate `hasQualifiedName` by using the `deprecated` keyword
2023-03-03 17:11:56 +01:00
Alex Denisov
7f3e7224df Swift: introduce type mangling 2023-03-03 16:28:41 +01:00
AlexDenisov
4aeff0f8dc Merge pull request #12335 from github/alexdenisov/extract-lazy-declarations
Swift: extract lazy declarations
2023-03-03 16:06:20 +01:00
Geoffrey White
9f86bcb1b8 Swift: Proof of concept fix. 2023-03-03 15:04:47 +00:00
Geoffrey White
15227d3c09 Swift: Add tests where a user-defined (non-modelled) function taints the pointee of a pointer argument. 2023-03-03 15:00:22 +00:00
Jeroen Ketema
6495f1911f C++: Properly deprecate hasQualifiedName by using the deprecated keyword 2023-03-03 15:57:59 +01:00
erik-krogh
b875d30bc6 fix repeated predicate name in change-note 2023-03-03 15:55:17 +01:00
Chris Smowton
b234bbd119 Accept test changes 2023-03-03 14:46:21 +00:00
Mathias Vorreiter Pedersen
907e6299a4 C++: Convert 'ExecTainted' to use the new refactored dataflow library. 2023-03-03 14:41:29 +00:00
Michael Nebel
24fa2be7b3 C#: Update flow summaries expected output test. 2023-03-03 15:37:36 +01:00
Michael Nebel
d2d7ed7bae C#: .NET 7 stubs. 2023-03-03 15:37:36 +01:00
Jeroen Ketema
549fb0324b Apply suggestions from code review 2023-03-03 15:26:38 +01:00
github-actions[bot]
462da63970 Release preparation for version 2.12.4 2023-03-03 14:11:51 +00:00
Jeroen Ketema
fe5fbaa142 C++: Replace hasQualifiedName by hasGlobalName in docs examples 2023-03-03 15:08:00 +01:00
Jeroen Ketema
620c69df12 C++: Add more static qualifiers in syntax zoo test 2023-03-03 15:03:31 +01:00
Michael B. Gale
9dc9925f59 Abstract over DiagnosticsStream for tests 2023-03-03 13:05:43 +00:00
Michael Nebel
df6f5d52b9 C#: Use dependency injection in the auto builder for Diagnostic classifier. 2023-03-03 13:05:28 +00:00
Michael B. Gale
85751e7ddd Simplify DiagnosticClassifier in CSharpAutobuilder 2023-03-03 13:05:28 +00:00
Michael B. Gale
fe3066da56 Apply ql-for-ql suggestion 2023-03-03 13:05:28 +00:00
Michael B. Gale
a5f7913af3 Fix expected test output for Windows tests 2023-03-03 13:05:28 +00:00
Michael B. Gale
c2049c22a3 Refactor to avoid public setters 2023-03-03 13:05:27 +00:00
Michael B. Gale
4f0a93295a Move Language class to Semmle.Util 2023-03-03 13:05:27 +00:00
Michael B. Gale
6f3b5c01d5 Fix IDisposable contract violation 2023-03-03 13:05:27 +00:00
Michael B. Gale
be2d64a9d4 Simplify Xamarin query to be platform-independent 2023-03-03 13:05:27 +00:00
Michael B. Gale
92359de363 Add test for missing Xamarin SDKs 2023-03-03 13:05:27 +00:00
Michael B. Gale
1638f8edc5 Add test for missing project files 2023-03-03 13:05:26 +00:00
Michael B. Gale
40bda03180 Add test for dotnet incompatible projects 2023-03-03 13:05:26 +00:00
Michael B. Gale
5c641362bc Show .NET core error only if files exist 2023-03-03 13:05:26 +00:00
Michael B. Gale
04aaccb186 Fix C++ test missing env var 2023-03-03 13:05:26 +00:00
Michael B. Gale
6eda71b659 Add tests for build script diagnostics 2023-03-03 13:05:26 +00:00
Michael B. Gale
b26f9d0ff1 Use relative paths 2023-03-03 13:05:25 +00:00
Michael B. Gale
b2d1cfe3d1 Add diagnostic for missing project files 2023-03-03 13:05:25 +00:00
Michael B. Gale
b97c885c8d Add helper for markdown lists of projects 2023-03-03 13:05:25 +00:00
Michael B. Gale
5b6444d32d Refactor autobuild logic into an IBuildRule 2023-03-03 13:05:25 +00:00
Michael B. Gale
65608d7900 Fix: drop please 2023-03-03 13:05:24 +00:00
Michael B. Gale
95f9d0761a Add docs link for missing Xamarin SDKs 2023-03-03 13:05:24 +00:00
Michael B. Gale
0d5c5a7e92 Link to docs for autobuild failures 2023-03-03 13:05:24 +00:00
Michael B. Gale
9d19752c2e Make improvements based on PR feedback 2023-03-03 13:05:24 +00:00
Michael B. Gale
62cd8ca26f Update C/C++ autobuilder 2023-03-03 13:05:24 +00:00
Michael B. Gale
abf3f9f232 Use TryGetValue 2023-03-03 13:05:23 +00:00
Michael B. Gale
6471889fa6 Detect missing Xamarin SDKs 2023-03-03 13:05:23 +00:00
Michael B. Gale
b1f9a3d22a Fixup: better error message for no-projects-or-solutions 2023-03-03 13:05:23 +00:00
Michael B. Gale
9165ec92c5 Report .NET Core & MSBuild failures 2023-03-03 13:05:23 +00:00
Michael B. Gale
62b59747d1 Track which projects/solutions fail to build 2023-03-03 13:05:23 +00:00
Michael B. Gale
43df6397bb Report projects incompatible with .NET Core 2023-03-03 13:05:22 +00:00
Michael B. Gale
802e2319b5 Set DiagnosticMessage defaults
Refactor `GetDiagnosticSource` into `MakeDiagnostic`
which sets the defaults.
2023-03-03 13:05:22 +00:00
Michael B. Gale
28b350ee95 Change logic for autobuild failures
This is to account for multiple attempted rules that failed
2023-03-03 13:05:22 +00:00
Michael B. Gale
dfcc57ba83 Support asynchronous stdout/stderr processing 2023-03-03 13:05:22 +00:00
Michael B. Gale
ec2deb0889 Fixup: We => CodeQL 2023-03-03 13:05:22 +00:00
Michael B. Gale
dc7cf272db Add no projects/solutions diagnostic 2023-03-03 13:05:21 +00:00
Michael B. Gale
55d7b74489 Add diagnostics for BuildCommandAutoRule 2023-03-03 13:05:21 +00:00
Michael B. Gale
b88382e3e7 BuildCommandAutoRule: expose more information
We expose the list of candidate script paths and the chosen script path
so that we can inspect them for diagnostics purposes.
2023-03-03 13:05:21 +00:00
Michael B. Gale
60afa6e9f0 Add basic reporting of a general autobuild failure 2023-03-03 13:05:21 +00:00
Michael B. Gale
38a3a5ebfa Add initial code for diagnostic messages 2023-03-03 13:05:21 +00:00
Michael B. Gale
e029b1f0a8 Read ..._DIAGNOSTIC_DIR variable 2023-03-03 13:05:20 +00:00
Michael B. Gale
467429c23e Refactor env var code in Autobuilder class 2023-03-03 13:05:19 +00:00
Asger F
b9b8b8b28a JS: Remove public links to customization docs 2023-03-03 13:46:15 +01:00
Asger F
37999eaea0 JS: Fix implicit this 2023-03-03 13:43:17 +01:00
Asger F
f4b13e0955 JS: Update printAst expected output 2023-03-03 13:42:42 +01:00
Kasper Svendsen
fe65fb8743 Merge pull request #12360 from kaspersv/kaspersv/actioncontroller-prevent-bad-join
ActionController: Prevent bad join
2023-03-03 13:38:33 +01:00
Asger F
f2f972567d Merge pull request #12379 from github/revert-12217-mbg/csharp/tsp-support
Revert "C#: Tool status page support"
2023-03-03 13:29:13 +01:00
Erik Krogh Kristensen
d94e51aaf6 Merge pull request #12377 from erik-krogh/jHtml
JS: add the html argument to the jQuery functions as an XSS sink
2023-03-03 13:19:38 +01:00
Jeroen Ketema
87b1c3eaa8 Merge pull request #12381 from jketema/silence
C++: Silence some more bogus consistency errors in syntax zoo
2023-03-03 12:51:39 +01:00
Nick Fyson
48c30771da Merge pull request #12374 from github/codeql-ci/atm/update-model-pack/ecb17d40286d14132b481c065a43459a7f0ba9059015b7a49c909c9f9ce5fec5
ATM: Update model pack to version 0.3.1-2023-03-01-12h42m43s.strong-turtle-1xp3dqvv.ecb17d40286d14132b481c065a43459a7f0ba9059015b7a49c909c9f9ce5fec5
2023-03-03 11:42:57 +00:00
Asger F
7f96fe725b JS: Change note 2023-03-03 12:21:20 +01:00
Asger F
1264029282 JS: Bump extractor version string 2023-03-03 12:21:20 +01:00
Asger F
7a55b003d2 JS: Fix location of assert clause 2023-03-03 12:21:20 +01:00
Asger F
38194c6ae7 JS: Extract import assertions to DB 2023-03-03 12:21:20 +01:00
Asger F
f454151e7a JS: Convert TypeScript import assertions 2023-03-03 12:21:20 +01:00
Asger F
3af085afcb JS: Drive-by allow trailing commas in dynamic imports 2023-03-03 12:21:20 +01:00
Asger F
8d9060f1f9 JS: Store in the Java AST 2023-03-03 12:21:03 +01:00
Asger F
c715de2a10 JS: parse import assertions without storing in AST 2023-03-03 12:21:03 +01:00
Asger F
5fdc293d82 JS: Add trap test for import assertions 2023-03-03 12:21:03 +01:00
Mathias Vorreiter Pedersen
16e817c814 Merge pull request #12356 from MathiasVP/use-phi-reads
C++: Include "phi reads" in `DataFlow::Node`
2023-03-03 11:14:08 +00:00
Jeroen Ketema
4faede0e2c C++: Silence some more bogus consistency errors in syntax zoo
These were due to several functions occurring that would have the same TRAP key.
By making the functions static or wrapping the defining class in an anonymous
namespace the TRAP keys will differ from each other.
2023-03-03 12:07:33 +01:00
Jeroen Ketema
7f9b856a21 Merge pull request #12378 from jketema/silence
C++: Silence a number of bogus consistency errors in syntax zoo
2023-03-03 12:05:29 +01:00
Anders Schack-Mulligen
0addcfa7c5 Dataflow: Fix some perf issues. 2023-03-03 11:45:32 +01:00
Asger F
8f0b77d54f Revert "C#: Tool status page support" 2023-03-03 11:44:42 +01:00
Geoffrey White
7b596f4928 Merge pull request #10431 from ihsinme/ihsinme-patch-111
CPP: Add query for CWE-369: Divide By Zero.
2023-03-03 10:42:04 +00:00
Jeroen Ketema
f649def3f8 C++: Silence a number of bogus consistency errors in syntax zoo
These were due to several functions occurring that would have the same TRAP
key. By making the functions static the TRAP keys will differ from each other.
2023-03-03 11:16:19 +01:00
erik-krogh
a6c9af4182 add the html argument to the jQuery functions as an XSS sink 2023-03-03 11:09:53 +01:00
erik-krogh
94870b838f add failing test 2023-03-03 11:08:33 +01:00
Nick Fyson
5869c36366 Merge branch 'main' into codeql-ci/atm/update-model-pack/ecb17d40286d14132b481c065a43459a7f0ba9059015b7a49c909c9f9ce5fec5 2023-03-03 10:03:22 +00:00
Alex Denisov
ae7a0c517c Swift: do not allocate mangler statically 2023-03-03 10:28:08 +01:00
Alex Denisov
60c1505097 Swift: address review comments 2023-03-03 10:26:44 +01:00
erik-krogh
a928f4c9ef add change-notes 2023-03-03 09:23:10 +01:00
erik-krogh
f96d6accbb delete old deprecations 2023-03-03 09:23:02 +01:00
Paolo Tranquilli
1a19909abf Merge pull request #12373 from github/redsun82/swift-qldoc
Swift: turn on QLdoc check
2023-03-03 08:26:39 +01:00
Mathias Vorreiter Pedersen
959237e8d2 C++: Fix missing type for Phi nodes. 2023-03-02 22:48:10 +00:00
Mathias Vorreiter Pedersen
2963dc1cb1 C++: Include phi read nodes in SSA.
There's a small fix to the mapping from 'global def -> use'.

Finally, this commit also accepts a test failure related to new missing
types for phi nodes. The fix for that is in the next commit.
2023-03-02 22:48:06 +00:00
Mathias Vorreiter Pedersen
b3f92fcf0f C++: Add FN caused by missing static local initialization in SSA. 2023-03-02 22:37:52 +00:00
erik-krogh
fc9e63275f only print a constant when catching an OOM 2023-03-02 22:14:29 +01:00
Erik Krogh Kristensen
094a2b0c46 Apply suggestions from code review
Co-authored-by: Asger F <asgerf@github.com>
2023-03-02 22:14:17 +01:00
Alex Denisov
ffcb382705 Swift: only consider Builting and __ObjC declarations as lazy 2023-03-02 20:00:23 +01:00
github-actions[bot]
50c90bbc5c ATM: Update model pack dependency of ML-powered model building and query packs 2023-03-02 17:31:03 +00:00
Geoffrey White
764a52354e Merge pull request #12367 from geoffw0/nsstring2
Swift: Additional NSString taint test cases
2023-03-02 15:56:15 +00:00
Michael B. Gale
75b4a0e8ea Add diagnostic checks to all integration tests 2023-03-02 15:25:49 +00:00
Paolo Tranquilli
162b995428 Swift: turn on QLdoc check 2023-03-02 16:16:12 +01:00
Anders Schack-Mulligen
b34f99f716 Dataflow: Add change notes. 2023-03-02 16:01:29 +01:00
Michael B. Gale
6c501d15b6 Make diagnostics visible everywhere 2023-03-02 14:53:53 +00:00
erik-krogh
88810420b1 add location to the parse-error diagnostics 2023-03-02 14:54:58 +01:00
erik-krogh
c460eae2e1 implement diagnostics 2023-03-02 14:54:54 +01:00
Jeroen Ketema
f6ce27075c C++: Address review comments 2023-03-02 14:32:49 +01:00
Anders Schack-Mulligen
a498ab241b Go: Fix query. 2023-03-02 13:53:37 +01:00
Mathias Vorreiter Pedersen
a1a2d7c469 Merge pull request #12355 from geoffw0/splittest
Swift: Split the taint flow test.
2023-03-02 12:53:07 +00:00
Geoffrey White
27ec36298f Swift: Understand binary pointwise operations. 2023-03-02 12:42:34 +00:00
Geoffrey White
ec2c58b416 Swift: Understand overflow binary bitwise operations. 2023-03-02 12:11:25 +00:00
Geoffrey White
1206b73d87 Swift: Understand overflow binary arithmetic operations. 2023-03-02 12:11:15 +00:00
Michael B. Gale
fd9b279ef9 Merge pull request #12217 from github/mbg/csharp/tsp-support 2023-03-02 11:47:30 +00:00
Geoffrey White
53f52df809 Swift: Add taint test cases for overflow, bitwise and pointwise arithmetic operations. 2023-03-02 11:41:31 +00:00
Geoffrey White
c42add2191 Swift: Add test cases for overflow and pointwise binary arithmetic operations. 2023-03-02 11:28:59 +00:00
Jeroen Ketema
7ce230af77 Update docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-03-02 11:58:29 +01:00
Geoffrey White
730532f96a Swift: Add some (limited) test coverage for NSString <-> Data conversion. 2023-03-02 10:33:57 +00:00
Geoffrey White
1332309f59 Swift: Add some (limited) test coverage for String <-> NSString conversions. 2023-03-02 10:33:57 +00:00
Mathias Vorreiter Pedersen
c2efb4d232 Merge pull request #12350 from MathiasVP/no-standard-order-for-convertsIntoArgumentRev
C++: Disable a bad standard order
2023-03-02 10:27:20 +00:00
Arthur Baars
9e5ef9cf9d Merge pull request #12216 from aibaars/diagnostics-2
Ruby: improve diagnostic messages
2023-03-02 10:30:58 +01:00
Kasper Svendsen
9cac4bbe0f ActionController: Prevent bad join 2023-03-02 10:02:08 +01:00
Tony Torralba
7705d5f513 Merge pull request #12357 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-03-02 09:30:38 +01:00
Michael Nebel
2525ac3dd2 C#: Use dependency injection in the auto builder for Diagnostic classifier. 2023-03-02 09:18:56 +01:00
Jeroen Ketema
87f0f1fb33 C++: Fix description of asIndirectExpr and asParameter\1 in docs 2023-03-02 09:08:38 +01:00
github-actions[bot]
3b9de22af9 Add changed framework coverage reports 2023-03-02 00:18:47 +00:00
Geoffrey White
8e069b7686 Swift: Split the taint flow test. 2023-03-01 20:45:46 +00:00
yoff
65acf16ecc Merge pull request #12320 from yoff/python/document-api-call-node
Python: Document `API::CallNode`
2023-03-01 20:19:30 +01:00
Jeroen Ketema
c6dc55ef9b C++: Update use-use dataflow docs to reflect what is going on in the library 2023-03-01 19:00:33 +01:00
Geoffrey White
bf6f6eec34 Merge pull request #12225 from geoffw0/nsstring
Swift: Taint models for NSString
2023-03-01 16:30:06 +00:00
Tony Torralba
59bd1e5ab1 Merge pull request #12228 from github/java/mad-decls-triage-request-2276
Java: Update MaD sink decls after triage
2023-03-01 17:08:38 +01:00
Geoffrey White
f8079056ec Swift: Fix test on Linux. 2023-03-01 15:47:30 +00:00
erik-krogh
6cd4cd332d remove redundant imports 2023-03-01 16:25:01 +01:00
Mathias Vorreiter Pedersen
2f8d71762c C++: Disable standard order for 'convertsIntoArgumentRev'. 2023-03-01 15:16:49 +00:00
Michael B. Gale
93a45fce5e Simplify DiagnosticClassifier in CSharpAutobuilder 2023-03-01 14:58:49 +00:00
Alex Denisov
276fec39fc Swift: consider lazy declaration emitted if the process lost in the race 2023-03-01 15:42:44 +01:00
Asger F
b6ec9464eb JS: Remove trailing whitespace 2023-03-01 15:29:51 +01:00
Alex Denisov
ded0e570b0 Swift: extract lazy declarations 2023-03-01 15:22:22 +01:00
AlexDenisov
fed504c1d0 Merge pull request #12348 from github/alexdenisov/extract-emission-body-decisions
Swift: move decision making out of dispatcher. NFC
2023-03-01 15:18:44 +01:00
Alex Denisov
8194fe3743 Swift: do not make module depend on itself for linkage awareness 2023-03-01 14:30:06 +01:00
Paolo Tranquilli
37438599de Merge branch 'main' into alexdenisov/extract-emission-body-decisions 2023-03-01 13:47:12 +01:00
Paolo Tranquilli
c0f9b111a0 Merge pull request #12347 from github/alexdenisov/move-location-extraction
Swift: move location extraction logic into a separate class. NFC
2023-03-01 13:46:52 +01:00
Asger F
e09975f853 JS: Replace 'remote-flow' kind with 'remote' 2023-03-01 13:46:13 +01:00
Anders Schack-Mulligen
34cc93846b Python: Adjust InsecureProtocol query. 2023-03-01 13:36:10 +01:00
Arthur Baars
2c611d3fef Address review comments 2023-03-01 13:30:02 +01:00
Michael Nebel
2db588f72e Merge pull request #12322 from michaelnebel/csharp/operatorexplicitinterface
C# 11: Support for explicit interface implementations of operators.
2023-03-01 12:55:21 +01:00
erik-krogh
31336b09c4 add summary for the Array method on Kernel 2023-03-01 12:53:13 +01:00
Erik Krogh Kristensen
64dad3db8a Merge pull request #12333 from kaspersv/kaspersv/fix-join-order
ReflectedXss: Prevent bad join order
2023-03-01 12:48:30 +01:00
Mathias Vorreiter Pedersen
0469df1c18 Merge pull request #12338 from MathiasVP/expr-sanitizer-for-exec-tainted
C++: Speedup `cpp/command-line-injection`
2023-03-01 11:40:05 +00:00
AlexDenisov
5701798f1c Merge branch 'main' into alexdenisov/move-location-extraction 2023-03-01 12:24:41 +01:00
AlexDenisov
bb8d195607 Merge pull request #12337 from github/alexdenisov/extract-mangler
Swift: extract mangler into a separate class. NFC
2023-03-01 12:23:24 +01:00
Alex Denisov
def9831180 Swift: move decision making out of dispatcher 2023-03-01 12:02:58 +01:00
Alex Denisov
b1aef82117 Swift: move location extraction logic into a separate class 2023-03-01 11:32:50 +01:00
Tom Hvitved
16fa8b2914 Merge pull request #12051 from hmac/actioncontroller-filter-flow-steps
Ruby: flow steps for ActionController filters
2023-03-01 10:51:09 +01:00
Michael Nebel
ad5a45e465 C#: Add change note. 2023-03-01 10:42:29 +01:00
Michael Nebel
477b4566ed C#: Update expected test output. 2023-03-01 10:42:29 +01:00
Michael Nebel
f209eed91c C#: Extractor- and library support for explicit interface implementations for operators. 2023-03-01 10:42:28 +01:00
Michael Nebel
51be175111 C#: Add public members testcase and expected output. 2023-03-01 10:42:28 +01:00
Michael Nebel
363dd49a3c C#: Add explicit interface implementation examples and update expected test output. 2023-03-01 10:42:28 +01:00
Michael Nebel
0dc6ada616 Merge pull request #12234 from michaelnebel/csharp/filescopedtypes
C# 11: Support for `file` scoped types.
2023-03-01 10:39:46 +01:00
Geoffrey White
b6db0de437 Swift: Add inline expectation results. 2023-03-01 09:26:30 +00:00
Geoffrey White
228c0e221d Merge branch 'main' into nsstring 2023-03-01 09:12:36 +00:00
Geoffrey White
11e0efee68 Merge pull request #12308 from geoffw0/taintplusequals2
Swift: Model assignment operators (+= etc)
2023-03-01 09:02:29 +00:00
Tony Torralba
0439eb640d Add tests 2023-03-01 09:49:28 +01:00
Tony Torralba
4e7dbbf5f0 Add stubs 2023-03-01 09:48:33 +01:00
Tom Hvitved
92359e539b Fix another bad join
Before
```
[2023-03-01 08:19:51] Evaluated non-recursive predicate Filters#b57b2328::Filters::selfPostUpdate#2#ff@6718c917 in 6751ms (size: 83265).
Evaluated relational algebra for predicate Filters#b57b2328::Filters::selfPostUpdate#2#ff@6718c917 with tuple counts:
         3872025  ~3%    {2} r1 = JOIN _CfgNodes#ace8e412::ExprCfgNode::getExpr#0#dispred#ff_DataFlowPrivate#462ff392::Cached::TExprNode#ff#shared WITH Statement#f35022d0::Stmt::getCfgScope#0#dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1
         3637917  ~0%    {2} r2 = JOIN r1 WITH Method#8b49e67f::Callable#f ON FIRST 1 OUTPUT Lhs.0, Lhs.1
          679799  ~0%    {2} r3 = JOIN r2 WITH Method#8b49e67f::Method#ff ON FIRST 1 OUTPUT Lhs.0, Lhs.1
         3069328  ~0%    {3} r4 = JOIN r3 WITH Variable#1965ffe5::Variable::getDeclaringScope#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0
        22039083  ~0%    {3} r5 = JOIN r4 WITH Variable#1965ffe5::VariableAccess::getVariable#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
        10051483  ~0%    {3} r6 = JOIN r5 WITH Variable#9f7d933a::SelfVariableAccessImpl#class#f ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2
        10057538  ~5%    {3} r7 = JOIN r6 WITH CfgNodes#ace8e412::ExprCfgNode::getExpr#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
        10057538  ~5%    {3} r8 = JOIN r7 WITH CfgNodes#ace8e412::ExprNodes::SelfVariableAccessCfgNode#ff ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2
        10057538  ~0%    {3} r9 = JOIN r8 WITH DataFlowPrivate#462ff392::Cached::TExprNode#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
        10033937  ~1%    {3} r10 = JOIN r9 WITH DataFlowPublic#e1781e31::PostUpdateNode::getPreUpdateNode#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
           83281  ~2%    {2} r11 = JOIN r10 WITH DataFlowPublic#e1781e31::PostUpdateNode::getPreUpdateNode#0#dispred#ff ON FIRST 2 OUTPUT Lhs.0, Lhs.2
                         return r11
```

After
```
[2023-03-01 08:31:20] Evaluated non-recursive predicate Filters#b57b2328::Filters::selfPostUpdate#2#ff@06d73c6q in 161ms (size: 83265).
Evaluated relational algebra for predicate Filters#b57b2328::Filters::selfPostUpdate#2#ff@06d73c6q with tuple counts:
         23680  ~2%    {1} r1 = SCAN Method#8b49e67f::Method#ff OUTPUT In.0
         23680  ~2%    {1} r2 = STREAM DEDUP r1
         23680  ~0%    {2} r3 = JOIN r2 WITH Method#8b49e67f::Callable#f ON FIRST 1 OUTPUT Lhs.0, Lhs.0
         54790  ~4%    {3} r4 = JOIN r3 WITH Variable#1965ffe5::Variable::getDeclaringScope#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0
        202490  ~0%    {3} r5 = JOIN r4 WITH Variable#1965ffe5::VariableAccess::getVariable#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
         98332  ~5%    {3} r6 = JOIN r5 WITH Variable#9f7d933a::SelfVariableAccessImpl#class#f ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2
         83491  ~1%    {2} r7 = JOIN r6 WITH Statement#f35022d0::Stmt::getCfgScope#0#dispred#ff ON FIRST 2 OUTPUT Lhs.0, Lhs.2
         83584  ~0%    {2} r8 = JOIN r7 WITH CfgNodes#ace8e412::ExprCfgNode::getExpr#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1
         83584  ~0%    {2} r9 = JOIN r8 WITH DataFlowPrivate#462ff392::Cached::TExprNode#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1
         83265  ~2%    {2} r10 = JOIN r9 WITH DataFlowPublic#e1781e31::PostUpdateNode::getPreUpdateNode#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1
                       return r10
```
2023-03-01 08:34:07 +01:00
Aditya Sharad
aa6c60abfc Merge pull request #12342 from github/codeql-cli-2.12.3-mergeback
Mergeback: codeql-cli-2.12.3 into main
2023-02-28 10:30:51 -08:00
Felicity Chapman
6224d6ce31 Merge branch 'codeql-cli-2.12.3' into codeql-cli-2.12.3-mergeback 2023-02-28 17:08:49 +00:00
Mathias Vorreiter Pedersen
a96145a4ac Merge pull request #12340 from MathiasVP/remove-uncertain-write-def-input-predicate
C++: Remove dead code
2023-02-28 17:07:17 +00:00
Mathias Vorreiter Pedersen
d5b0ad6bfc C++: Remove cached predicate that's no longer used. 2023-02-28 16:20:29 +00:00
Michael B. Gale
49039246e1 Apply ql-for-ql suggestion 2023-02-28 15:55:50 +00:00
Michael B. Gale
f22c86442e Fix expected test output for Windows tests 2023-02-28 15:53:52 +00:00
Jeroen Ketema
2f797fffc1 C++: Add copy of dataflow docs for new use-use dataflow library 2023-02-28 16:48:26 +01:00
Michael B. Gale
fea29d5172 Refactor to avoid public setters 2023-02-28 15:22:36 +00:00
Erik Krogh Kristensen
f3f5f6eacf Merge pull request #12190 from erik-krogh/fix-erb
JS: Actually extract `.html.erb` files.
2023-02-28 16:11:32 +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
Mathias Vorreiter Pedersen
075a83c987 Stage stats before on 'ExecTainted.ql' before:
```
1	10	1 Fwd	609968	1398	-1	94	769936	ExecTaintConfiguration
2	15	1 Rev	239464	774	-1	52	320663	ExecTaintConfiguration
3	20	2 Fwd	205794	511	650	39	18576546	ExecTaintConfiguration
4	25	2 Rev	161966	351	428	39	13639502	ExecTaintConfiguration
5	30	3 Fwd	31889	322	791	39	5982574	ExecTaintConfiguration
6	35	3 Rev	30068	303	661	39	4181421	ExecTaintConfiguration
7	40	4 Fwd	24031	232	1432	39	14725618	ExecTaintConfiguration
8	45	4 Rev	21506	219	907	39	5962780	ExecTaintConfiguration
9	50	5 Fwd	20149	204	1527	38	8350094	ExecTaintConfiguration
10	55	5 Rev	20102	204	1472	38	7515307	ExecTaintConfiguration
11	60	6 Fwd	19950	200	904	33	9673369	ExecTaintConfiguration
12	65	6 Rev	18431	200	901	33	7030957	ExecTaintConfiguration
```

Stage stats after:
```
1	10	1 Fwd	368610	699	-1	65	445199	ExecTaintConfiguration
2	15	1 Rev	112848	336	-1	23	150522	ExecTaintConfiguration
3	20	2 Fwd	91528	219	270	22	4120713	ExecTaintConfiguration
4	25	2 Rev	66017	141	159	22	2657398	ExecTaintConfiguration
5	30	3 Fwd	12161	119	208	22	792468	ExecTaintConfiguration
6	35	3 Rev	11640	111	167	22	569193	ExecTaintConfiguration
7	40	4 Fwd	11423	109	331	22	1203871	ExecTaintConfiguration
8	45	4 Rev	10851	107	323	22	904017	ExecTaintConfiguration
9	50	5 Fwd	10694	107	763	22	2428404	ExecTaintConfiguration
10	55	5 Rev	10332	104	735	22	2355698	ExecTaintConfiguration
11	60	6 Fwd	10302	104	729	22	5772762	ExecTaintConfiguration
12	65	6 Rev	9482	102	725	22	4020951	ExecTaintConfiguration
```
2023-02-28 15:05:29 +00:00
Mathias Vorreiter Pedersen
8dd0bdbdb0 C++: Rename 'fst' and 'snd' to 'incoming' and 'outgoing'. 2023-02-28 15:05:18 +00:00
Felicity Chapman
770326e770 Merge pull request #12321 from github/fc-7775-docs-update
CodeQL extension for VS Code docs update
2023-02-28 14:59:46 +00:00
Jeroen Ketema
5845528bae Merge pull request #12336 from jketema/docs-examples
C++: Add tests for all dataflow examples that occur in our docs
2023-02-28 15:45:46 +01:00
Alex Denisov
97d5401118 Swift: extract mangler into a separate class 2023-02-28 15:29:44 +01:00
Michael B. Gale
e3762c7f93 Move Language class to Semmle.Util 2023-02-28 14:16:33 +00:00
Felicity Chapman
a7d221cdab Update docs/codeql/reusables/beta-note-mrva.rst 2023-02-28 14:12:57 +00:00
Michael B. Gale
e60676fbde Fix IDisposable contract violation 2023-02-28 13:56:06 +00:00
Jeroen Ketema
3014f207f3 C++: Add tests for all dataflow examples that occur in our docs 2023-02-28 14:45:00 +01:00
Mathias Vorreiter Pedersen
484f761c6d Merge pull request #12316 from MathiasVP/no-taint-indirect-direct-conflation
C++: Remove indirect -> direct taint-flow
2023-02-28 13:43:04 +00:00
Anders Schack-Mulligen
5469a82efb Go,Java,Python: Fix some tests. 2023-02-28 14:31:00 +01:00
Michael Nebel
734001b7c4 Merge pull request #12334 from michaelnebel/csharp/staticinitialisers
C#: Update query to handle static field writes from properties.
2023-02-28 14:10:46 +01:00
Geoffrey White
d5952a174e Merge pull request #12329 from geoffw0/network
Swift: Modernize the cleartext-* queries
2023-02-28 13:04:10 +00:00
Michael Nebel
51746627d2 C#: Address review comments. 2023-02-28 13:38:34 +01:00
Felicity Chapman
aba7440293 Update docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2023-02-28 12:29:16 +00:00
Felicity Chapman
832dc27b08 Update docs/codeql/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva.rst
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2023-02-28 12:22:26 +00:00
Michael Nebel
4ef866b3a3 C#: Add change note. 2023-02-28 13:21:31 +01:00
Michael Nebel
baea74fa1b C#: Add new testexamples and update expected testoutput. 2023-02-28 13:21:31 +01:00
Michael Nebel
621674e82e C#: Update cs/static/field-written-by-instance to handle properties. 2023-02-28 13:21:30 +01:00
Chris Smowton
687f3c6b2e Merge pull request #12330 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-02-28 11:27:00 +00:00
Felicity Chapman
0af529ed7b Apply suggestions from code review
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2023-02-28 11:12:29 +00:00
Kasper Svendsen
86925646f3 ReflectedXss: Prevent bad join order 2023-02-28 12:06:27 +01:00
Mathias Vorreiter Pedersen
d93d22ba3e C++: Fix FPs in 'cpp/non-constant-format'. 2023-02-28 10:05:05 +00:00
Michael Nebel
2db3694015 C#: Add code comment explaining the exclusion of the declared accessibility extraction for file scoped types. 2023-02-28 11:02:38 +01:00
Mathias Vorreiter Pedersen
1e5b235f4b C++: Accept test changes in 'cpp/non-constant-format'. These are actually FPs. 2023-02-28 10:02:32 +00:00
Felicity Chapman
b21253732b Update for review feedback 2023-02-28 09:58:51 +00:00
Mathias Vorreiter Pedersen
85c7116e8f C++: Fix the following join (I canceled it mid-way):
```
Tuple counts for SsaInternals#7b362d2f::getAPriorDefinition#1#ff/2@bfabfc7o after 11.4s:
  1000      ~4%     {2} r1 = SCAN Ssa#da392372::Make#SsaInternals#7b362d2f::SsaInput#::Definition::definesAt#3#dispred#ffff OUTPUT In.1, In.0
  474321529 ~0%     {4} r2 = JOIN r1 WITH SsaInternals#7b362d2f::DefOrUse::hasIndexInBlock#3#dispred#ffff_3012#join_rhs ON FIRST 1 OUTPUT Lhs.1, Rhs.2, Rhs.3, Rhs.1
  0         ~0%     {2} r3 = JOIN r2 WITH SsaInternals#7b362d2f::SsaCached::lastRefRedef#4#ffff ON FIRST 3 OUTPUT Lhs.3, Rhs.3
  0         ~0%     {2} r4 = JOIN r3 WITH SsaInternals#7b362d2f::nodeToDefOrUse#3#fff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1, Rhs.1 'result'
  0         ~0%     {2} r5 = JOIN r4 WITH SsaInternals#7b362d2f::ssaDefinition#1#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'defOrUse', Lhs.1 'result'
                    return r5
```
2023-02-28 09:53:37 +00:00
Anders Schack-Mulligen
64c60d59b1 Go: Fix compilation. 2023-02-28 09:57:22 +01:00
github-actions[bot]
b6f81fc938 Add changed framework coverage reports 2023-02-28 00:17:14 +00:00
Mathias Vorreiter Pedersen
04b84320c9 C++: Accept more query-test changes. 2023-02-28 00:06:35 +00:00
Geoffrey White
5110cf1e02 Swift: Convert some fiddly GRDB database sinks to CSV. 2023-02-27 23:31:48 +00:00
Geoffrey White
f289811473 Swift: Fix and autoformat. 2023-02-27 23:01:05 +00:00
Geoffrey White
ea4c2e4321 Swift: Add CSV extension points. 2023-02-27 23:01:05 +00:00
Geoffrey White
c533334470 Swift: Implementation classes should be private. 2023-02-27 23:01:04 +00:00
Geoffrey White
c21ec1c3f5 Swift: Standardize the taint sources, sinks, sanitizers. 2023-02-27 23:01:04 +00:00
Geoffrey White
6928e62d8b Swift: Split the three sensitive exprs queries into separate QL and QLL files. 2023-02-27 23:01:04 +00:00
Geoffrey White
59a2aa817c Merge branch 'main' into nsstring 2023-02-27 22:34:04 +00:00
Geoffrey White
bb55456885 Merge branch 'main' into taintplusequals2 2023-02-27 22:33:26 +00:00
Ahmed Farid
6a578c62b0 Update TimingAttack.qll 2023-02-27 22:16:09 +01:00
Mathias Vorreiter Pedersen
3906a1923b Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into no-taint-indirect-direct-conflation 2023-02-27 18:40:04 +00:00
Mathias Vorreiter Pedersen
f9c724d9a3 Merge pull request #12325 from MathiasVP/gets-return-deref
C++: Make `gets` indirect output a LocalFlowSource
2023-02-27 18:39:36 +00:00
Arthur Baars
6c57823232 Merge branch 'main' into diagnostics-2 2023-02-27 19:00:03 +01:00
Jeroen Ketema
9c202f508f Merge pull request #12324 from jketema/taint-fix
C++: Use correct DataFlow import in new TaintTracking.qll
2023-02-27 18:37:46 +01:00
Geoffrey White
36a33bc718 Swift: Delete file that was resurrected by the merge. 2023-02-27 17:33:21 +00:00
Nick Rolfe
0f4df0da99 Merge pull request #12326 from RasmusWL/python-fix-expected
Python: Fix expected of call-graph after merge
2023-02-27 17:30:10 +00:00
erik-krogh
b0797a2559 Merge branch 'main' into more-shell-taint 2023-02-27 18:27:09 +01:00
Geoffrey White
296093ded6 Merge branch 'main' into nsstring 2023-02-27 17:26:57 +00:00
Mathias Vorreiter Pedersen
7bb806563f Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into no-taint-indirect-direct-conflation 2023-02-27 17:19:36 +00:00
Mathias Vorreiter Pedersen
d90d895944 Merge pull request #12323 from MathiasVP/fix-enclosing-callable
C++: Fix missing enclosing callables
2023-02-27 17:19:06 +00:00
Erik Krogh Kristensen
50aa5e072a Merge pull request #12177 from erik-krogh/alias-html
JS: More precise type-test sanitizer guards in unsafe-html-construction
2023-02-27 18:16:11 +01:00
Mathias Vorreiter Pedersen
2a9133aae0 C++: Accept query-test changes. 2023-02-27 17:15:53 +00:00
Mathias Vorreiter Pedersen
d628905156 C++: Accept more test changes. 2023-02-27 17:13:23 +00:00
Felicity Chapman
1d13811e46 Revise troubleshooting article 2023-02-27 16:42:07 +00:00
Rasmus Wriedt Larsen
d198b91c82 Python: Fix expected of call-graph after merge
Since the import resolution was fixed, but tests not rerun, these
expectations were not updated to reflect that we now handle them
properly 💪
2023-02-27 17:38:28 +01:00
Edward Minnix III
7f607fb46b Merge pull request #12032 from egregius313/egregius313/promote-hardcoded-jwt-credential
Java: Promote Hardcoded JWT credential query
2023-02-27 11:33:53 -05:00
Mathias Vorreiter Pedersen
a4c075f03b C++: The data pointed to by 'gets' is also a source of user input. 2023-02-27 16:25:32 +00:00
Jeroen Ketema
b4f6d519db C++: Use correct DataFlow import in new TaintTracking.qll
Using the IR version directly gives errors about conflicting imports if both
DataFlow and TaintTracking are imported.
2023-02-27 17:22:12 +01:00
Felicity Chapman
8e4eb9ad46 Tweaks to mention variant analysis in related articles 2023-02-27 16:21:09 +00:00
erik-krogh
505168f24b fix upper-case .html.erb files 2023-02-27 17:19:43 +01:00
Felicity Chapman
49ec539b60 Updates following initial PM review 2023-02-27 16:07:28 +00: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
Mathias Vorreiter Pedersen
b36d4931f2 C++: Fix test annotation. 2023-02-27 15:47:52 +00:00
Felicity Chapman
29802af647 Fix typo in heading 2023-02-27 15:06:19 +00:00
Mathias Vorreiter Pedersen
d2f8cb6920 Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into fix-enclosing-callable 2023-02-27 15:02:39 +00:00
Felicity Chapman
9bee9c003a Apply suggestions from code review
Co-authored-by: James Fletcher <42464962+jf205@users.noreply.github.com>
2023-02-27 14:58:17 +00:00
Mathias Vorreiter Pedersen
31f3504113 C++: Remove this bad materialization:
```
Evaluated relational algebra for predicate _CppType#d1355c92::CppType::hasUnspecifiedType#2#dispred#fff_10#join_rhs_SsaInternals#50208335::DefO__#shared@ec353boa with tuple counts:
  459594    ~0%     {2} r1 = JOIN _IRVariable#e9bf30b2::IRVariable::getAst#0#dispred#ff_Parameter#ed81dd8f::Parameter#f#shared WITH SsaInternalsCommon#3c4fa02d::BaseIRVariable::getIRVariable#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1 'arg1', Rhs.1
  461383    ~2%     {3} r2 = JOIN r1 WITH Variable#7a968d4e::Variable::getUnspecifiedType#0#dispred#ff ON FIRST 1 OUTPUT Lhs.0 'arg1', Lhs.1, Rhs.1
  477945    ~6%     {4} r3 = JOIN r2 WITH Variable#7a968d4e::Variable::getUnspecifiedType#0#dispred#ff ON FIRST 1 OUTPUT Lhs.2, Lhs.0 'arg1', Lhs.1, Rhs.1
  346338    ~2%     {4} r4 = JOIN r3 WITH SsaInternalsCommon#3c4fa02d::Indirection::getNumberOfIndirections#0#dispred#ff ON FIRST 1 OUTPUT Lhs.3, Lhs.1 'arg1', Lhs.2, Rhs.1 'arg2'
  178593374 ~0%     {4} r5 = JOIN r4 WITH CppType#d1355c92::CppType::hasUnspecifiedType#2#dispred#fff_10#join_rhs ON FIRST 1 OUTPUT Lhs.2, Lhs.1 'arg1', Lhs.3 'arg2', Rhs.1 'arg3'
  934806228 ~0%     {4} r6 = JOIN r5 WITH SsaInternals#50208335::DefOrUse::getSourceVariable#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'arg0', Lhs.1 'arg1', Lhs.2 'arg2', Lhs.3 'arg3'
                    return r6

Tuple counts for _DataFlowPrivate#fbdd7bd7::InstructionNode0#class#ff_SsaInternals#50208335::Def#ff_SsaInternals#5020__#antijoin_rhs/4@305d42l5 after 25.6s:
  180185672 ~0%     {4} r1 = JOIN _CppType#d1355c92::CppType::hasUnspecifiedType#2#dispred#fff_10#join_rhs_SsaInternals#50208335::DefO__#shared WITH SsaInternals#50208335::Def#ff ON FIRST 1 OUTPUT Lhs.0 'arg3', Lhs.1 'arg0', Lhs.2 'arg1', Lhs.3 'arg2'
  180185672 ~0%     {5} r2 = JOIN r1 WITH SsaInternals#50208335::Def::getValue#0#dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'arg0', Lhs.2 'arg1', Lhs.3 'arg2', Lhs.0 'arg3'
  180185672 ~0%     {5} r3 = JOIN r2 WITH DataFlowPrivate#fbdd7bd7::InstructionNode0#class#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'arg0', Lhs.2 'arg1', Lhs.3 'arg2', Lhs.4 'arg3'
  178459578 ~1%     {4} r4 = JOIN r3 WITH project#Instruction#577b6a83::InitializeParameterInstruction#ff ON FIRST 1 OUTPUT Lhs.1 'arg0', Lhs.2 'arg1', Lhs.3 'arg2', Lhs.4 'arg3'
                    return r4

Tuple counts for SsaInternals#7b362d2f::TFinalParameterUse#dom#ff/2@9ff4dbcg after 7.9s:
  180185672 ~1%         {4} r1 = JOIN _CppType#d1355c92::CppType::hasUnspecifiedType#2#dispred#fff_10#join_rhs_SsaInternals#50208335::DefO__#shared WITH SsaInternals#50208335::Def#ff ON FIRST 1 OUTPUT Lhs.1 'p', Lhs.2, Lhs.3, Lhs.0
  1726094   ~0%         {4} r2 = r1 AND NOT _DataFlowPrivate#fbdd7bd7::InstructionNode0#class#ff_SsaInternals#50208335::Def#ff_SsaInternals#5020__#antijoin_rhs(Lhs.0 'p', Lhs.1, Lhs.2, Lhs.3)
  1726094   ~54%        {4} r3 = SCAN r2 OUTPUT In.0 'p', In.1, In.2, 1
  1769636   ~54%        {5} r4 = JOIN r3 WITH PRIMITIVE range#bbf ON Lhs.3,Lhs.1

  1769636   ~45%        {4} r5 = SCAN r4 OUTPUT In.2, (In.4 'indirectionIndex' + 1), In.0 'p', In.4 'indirectionIndex'
  591253    ~11541%     {2} r6 = JOIN r5 WITH SsaInternalsCommon#3c4fa02d::isModifiableAtImpl#2#ff ON FIRST 2 OUTPUT Lhs.2 'p', Lhs.3 'indirectionIndex'

  1769636   ~52%        {4} r7 = SCAN r4 OUTPUT In.2, In.0 'p', In.4 'indirectionIndex', (In.4 'indirectionIndex' + 1)
  1724893   ~41%        {5} r8 = JOIN r7 WITH CppType#d1355c92::CppType::hasType#2#dispred#fff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'p', Lhs.0, Lhs.2 'indirectionIndex', Lhs.3
  1718843   ~46%        {5} r9 = JOIN r8 WITH Type#2e8eb3ef::Type::stripType#0#dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'p', Lhs.2, Lhs.3 'indirectionIndex', Lhs.4
  8608      ~0%         {5} r10 = JOIN r9 WITH SmartPointer#917721ba::SmartPtr#f ON FIRST 1 OUTPUT Lhs.1 'p', Lhs.2, Lhs.3 'indirectionIndex', Lhs.4, Lhs.0
  8608      ~0%         {5} r11 = r10 AND NOT PointerWrapper#7cc81d2d::PointerWrapper::pointsToConst#0#dispred#f(Lhs.4)
  8608      ~4986%      {2} r12 = SCAN r11 OUTPUT In.0 'p', In.2 'indirectionIndex'

  599861    ~11711%     {2} r13 = r6 UNION r12
                        return r13
```
2023-02-27 14:57:36 +00:00
Mathias Vorreiter Pedersen
354a12c906 C++: Fix queries. Since there's no longer indirect -> direct flow in
taint-tracking we need to make sure the affected sink definitions also
handle indirect flow.
2023-02-27 14:57:36 +00:00
Mathias Vorreiter Pedersen
1db24dd28d C++: Fix missing types. We now assign the node corresponding to **p
an `UnknownType`.
2023-02-27 14:57:36 +00:00
Mathias Vorreiter Pedersen
4e16bb65e3 C++: Accept test changes. Because we now allocate _three_ indirect nodes
for a value of type `void*` (i.e., `p`, `*p` and `**p`) we need to decide
on a type for the `**p` value. We will do this in the next commit.
2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
16ba4652af C++: Allocate an additional indirection for void pointers. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
f6b9ca3da6 C++: Add failing test. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
da4a059388 C++: Accept test changes. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
52e6e1dece C++: Fix flow through partial definitions. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
575ac46bf3 C++: Add failing test. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
b952f619db C++: Accept test changes. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
057e810122 C++: Fix flow through arrays. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
9d64c0a023 C++: Add failing test. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
1e4caca23a C++: Accept query changes. Nothing bad to see here. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
2cb4a554ea C++: Fix a bug in Expr <-> Node mapping. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
09df318e9e C++: Also track flow out of indirect sources. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
a806569b5f C++: The next commit is going to track flow out of both direct and indirect sources. This means we'll get a lot of duplication since there'll be flow from indirect source -> indirect sink and direct source -> direct sink (which both map to the same expressions). This commit changes the testing so that we only report a duplication when they're at different locations. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
5a8b900394 C++: Properly track smart pointer wrappers. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
64abf5b163 C++: Add conflation into DefaultTaintTracking. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
b951bf0f8f C++: Remove conflation from taint-tracking. 2023-02-27 14:57:35 +00:00
Mathias Vorreiter Pedersen
a5bb093935 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-02-27 14:57:06 +00:00
Erik Krogh Kristensen
927c322b7b Merge pull request #11769 from erik-krogh/moreSan
JS: Sanitizer for `sanitizer(x) === true`
2023-02-27 15:48:34 +01:00
Mathias Vorreiter Pedersen
332b759873 Merge pull request #12275 from jketema/uniform-ssa
Make "Detecting a potential buffer overflow" example more uniform
2023-02-27 14:38:11 +00:00
Mathias Vorreiter Pedersen
1dd95a61c1 Merge pull request #12292 from github/calumgrant/aggregate-domain
Query and tests for sum without domain
2023-02-27 14:19:20 +00:00
Mathias Vorreiter Pedersen
7437de2909 C++: Fix issue where 'getEnclosingCallable' didn't exist for some globals. 2023-02-27 14:06:13 +00:00
Tony Torralba
db6cb1ffe3 Remove dubious model after investigating it 2023-02-27 14:57:56 +01:00
yoff
335be21943 Update docs/codeql/codeql-language-guides/using-api-graphs-in-python.rst
Co-authored-by: Taus <tausbn@github.com>
2023-02-27 14:53:31 +01:00
Taus
25043f51a4 Merge pull request #11376 from RasmusWL/call-graph-code
Python: New type-tracking based call-graph
2023-02-27 14:51:21 +01:00
Anders Schack-Mulligen
9671c8824c C#: Remove reference to stageStats. 2023-02-27 14:30:05 +01:00
Anders Schack-Mulligen
7e3e10c34b C/C++: Remove reference to Partial Flow. 2023-02-27 14:30:05 +01:00
Anders Schack-Mulligen
bf650c755c Dataflow: Sync changes to all languages. 2023-02-27 14:30:05 +01:00
Paolo Tranquilli
5cb3279816 Merge pull request #12319 from github/redsun82/swift-codegen
Codegen: make Swift codegen language agnostic
2023-02-27 14:06:20 +01:00
Felicity Chapman
70ed029d0e More updates 2023-02-27 12:41:53 +00:00
Alex Ford
7c85448cba Merge pull request #12080 from alexrford/js-use-shared-cryptography
JS: Use shared `CryptographicOperation` concept
2023-02-27 12:26:38 +00:00
Tony Torralba
0e3f4f6c7c Merge pull request #12305 from pwntester/new_java_net_URL_toURI_taintstep
Java: Add new java.net.URI taintsteps
2023-02-27 13:09:46 +01:00
Geoffrey White
8ef6521cc9 Swift: Undo toString changes. 2023-02-27 12:01:02 +00:00
Ed Minnix
ed1aac1aa5 Remove unneeded example file 2023-02-27 12:16:14 +01:00
Ed Minnix
06a1368e7c Additional test cases 2023-02-27 12:16:14 +01:00
Ed Minnix
4aec708fac Add change note 2023-02-27 12:16:14 +01:00
Ed Minnix
6de946ef00 Remove experimental files 2023-02-27 12:16:14 +01:00
Ed Minnix
3ff1a97e38 Add byte[] signatures 2023-02-27 12:16:14 +01:00
Ed Minnix
d71386e001 Add example file for documentation 2023-02-27 12:16:14 +01:00
Ed Minnix
fa6ac063d1 Add com.auth0.jwt.algorithm.Algorithm sinks
The HMAC* constructors of the com.auth0.jwt.algorithm.Algorithm class
take a secret as a parameter. Therefore, the arguments should be added
to be checked for hardcoded credentials.
2023-02-27 12:16:14 +01:00
AlexDenisov
85bf10ee0f Merge pull request #12227 from github/redsun82/swift-5.7.3
Swift: update to 5.7.3
2023-02-27 10:24:07 +01:00
Rasmus Lerchedahl Petersen
1447c2348a python: describe API::CallNode 2023-02-27 10:06:23 +01:00
Paolo Tranquilli
1218145259 Codegen: update README.md files 2023-02-27 10:01:50 +01:00
Paolo Tranquilli
06a6450be4 Codegen: make --qltest-output optional 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
cdd4e8021b Move swift/codegen to misc/codegen 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
6d192cdcc1 Swift: make C++ code generation language agnostic 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
feb4e60c4b Swift: make all ql generation language agnostic 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
aca18f5da8 Swift: make codegen use a config file 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
e4627cb702 Swift: make codegen a bit more language-agnostic 2023-02-27 09:46:48 +01:00
Tony Torralba
c027e10ef7 Add java.net tests 2023-02-27 09:33:16 +01:00
Tony Torralba
4a9f63ea1a Fix toASCIIString casing 2023-02-27 09:32:42 +01:00
erik-krogh
0e60fc5512 Merge branch 'main' into alias-html 2023-02-27 09:16:25 +01:00
Erik Krogh Kristensen
f8f926ad50 Merge pull request #12175 from erik-krogh/reg-input
JS: add process.env and process.argv etc. as source for `js/regex-injection`
2023-02-27 09:12:02 +01:00
Rasmus Lerchedahl Petersen
9b08b06de4 python: update deprecated predicate names 2023-02-27 09:07:07 +01:00
Erik Krogh Kristensen
4ffe20ae75 Merge pull request #12189 from erik-krogh/more-export
JS: also consider relative exports when finding library inputs
2023-02-27 09:02:55 +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
Felicity Chapman
8af12071e1 First draft with bare bones 2023-02-24 21:39:16 +00:00
Geoffrey White
e71c7e7842 Swift: Autoformat. 2023-02-24 19:09:14 +00:00
Geoffrey White
a5943603ea Swift: 'Any' -> 'An' (make QL-for-QL happy) 2023-02-24 19:08:11 +00:00
Alvaro Muñoz
f393a3c549 Add toExternalForm 2023-02-24 18:50:31 +01:00
Alvaro Muñoz
f1d765aa27 Missing taintstep for java.net.URL.toURI() 2023-02-24 18:45:52 +01:00
Felicity Chapman
874c362961 Add basic framework of new articles 2023-02-24 17:14:49 +00:00
Michael B. Gale
e2af8f1b43 Simplify Xamarin query to be platform-independent 2023-02-24 17:13:10 +00:00
Alex Ford
a54ca38e31 Ruby: DataFlow::CallableNode extends DataFlow::StmtSequenceNode 2023-02-24 16:40:35 +00:00
Alex Ford
e948e22186 Ruby: all Exprs have a corresponding DataFlow::Node that is more specific than just DataFlow::ExprNode 2023-02-24 16:40:35 +00:00
Michael B. Gale
31673431af Add test for missing Xamarin SDKs 2023-02-24 16:24:32 +00:00
Michael B. Gale
3ef3441883 Add test for missing project files 2023-02-24 16:24:07 +00:00
Michael B. Gale
354f716ca8 Add test for dotnet incompatible projects 2023-02-24 16:23:52 +00:00
Michael B. Gale
430af661cd Show .NET core error only if files exist 2023-02-24 16:16:33 +00:00
Mathias Vorreiter Pedersen
f92433171d Merge pull request #12304 from MathiasVP/more-fixes-to-large-join-order-query
QL: More fixes to the join-order query
2023-02-24 14:21:05 +00:00
Michael B. Gale
b203533fc6 Fix C++ test missing env var 2023-02-24 14:16:20 +00:00
Michael B. Gale
7de26550ad Add tests for build script diagnostics 2023-02-24 13:49:06 +00:00
Michael B. Gale
bdbcaab0ba Use relative paths 2023-02-24 13:49:06 +00:00
Michael B. Gale
1e2329d0dd Add diagnostic for missing project files 2023-02-24 13:49:05 +00:00
Michael B. Gale
3bf6b6f96f Add helper for markdown lists of projects 2023-02-24 13:49:05 +00:00
Mathias Vorreiter Pedersen
c9f8ebd620 QL: Remove redundant conjunct in aggregates. 2023-02-24 13:19:52 +00:00
Mathias Vorreiter Pedersen
375de59a14 QL: More fixes to the join-order query. 2023-02-24 12:44:17 +00:00
Calum Grant
10aad99e21 Add avg case 2023-02-24 11:02:07 +00:00
Grzegorz Niedziela
48007d14d5 move tests to experimental as well and fix .qlref reference 2023-02-24 10:38:21 +00:00
Tom Hvitved
af14f36127 Merge pull request #12289 from hvitved/util/file-system
Util: Add shared file system implementation
2023-02-24 11:23:48 +01:00
Chris Smowton
da459c4086 Merge pull request #12281 from smowton/smowton/feature/kotlin-too-new-diagnostic
Add test for a too-new Kotlin version
2023-02-24 08:48:30 +00:00
Mathias Vorreiter Pedersen
95283154ae Merge pull request #12303 from MathiasVP/join-order-query-fixes 2023-02-23 22:56:29 +00:00
Mathias Vorreiter Pedersen
1f40518c78 QL: Fixup the join-order query. 2023-02-23 22:39:20 +00:00
Mathias Vorreiter Pedersen
a86a8ced54 Merge pull request #12302 from MathiasVP/recursive-join-order-metric
QL: Extend the join-order badness query to recursive predicates
2023-02-23 22:35:35 +00:00
Mathias Vorreiter Pedersen
f0fe6fba88 QL: Accept test changes. 2023-02-23 22:25:04 +00:00
Mathias Vorreiter Pedersen
b0e391cff0 QL: Extend the join order metric to cover recursive predicates. 2023-02-23 22:12:23 +00:00
Mathias Vorreiter Pedersen
bb692a7e4a Merge pull request #12299 from github/calumgrant/qlql
Add classes and predicates to StructuredLogs
2023-02-23 21:47:28 +00:00
Calum Grant
41d88a45d9 Fix merge 2023-02-23 21:02:43 +00:00
Calum Grant
efa2647f09 Merge branch 'main' into calumgrant/qlql 2023-02-23 20:55:09 +00:00
Taus
b993b5ef77 Merge pull request #12298 from MathiasVP/join-order-metric-query-with-more-rows
QL: Output more rows in the join order query
2023-02-23 20:31:43 +01:00
Taus
6141c96b8c Merge pull request #12294 from MathiasVP/visit-recursive-evaluation
QL: Add a visitor for traversing recursive evaluations
2023-02-23 20:28:53 +01:00
Henry Mercer
39a30cf34b Merge pull request #12297 from github/codeql-ci/atm/release-0.4.8
JS: Bump version numbers of ML-powered packs after 0.4.8 release
2023-02-23 19:18:28 +00:00
Mathias Vorreiter Pedersen
9ee078d1f2 QL: More column information. 2023-02-23 19:17:22 +00:00
Calum Grant
dde18de2d1 Fixes 2023-02-23 19:03:05 +00:00
Calum Grant
196dbd3a33 Exploratory query to test the API 2023-02-23 19:01:52 +00:00
Calum Grant
77871e287d Use RAExpr 2023-02-23 18:35:24 +00:00
Calum Grant
e368b8f72a Add classes and predicates to StructuredLogs 2023-02-23 17:48:21 +00:00
Mathias Vorreiter Pedersen
229e291e1b QL: Fix naming. 2023-02-23 17:34:07 +00:00
Mathias Vorreiter Pedersen
dcc9b66aae Merge branch 'main' into visit-recursive-evaluation 2023-02-23 17:16:47 +00:00
Mathias Vorreiter Pedersen
9c8b8dff88 QL: Output more rows in the join order query. 2023-02-23 17:07:27 +00:00
Mathias Vorreiter Pedersen
48bf15f79c Merge pull request #12291 from github/calumgrant/slow-predicates
Slow predicates query
2023-02-23 16:41:39 +00:00
Mathias Vorreiter Pedersen
11ea8e0f85 Merge pull request #12295 from MathiasVP/join-order-metric-query
QL: Non-recursive join-order-metric query
2023-02-23 16:40:07 +00:00
Geoffrey White
1a7e7481b2 Swift: Add flow thtaint flow through assignments other than =. 2023-02-23 16:25:32 +00:00
Geoffrey White
a222757e69 Swift: Add support for pointwise assignment operators. 2023-02-23 16:25:32 +00:00
Geoffrey White
15e3892b03 Swift: Add support for overflow assignment operators. 2023-02-23 16:25:32 +00:00
Geoffrey White
1d4925d7af Swift: Expand assignment operations. 2023-02-23 16:25:31 +00:00
Henry Mercer
eb1fe57590 Merge branch 'main' into codeql-ci/atm/release-0.4.8 2023-02-23 16:23:32 +00:00
github-actions[bot]
7e2b286f03 JS: Bump version of ML-powered library and query packs to 0.4.9 2023-02-23 16:12:23 +00:00
github-actions[bot]
e02368f6fa JS: Bump patch version of ML-powered library and query packs 2023-02-23 16:04:39 +00:00
Mathias Vorreiter Pedersen
858b3de547 Merge branch 'main' into join-order-metric-query 2023-02-23 15:54:38 +00:00
Mathias Vorreiter Pedersen
23b9abcbbf QL: Add a query for finding the predicates with the highest tuple sums. 2023-02-23 15:53:32 +00:00
Mathias Vorreiter Pedersen
7595c1c306 QL: Add a visitor for traversing recursive evaluations. 2023-02-23 15:53:32 +00:00
Taus
d48938d168 Merge branch 'main' into calumgrant/slow-predicates 2023-02-23 16:53:04 +01:00
Taus
0419b5b24c Merge pull request #12296 from github/tausbn/ql-remove-unused-predicates
QL: Remove unused predicates
2023-02-23 16:47:34 +01:00
Taus
38ca4a8d3d QL: Remove unused predicates 2023-02-23 15:25:38 +00:00
Michael B. Gale
b034b2f2a3 Refactor autobuild logic into an IBuildRule 2023-02-23 14:54:37 +00:00
Chris Smowton
eb8a0c1129 Add test for a too-new Kotlin version 2023-02-23 14:53:27 +00:00
Mathias Vorreiter Pedersen
d7d9bea5e8 QL: Add a query for computing the join order metric for non-recursive predicates. 2023-02-23 14:27:39 +00:00
Geoffrey White
71813fa0a7 Swift: Implement full tree of Assignment classes 2023-02-23 13:23:36 +00:00
Geoffrey White
aaa89f7f32 Swift: Add a test for assignment exprs. 2023-02-23 13:15:06 +00:00
Mathias Vorreiter Pedersen
d734982e7b Merge pull request #12286 from github/tausbn/ql-add-a-bunch-of-convenience-predicates
QL: Add predicates for timestamps and locations
2023-02-23 12:45:46 +00:00
Calum Grant
fccf2d705e Add the expected file 2023-02-23 12:25:29 +00:00
Calum Grant
6cf575df78 Query and tests for sum without domain 2023-02-23 12:19:25 +00:00
gregxsunday
34b441c3cc move query to experimental folder 2023-02-23 12:12:04 +00:00
gregxsunday
5a85fa12c7 add block test cases and update tests 2023-02-23 12:09:22 +00:00
gregxsunday
f9b5846675 add detection of sources directly used with blocks 2023-02-23 12:09:12 +00:00
Grzegorz Niedziela
4ab6a7bdfd Merge branch 'github:main' into main 2023-02-23 10:50:15 +00:00
Calum Grant
564d7c0d53 Fix bug 2023-02-23 10:22:18 +00:00
Calum Grant
eb553266ae Add this. 2023-02-23 09:51:29 +00:00
Calum Grant
58563744d6 A simple query 2023-02-23 09:50:09 +00:00
Tom Hvitved
ad37523b07 C#: Adopt shared file system implementation 2023-02-23 10:21:04 +01:00
Tom Hvitved
bd5ae88a9a Ruby: Move FileSystem.qll implementation into shared util pack 2023-02-23 10:21:04 +01:00
Chris Smowton
748387a69f Merge pull request #11943 from smowton/smowton/admin/java-autobuilder-diagnostic-tests
Java: Add tests for autobuilder-detected diagnostics
2023-02-23 09:20:03 +00:00
Michael Nebel
cf659f9a5e Merge pull request #12261 from michaelnebel/csharpjava/refactorissupported
C#/Java: Re-factor the `isSupported` predicate.
2023-02-23 10:06:11 +01:00
Michael Nebel
ca94e02107 Merge pull request #12258 from michaelnebel/csharp/enumanddelegatemodfiers
C#: Generalise modifier extraction from symbols.
2023-02-23 10:04:55 +01:00
Paolo Tranquilli
8ed99bc83b Merge pull request #12284 from github/redsun82/swift-printast
Swift: fix comments in PrintAst library
2023-02-23 09:27:14 +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
Taus
6a32a3ae58 QL: Add predicates for timestamps and locations 2023-02-22 22:47:51 +00:00
Mathias Vorreiter Pedersen
24935c97bc Merge pull request #12285 from github/calumgrant/ql-ra-parser
RA parser first draft
2023-02-22 19:07:03 +00:00
Chris Smowton
560a341e87 Fix multiple-candidate-builds message 2023-02-22 17:43:08 +00:00
Chris Smowton
c4640a6a9a Fix diagnostic markdown links 2023-02-22 17:43:08 +00:00
Chris Smowton
73e4480cc6 Update test expectations 2023-02-22 17:43:08 +00:00
Chris Smowton
2c216793a4 Diagnostics tests: don't create own diagnostics directory
The CLI does this now. Also omit default arguments to the integration test script.
2023-02-22 17:43:08 +00:00
Chris Smowton
53ac1e0133 Replace test absolute directory 2023-02-22 17:43:08 +00:00
Chris Smowton
57ac951451 Add tests for Java autobuilder errors 2023-02-22 17:43:08 +00:00
Chris Smowton
fd1ce5d12c Switch to using language-specific diagnostic environment variable 2023-02-22 17:43:08 +00:00
Chris Smowton
7a2c6b5645 Java no-build-system test: switch to single-file diagnostics.expected format 2023-02-22 17:43:07 +00:00
Chris Smowton
40e45d3636 Add test for missing Java build system 2023-02-22 17:43:07 +00:00
Chris Smowton
7dc5e7e0fe Merge pull request #12283 from github/smowton/admin/merge-rc38-into-main-2023
Merge rc/3.8 into main
2023-02-22 17:35:11 +00:00
Calum Grant
0fdcf0338a Tidy up warnings 2023-02-22 17:02:49 +00:00
Calum Grant
f3e5a8f90f Minor tidy 2023-02-22 17:01:07 +00:00
Calum Grant
9980756ee8 RA parser first draft 2023-02-22 16:51:16 +00:00
Paolo Tranquilli
62f4e48433 Swift: fix comments in PrintAst library 2023-02-22 16:46:46 +01:00
Mathias Vorreiter Pedersen
676f4125c3 Merge pull request #12282 from MathiasVP/float-and-array-padding
QL: Handle large numbers and -1 padding
2023-02-22 15:16:54 +00:00
Chris Smowton
9155e08b65 Merge remote-tracking branch 'origin/rc/3.8' into smowton/admin/merge-rc38-into-main-2023 2023-02-22 15:12:06 +00:00
Chris Smowton
2c7a2fc6d7 Merge pull request #12272 from smowton/smowton/admin/rc38-ci-fixes
Merge rc/3.7 into rc/3.8
2023-02-22 15:10:35 +00:00
Mathias Vorreiter Pedersen
498d0c359e QL: Convert various int getters to float (to avoid overflow) and correctly handle '-1' padding. 2023-02-22 14:54:40 +00: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
Mathias Vorreiter Pedersen
b738c2684b Merge pull request #12279 from MathiasVP/kind-predicate-logs
QL: Start of the AST for `kind: predicates` evaluator logs
2023-02-22 14:25:11 +00:00
Mathias Vorreiter Pedersen
5e3289a089 Merge pull request #12280 from github/tausbn/ql-make-json-parsing-a-bit-more-robust
QL: Make the JSON parser a bit more robust
2023-02-22 14:16:48 +00:00
Mathias Vorreiter Pedersen
d64d03ec48 QL: Fix Code Scanning warning. 2023-02-22 14:15:47 +00:00
Mathias Vorreiter Pedersen
f155f19725 QL: Respond to comments. 2023-02-22 14:15:18 +00: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
Taus
2cdec47585 QL: Make the JSON parser a bit more robust
Updates the grammar to allow trailing commas in objects and arrays.

Also bumps the file size limit to 10MB.
2023-02-22 13:45:47 +00:00
Mathias Vorreiter Pedersen
161acf0ebe QL: Add more getters. 2023-02-22 13:43:51 +00:00
Mathias Vorreiter Pedersen
2c31d6863c QL: Start on the AST for kind: predicates evaluator logs. 2023-02-22 13:26:47 +00:00
Michael B. Gale
93b7a2bc92 Fix: drop please 2023-02-22 12:32:11 +00:00
Michael B. Gale
c3e25d2549 Add docs link for missing Xamarin SDKs 2023-02-22 12:32:10 +00:00
Michael B. Gale
08b51c3b06 Link to docs for autobuild failures 2023-02-22 12:32:10 +00:00
Michael B. Gale
0f320996cf Make improvements based on PR feedback 2023-02-22 12:32:07 +00:00
Mathias Vorreiter Pedersen
5b1288143f Merge pull request #12277 from github/tausbn/clean-up-structured-logs-module
QL: Clean up structured logs module
2023-02-22 12:27:07 +00:00
Rasmus Wriedt Larsen
6a5eebe891 Python: Add test of module_export 2023-02-22 12:26:01 +01:00
Taus
5304fe2bcb QL: Clean up structured logs module
Pushes it into an internal module and removes the abstract class.
2023-02-22 11:07:48 +00:00
Jeroen Ketema
eb6c8480f8 Make "Detecting a potential buffer overflow" example more uniform
All queries that use SSA import `semmle.code.cpp.controlflow.SSA` explicitly,
except for the last one. Also import the library there. Note that this is not
strictly necessary, as the library is transitively imported via `import cpp`.
2023-02-22 10:02:12 +01:00
Mathias Vorreiter Pedersen
dffb12070e Merge pull request #12271 from github/tausbn/ql-fix-json-extraction
QL: Fix JSON extraction
2023-02-22 08:50:49 +00:00
Chris Smowton
b28f1a562a Merge pull request #12273 from intrigus-lgtm/patch-8
Fix grammar
2023-02-22 08:43:07 +00:00
Michael Nebel
47c69d924b C#: Update comment on the isSupported predicate. 2023-02-22 09:05:28 +01:00
Michael Nebel
b4a6d1e1b6 C#: Add change note. 2023-02-22 08:59:14 +01:00
Michael Nebel
3e0aacd36b C#: Generalize modifier extraction from symbols. 2023-02-22 08:53:29 +01:00
intrigus-lgtm
540d3a3a99 Fix grammar 2023-02-22 00:42:50 +01:00
Taus
a3a099cf56 QL: Add a few more methods
Still need to implement something to encapsulate RA, link it up, etc.
2023-02-21 21:27:17 +00:00
Chris Smowton
7106f7d52e Add gradle wrappers to compiler_arguments and kotlin_kfunction tests
`
2023-02-21 21:20:43 +00:00
Chris Smowton
8bb068f3a9 Merge remote-tracking branch 'origin/rc/3.7' into smowton/admin/rc38-ci-fixes 2023-02-21 21:17:30 +00:00
Taus
729563c9a3 QL: Add preliminary support for structured logs 2023-02-21 21:09:34 +00:00
Chris Smowton
d849e27b37 Merge pull request #12259 from smowton/smowton/admin/gradle-wrappers-rc37
[rc/3.7]: Add Gradle wrappers for Kotlin tests
2023-02-21 21:04:39 +00:00
Taus
cf734919b9 QL: Fix bad string grammar
What was there before made it so that you couldn't actually extract the
contents of a string.
2023-02-21 20:20:58 +00:00
Taus
bab53b5736 QL: Fix JSON extraction
I had forgotten about this extra filtering that takes place in the
extractor.
2023-02-21 19:50:27 +00: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
Mathias Vorreiter Pedersen
ad8d9c5b91 Merge pull request #12269 from github/tausbn/ql-add-json-extraction
QL: Add JSON (+C/L) extraction
2023-02-21 16:42:19 +00:00
Arthur Baars
aac65b0df0 Merge pull request #12268 from aibaars/update-erb
Ruby: update tree-sitter-embedded-template
2023-02-21 14:31:30 +01:00
Taus
b5ebd1a0fd QL: Add JSON (+C/L) extraction 2023-02-21 12:59:30 +00:00
Arthur Baars
814bef021d Ruby: update tree-sitter-embedded-template 2023-02-21 13:49:33 +01:00
Anders Schack-Mulligen
46d6f5af7e Java: Update some tests. 2023-02-21 13:14:35 +01:00
Geoffrey White
c462e010d1 Merge pull request #12266 from geoffw0/taintplusequals
Swift: Taint through arithmetic
2023-02-21 09:32:53 +00:00
Anders Schack-Mulligen
acf6a77c6b Dataflow: Amend qldoc 2023-02-21 10:20:42 +01:00
Anders Schack-Mulligen
bb0ec46eb2 Java: Update tests. 2023-02-21 10:04:25 +01:00
Anders Schack-Mulligen
00a273b959 Java: Refactor data flow library. 2023-02-21 10:04:14 +01:00
Tom Hvitved
c3679d0661 Fix bad join 2023-02-21 19:28:55 +13:00
Tom Hvitved
9880952e72 Revert "Ruby: Fix performance of Filter.getAnAction"
This reverts commit f6c863c13bc840cba983ed12232725b8a8552cb4.
2023-02-21 19:28:55 +13:00
Harry Maclean
710ddb1f96 Ruby: Fix performance of Filter.getAnAction
Only look at the current class and the immediate superclass.
This will miss some edge cases but is much faster.
2023-02-21 19:28:54 +13:00
Harry Maclean
2bc7d4e1ee Ruby: Clean up 2023-02-21 19:28:54 +13:00
Harry Maclean
7a01c4a974 Ruby: Add change note for filter dataflow 2023-02-21 19:28:54 +13:00
Harry Maclean
ba4d0a81d5 Ruby: Simplify filter dataflow
This introduces some false flow (the `ThreeController` and
`FourController` examples in `filter_flow.rb`) but is simpler and
in line with how we model flow for normal method calls.
2023-02-21 19:28:53 +13:00
Harry Maclean
0a02b45ad7 Ruby: More filter flow steps
Add a jump step from the last self post-update node in a method to the self parameter of the
next method.
2023-02-21 19:28:26 +13:00
Harry Maclean
fae5320c3a Ruby: Add filter flow tests 2023-02-21 19:27:53 +13:00
Harry Maclean
04e80fa48f Ruby: Use lookupMethod
The hope is that this predicate is already used elsewhere, so its cost
is amortized.
2023-02-21 19:26:36 +13:00
Harry Maclean
889d97163e Ruby: Refactor getFilterCallable
Try to force a join with the filter argument string first, to reduce
tuple counts.
2023-02-21 19:26:36 +13:00
Harry Maclean
2590682262 Ruby: inline RenderCallUtils::getBaseName
This seems to yield a small performance increase.
2023-02-21 19:26:36 +13:00
Harry Maclean
ae3d91b546 Ruby: First draft of rails callback flow 2023-02-21 19:26:36 +13:00
Harry Maclean
6eeb711988 Ruby: Add AdditionalJumpStep class 2023-02-21 19:26:36 +13:00
Geoffrey White
cb8f5979d1 Swift: Update swift/string-length-conflation to taint tracking and remove a special case that's now covered by taint. 2023-02-20 18:18:15 +00:00
Geoffrey White
9b117fefd7 Swift: Generalize the arithmetic we allow taint through. 2023-02-20 18:18:15 +00:00
Geoffrey White
a5bb336647 Merge pull request #12265 from geoffw0/taintunaryplus
Swift: Add unary +
2023-02-20 18:04:37 +00:00
Geoffrey White
87c0b6195f Swift: Add taint tests for various arithmetic operators. 2023-02-20 17:22:51 +00:00
Geoffrey White
3038543242 Swift: Add UnaryPlusExpr. 2023-02-20 17:15:20 +00:00
Calum Grant
779c2365fe Merge pull request #12091 from github/cg/shared-code-metrics
Script to generate shared code metrics
2023-02-20 16:58:30 +00:00
Geoffrey White
e19e28fbb9 Merge pull request #12263 from geoffw0/flowsourceinline
Swift: Convert the flow sources test to inline expectations.
2023-02-20 16:13:01 +00:00
Erik Krogh Kristensen
6894803b14 Merge pull request #12257 from erik-krogh/compile-stuff
CI: Fix CI use of the compilation cache
2023-02-20 16:46:09 +01:00
Geoffrey White
31967cc032 Swift: Add a couple of dataflow test cases for operators that behave as an identity function. 2023-02-20 15:42:07 +00:00
Stephan Brandauer
7714acea82 delete a model that should pbly be a summary step 2023-02-20 15:44:58 +01:00
erik-krogh
389b7ceff5 support the new shared compilation cache directory 2023-02-20 15:34:03 +01:00
erik-krogh
f6fdf45359 remember to actually output the compilation dir 2023-02-20 15:32:50 +01:00
Geoffrey White
690b5debf4 Swift: Remove the old test. 2023-02-20 13:58:53 +00:00
Geoffrey White
dd7f54677b Swift: Add inline expectation tags. 2023-02-20 13:57:24 +00:00
Joe Farebrother
1fb27354b9 Merge pull request #12242 from joefarebrother/testgen-improvements
Java: Test generator fixes
2023-02-20 13:53:18 +00:00
Arthur Baars
f71c3301b3 Ruby: address review comment 2023-02-20 14:32:24 +01:00
Arthur Baars
6fd836d3a9 Ruby: improve wording of error messages 2023-02-20 14:32:02 +01:00
Alex Ford
774030a8db Merge pull request #12083 from pwntester/ruby_twirp_support
[Ruby] Add support for Twirp framework
2023-02-20 13:16:52 +00:00
Michael Nebel
86888b894a Java: Re-factor isSupported for the telemetry queries. 2023-02-20 13:53:18 +01:00
Michael Nebel
f594411c43 C#: Re-factor isSupported for the telemetry queries. 2023-02-20 13:53:18 +01:00
yoff
52dd1f451c Merge pull request #12260 from yoff/python/fix-precision-usafe-unpack
python: Lower precision as discussed
2023-02-20 13:38:50 +01:00
Michael Nebel
cdda4005fd C#: Add missing hasProvenance overrides. 2023-02-20 13:19:56 +01:00
Michael Nebel
813ffa440c Java: Consider ai-generated flow summaries to as generated summaries in dataflow. 2023-02-20 12:11:48 +01:00
Geoffrey White
b66ed57e17 Swift: Fix a mistake in FlowSources.qll. 2023-02-20 11:11:46 +00:00
Rasmus Lerchedahl Petersen
9e97877938 python: lower precision as discussed 2023-02-20 12:06:19 +01:00
Geoffrey White
d9f2d348f4 Swift: Add an inline expectations test for flow sources. 2023-02-20 11:03:10 +00:00
Chris Smowton
dbe0797063 Add Gradle wrappers for Kotlin tests
This avoids tests' behaviour changing due to environmental Gradle version changes
2023-02-20 10:51:51 +00:00
Michael Nebel
54c0404110 Java: Allow ai-generated as a provenance value. 2023-02-20 11:47:09 +01:00
Tom Hvitved
658cc33bb8 Merge pull request #12212 from hvitved/util/inline-expect-test-use-end-line
Util: Use end line instead of start line for actual results
2023-02-20 11:41:02 +01:00
Stephan Brandauer
cf5a651b1f use provenance ai-generated for triage data and use the read-file MaD label 2023-02-20 11:33:18 +01:00
Stephan Brandauer
8d7031c166 Update Java MaD sink decls after triage
Triage request: 2276
2023-02-20 11:33:18 +01:00
Geoffrey White
6cec8ece3f Swift: Split off FlowConfig.qll. 2023-02-20 10:27:40 +00:00
Michael Nebel
35793b4de5 C#: Add change note. 2023-02-20 10:30:11 +01:00
Michael Nebel
7aeb61ca71 C#: Add file scoped test cases. 2023-02-20 10:30:10 +01:00
Michael Nebel
81fde0ea79 C#: Make library support for file scoped types. 2023-02-20 10:30:10 +01:00
Michael Nebel
ffb8a57893 C#: Make extractor support for file scoped types. 2023-02-20 10:30:10 +01:00
Harry Maclean
9aea725f3d Merge pull request #12053 from hmac/actioncontroller-renderer-2
Ruby: Model ApplicationController.renderer
2023-02-20 22:28:30 +13:00
Geoffrey White
343ddede5a Merge branch 'main' into nsstring 2023-02-20 09:15:58 +00:00
Mathias Vorreiter Pedersen
49be5fd19a Merge pull request #12250 from geoffw0/filemanagersource
Swift: Taint sources for FileManager
2023-02-20 09:12:11 +00:00
Tom Hvitved
879eff41ea Merge branch 'main' into util/inline-expect-test-use-end-line 2023-02-20 10:03:38 +01:00
Rasmus Wriedt Larsen
efc75e02cc Merge pull request #12168 from RasmusWL/crypto-stdlib-modeling
Python: Add modeling of `hmac`
2023-02-20 09:26:53 +01:00
ihsinme
213abc6642 Update DivideByZeroUsingReturnValue.expected 2023-02-19 21:42:48 +03:00
ihsinme
54acbf7676 Update test.cpp 2023-02-19 21:42:14 +03:00
ihsinme
49af5ec536 Update DivideByZeroUsingReturnValue.ql 2023-02-19 21:41:28 +03:00
Harry Maclean
4e07fd3eb1 Ruby: Model ApplicationController.renderer 2023-02-19 13:37:27 +13:00
Taus
89aec093c8 Merge pull request #12233 from github/tausbn/add-blame-extractor 2023-02-18 15:06:25 +01:00
erik-krogh
cd823d7495 add git info to the checkout 2023-02-18 13:43:24 +01:00
erik-krogh
52a9d5379b add buramu to the files cached for the extractor 2023-02-18 13:22:41 +01:00
erik-krogh
db9a0d1c52 make the deprecation query calculate based on months, and adjust the cutoff to 14 months 2023-02-18 12:39:16 +01:00
erik-krogh
6f8ae703ca add the deprecation file when running QL-for-QL 2023-02-18 12:31:14 +01:00
erik-krogh
1a308316c6 fix join-order of ql/outdated-deprecation 2023-02-18 12:28:06 +01:00
erik-krogh
fcff18aa3c add query header for OutdatedDeprecations 2023-02-18 12:22:34 +01:00
erik-krogh
4f97c0470b exclude java integration tests from QL-for-QL 2023-02-18 12:21:35 +01:00
Chris Smowton
655aa700bc Merge pull request #12247 from smowton/smowton/fix/integer-conversion-sign
Go integer conversion: check against sink, not source signedness
2023-02-18 08:55:52 +00:00
Jami
f72cb5f650 Merge pull request #12215 from jcogs33/jcogs33/move-awt-swing-from-isJdkInternal
Java: move java.awt and javax.swing from `isJdkInternal` to `isInfrequentlyUsed`
2023-02-17 15:48:39 -05:00
Geoffrey White
7a9bbb1414 Swift: Model FileManager sources. 2023-02-17 20:04:27 +00:00
Chris Smowton
c7da1c9e0d Use example that compiles on 32-bit arch 2023-02-17 19:35:04 +00:00
Chris Smowton
be468fe122 Change note 2023-02-17 19:21:15 +00:00
Chris Smowton
4e86edf4fe Add test case 2023-02-17 19:16:36 +00:00
Chris Smowton
4d1608aafa Go integer conversion: check against sink, not source signedness 2023-02-17 18:53:18 +00:00
Geoffrey White
5d125572ec Swift: Test for FileManager taint sources. 2023-02-17 18:14:16 +00:00
Nick Rolfe
cef6765890 Merge pull request #12221 from github/post-release-prep/codeql-cli-2.12.3
Post-release preparation for codeql-cli-2.12.3
2023-02-17 17:59:45 +00:00
Calum Grant
c72a5d5dc0 Merge pull request #12245 from github/calumgrant/codeowners-dynamic
Update CODEOWNERS for dynamic teams
2023-02-17 17:25:08 +00:00
Chris Smowton
7205f30803 Merge pull request #12223 from github/smowton/admin/announce-jdk-20-2
Java: Announce JDK20 support
2023-02-17 16:10:24 +00:00
Calum Grant
e400a1ad77 Update CODEOWNERS
As agreed in the retro, we'll make all dynamic team members responsible for PRs
2023-02-17 15:48:24 +00:00
Rasmus Wriedt Larsen
27e2307d0c Python: Add import regression for refined variable 2023-02-17 16:34:34 +01:00
Joe Farebrother
a9f1436930 Test generator fixes
- Revert previous change to constructor return values; as constructors are supposed to be modeled using Argument[-1] rather than ReturnValue
- Fix generation of ambiguous calls when one of the conflicting methods is overridden
2023-02-17 15:30:06 +00:00
Nick Rolfe
5929c99eb1 Merge branch 'main' into post-release-prep/codeql-cli-2.12.3 2023-02-17 15:02:17 +00:00
Arthur Baars
71c8bb20f9 Merge pull request #12238 from aibaars/query-format-q
CI: make 'codeql query format' less verbose
2023-02-17 15:58:19 +01:00
Nick Rolfe
3e5534f0ba Merge branch 'main' into post-release-prep/codeql-cli-2.12.3 2023-02-17 14:39:26 +00:00
Taus
9f4f7a76c9 QL: Add query for outdated deprecations 2023-02-17 14:27:15 +00:00
Calum Grant
2cfd6c5597 Update misc/scripts/shared-code-metrics.py
Co-authored-by: Anders Peter Fugmann <anders@fugmann.net>
2023-02-17 14:26:58 +00:00
Calum Grant
35a53fa990 Merge pull request #12183 from RasmusWL/example-update
Python: Update a few examples so queries work on them
2023-02-17 14:21:38 +00:00
Arthur Baars
94467e638e CI: make 'codeql query compile' less verbose 2023-02-17 15:20:31 +01:00
Tom Hvitved
59efcd593a Python: Update test expectations 2023-02-17 15:20:21 +01:00
Tom Hvitved
0bceefc930 Java: Update test expectations 2023-02-17 15:20:21 +01:00
gregxsunday
fe97d2a05d fix file formatting 2023-02-17 14:01:28 +00:00
Arthur Baars
87cb3fd59f Update .github/workflows/compile-queries.yml
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2023-02-17 14:58:19 +01:00
Arthur Baars
c167919ff6 CI: make 'codeql query format' less verbose 2023-02-17 14:53:40 +01:00
Geoffrey White
ad886a3241 Swift: Autoformat. 2023-02-17 13:50:11 +00:00
Taus
db748fae6b QL: Integrate blame parser into extractor 2023-02-17 13:22:18 +00:00
Taus
59c1cfb43a QL: Add grammar for parsing blame files 2023-02-17 13:21:44 +00:00
Taus
0e0ec89e60 QL: Add tool for extracting blame info
I had some trouble getting this to work with version 1.54 of the Rust
toolchain, so I had to bump it up to 1.59.
2023-02-17 13:20:06 +00:00
Grzegorz Niedziela
9d8c117c61 added QLDocs for ZipSlip module 2023-02-17 12:57:35 +00:00
Grzegorz Niedziela
815b5a0312 add changelog file 2023-02-17 12:50:10 +00:00
Grzegorz Niedziela
c03ba2cc13 fix docs references 2023-02-17 12:50:01 +00:00
Grzegorz Niedziela
652c7ff1ed Push Sanitizer definition to ZipSlipCustomization.qll 2023-02-17 12:49:31 +00:00
Grzegorz Niedziela
8bbbb95a87 Make ZipSlip module classes private and push Sanitizer definition to ZipSlipCustomization.qll 2023-02-17 12:49:04 +00:00
Chris Smowton
d3e73891b5 Merge pull request #12229 from smowton/smowton/fix/gradle-wrapper-for-java-tests
Java: Add Gradle wrappers for Kotlin tests
2023-02-17 12:37:25 +00:00
Tom Hvitved
37fc8f5039 Swift: Update test expectations 2023-02-17 13:24:28 +01:00
Tom Hvitved
18c6b68232 Go: Update test expectations 2023-02-17 13:22:29 +01:00
Tom Hvitved
e9bce9f8cd Ruby: Update test expectations 2023-02-17 13:22:28 +01:00
Tom Hvitved
85e4707e0c Util: Use end line instead of start line for actual results 2023-02-17 13:22:28 +01:00
Geoffrey White
417d175ff2 Merge branch 'main' into nsstring 2023-02-17 11:32:40 +00:00
Arthur Baars
51f34eb3e9 Ruby: diagnostics: add support for markdown messages 2023-02-17 12:01:41 +01:00
Michael Nebel
8b967f9706 C#: Re-factor BuildNamedTypeId. 2023-02-17 11:49:12 +01:00
Geoffrey White
4356d359a6 Merge pull request #12226 from geoffw0/stringfix
Swift: Fix minor mistakes in the String models.
2023-02-17 10:23:56 +00:00
Chris Smowton
d1cd4cd099 Add Gradle wrappers for Kotlin tests
This avoids tests' behaviour changing due to environmental Gradle version changes
2023-02-17 10:10:22 +00:00
Geoffrey White
c692a316b0 Swift: Add new results found in UncontrolledFormatString test. 2023-02-17 10:07:32 +00:00
Geoffrey White
9cd9627778 Swift: Fix identical rows. 2023-02-17 10:00:06 +00:00
Geoffrey White
981f232ea9 Swift: Additional test cases. 2023-02-17 09:49:02 +00:00
Rasmus Wriedt Larsen
39e7bba563 Merge pull request #12203 from RasmusWL/import-resolution-phi
Python: Handle if-then-else definitions in import resolution
2023-02-17 10:10:42 +01:00
Paolo Tranquilli
c4c9fd72bb Swift: update to 5.7.3
No changes to the Swift frontend library headers, so no changes to the
extractor seem to be required.
2023-02-17 10:03:52 +01:00
erik-krogh
271cc6b961 remove lefterover debug comment 2023-02-17 09:50:22 +01:00
yoff
2f8dddabb6 Merge pull request #11570 from Sim4n6/UnsafeUnpack
Python: Unsafe unpacking using `shutil.unpack_archive()` query and tests
2023-02-17 09:48:05 +01:00
Geoffrey White
0aa9c76f42 Swift: Grammar and formatting. 2023-02-17 08:45:51 +00:00
Michael Nebel
2f6ffdd88f Merge pull request #12207 from michaelnebel/csharp/requiredmembers
C# 11: Required fields and properties.
2023-02-17 09:29:46 +01:00
Chris Smowton
6fc5bdd871 Announce JDK20 support 2023-02-17 08:15:33 +00:00
Michael Nebel
b87de911ba C#: Add change note. 2023-02-17 08:40:39 +01:00
Michael Nebel
3971dedcf6 C#: Add testcase for required members. 2023-02-17 08:40:39 +01:00
Michael Nebel
c0b8e852c5 C#: Add library support for required members. 2023-02-17 08:40:39 +01:00
Michael Nebel
2d46dd2936 C#: Add extractor support for the required modifier for fields and properties. 2023-02-17 08:40:39 +01:00
Michael Nebel
ff9e738d38 Merge pull request #12167 from michaelnebel/csharp/deprecategetassemblyname
C#: Checked operator support.
2023-02-17 08:39:32 +01:00
Geoffrey White
a894fc6ce8 Swift: Fix mistakes in String.qll models. 2023-02-16 18:24:36 +00:00
Geoffrey White
f64cb2983a Swift: Add tests for a few models we didn't cover. 2023-02-16 18:15:17 +00:00
github-actions[bot]
8eb8daa4d4 Post-release preparation for codeql-cli-2.12.3 2023-02-16 17:23:25 +00:00
Paolo Tranquilli
300db4f236 Merge pull request #12214 from github/redsun82/swift-codegen
Swift: fix weird module naming in codegen
2023-02-16 17:24:03 +01:00
Geoffrey White
cb11524dde Merge pull request #12154 from geoffw0/pathinjectionext
Swift: More path injection sinks
2023-02-16 16:00:31 +00:00
Michael B. Gale
8e83fd00b7 Update C/C++ autobuilder 2023-02-16 15:52:29 +00:00
Michael B. Gale
aa6efce695 Use TryGetValue 2023-02-16 15:52:13 +00:00
Michael B. Gale
5537d79d90 Detect missing Xamarin SDKs 2023-02-16 15:29:16 +00:00
Michael B. Gale
7e4808440e Fixup: better error message for no-projects-or-solutions 2023-02-16 15:29:16 +00:00
Michael B. Gale
c55281a68e Report .NET Core & MSBuild failures 2023-02-16 15:29:15 +00:00
Michael B. Gale
eda33fc5cb Track which projects/solutions fail to build 2023-02-16 15:29:15 +00:00
Michael B. Gale
f68c529f04 Report projects incompatible with .NET Core 2023-02-16 15:29:15 +00:00
Michael B. Gale
61ff4c7896 Set DiagnosticMessage defaults
Refactor `GetDiagnosticSource` into `MakeDiagnostic`
which sets the defaults.
2023-02-16 15:29:13 +00:00
Michael B. Gale
9865c506e6 Change logic for autobuild failures
This is to account for multiple attempted rules that failed
2023-02-16 15:28:42 +00:00
Michael B. Gale
99924919be Support asynchronous stdout/stderr processing 2023-02-16 15:28:42 +00:00
Michael B. Gale
c5a2cfcf95 Fixup: We => CodeQL 2023-02-16 15:28:41 +00:00
Michael B. Gale
219b232c83 Add no projects/solutions diagnostic 2023-02-16 15:28:41 +00:00
Michael B. Gale
7b5e19d462 Add diagnostics for BuildCommandAutoRule 2023-02-16 15:28:37 +00:00
Erik Krogh Kristensen
2b529fbf53 Merge pull request #12213 from github/erik-krogh/patch-test
CI: inline the move-caches script into the action
2023-02-16 16:00:13 +01:00
Michael B. Gale
5963501368 BuildCommandAutoRule: expose more information
We expose the list of candidate script paths and the chosen script path
so that we can inspect them for diagnostics purposes.
2023-02-16 14:16:23 +00:00
Michael B. Gale
f4c4871ab3 Add basic reporting of a general autobuild failure 2023-02-16 14:16:23 +00:00
Michael B. Gale
4e7c39a5d1 Add initial code for diagnostic messages 2023-02-16 14:16:23 +00:00
Michael B. Gale
fce9cb0b28 Read ..._DIAGNOSTIC_DIR variable 2023-02-16 14:16:23 +00:00
Michael B. Gale
fb6c27ba10 Refactor env var code in Autobuilder class 2023-02-16 14:16:22 +00:00
Michael B. Gale
35b60167e1 Merge pull request #12153 from github/mbg/fix/msbuild-on-macos-arm
C#: Improve C# autobuilder compatibility with Arm-based Macs
2023-02-16 14:12:43 +00:00
Jami Cogswell
94fd412809 Java: move awt and swing to isInfrequentlyUsed predicate 2023-02-16 09:02:41 -05:00
erik-krogh
767da59397 remove the paths requirement from running QL-for-QL 2023-02-16 14:57:00 +01:00
Paolo Tranquilli
f50382ba70 Swift: fix weird module naming in codegen 2023-02-16 14:53:31 +01:00
erik-krogh
45d00ae9dd inline the move-caches script into the action 2023-02-16 14:52:46 +01:00
Nick Rolfe
44dc5a1f0b Merge pull request #12209 from github/release-prep/2.12.3
Release preparation for version 2.12.3
2023-02-16 13:25:19 +00: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
Paolo Tranquilli
7cfe15c304 Merge pull request #12205 from github/redsun82/swift-codegen
Swift: fix subtle `codegen` bug on missing files
2023-02-16 13:45:35 +01:00
Rasmus Wriedt Larsen
9ed021ad66 Python: Accept change to WeakFilePermissions.expected
💪
2023-02-16 13:27:16 +01:00
Arthur Baars
006ee5aad9 Ruby: improve encoding related messages 2023-02-16 13:12:55 +01:00
Nick Rolfe
b4d59ff932 Go: changenote grammar tweaks 2023-02-16 12:07:47 +00:00
Ahmed Farid
005839b462 Update TimingAttack.qll 2023-02-16 12:49:40 +01:00
github-actions[bot]
b0315119c6 Release preparation for version 2.12.3 2023-02-16 11:49:06 +00:00
Grzegorz Niedziela
d8eafea719 Merge branch 'github:main' into main 2023-02-16 11:24:57 +00:00
gregxsunday
d1aaa9ad86 Add ZipSlip/TarSlip query for ruby 2023-02-16 11:24:15 +00:00
Joe Farebrother
430b432add Merge pull request #12195 from joefarebrother/testgen-improvements
Java: Test generator improvements
2023-02-16 11:20:55 +00:00
Michael B. Gale
eab3c6dd5e Fix missing implementations for C++ tests 2023-02-16 11:07:38 +00:00
Michael B. Gale
e28be5d98f Make msbuild work on Arm-based Macs 2023-02-16 11:07:38 +00:00
Michael B. Gale
75c75ea49c Correctly select dotnet platform on arm-based macs 2023-02-16 11:07:37 +00:00
Alex Ford
9cfd0f5f46 JS: fix qldoc 2023-02-16 11:00:37 +00:00
Paolo Tranquilli
3ec2a3c711 Swift: fix subtle codegen bug on missing files
While the internal registry was being cleaned up from files removed by
codegen itself, it was not dropping files removed outside of codegen.

Because of this files removed by the user were not being regenerated
again if no change was staged to them, unless `--force` was provided.

This also fixes some such "ghost" entries in the registry and some
missing generated files.
2023-02-16 11:46:51 +01:00
Paolo Tranquilli
3b1b3b46ae Merge pull request #12202 from github/redsun82/swift-codegen
> Out of curiosity: What is the end goal that we're trying to get to with this?

Up until now we would be writing that predicate by hand, see [this example](29c8260004/swift/ql/lib/codeql/swift/elements/expr/MethodLookupExpr.qll (L29-L30)). Now this will be given to us from the get go.

For me this was prompted to give a nicer live demo later at my presentation 🙂
2023-02-16 11:35:05 +01:00
Michael B. Gale
29c8260004 Merge pull request #12196 from github/mbg/csharp/add-msbuild-integration-tests 2023-02-16 10:29:28 +00:00
Rasmus Wriedt Larsen
766e6c400e Python: Handle if-then-else definitions in import resolution 2023-02-16 11:18:30 +01:00
Rasmus Wriedt Larsen
80f5342a6d Python: Add import regression for if-then-else definitions 2023-02-16 11:12:08 +01:00
Tony Torralba
87b54e674e Merge pull request #12178 from felickz/main
Java - Adding support for com.microsoft.sqlserver.jdbc.SQLServerDataSource  to CWE-798
2023-02-16 11:03:34 +01:00
Michael B. Gale
9db1366e4b Change target framework to 4.0 for mono 2023-02-16 09:55:58 +00:00
Michael B. Gale
f1adb4319a Add C# integration test which uses MSBuild 2023-02-16 09:55:57 +00:00
Paolo Tranquilli
e2d7a6910c Swift: generate raw helpers in synthesized stubs
This will add helpers to get the underlying raw entities or constructor
arguments on stubs for synthesized classes.

For example a schema like:

```
@synth.from_class(A)
class B:
    pass

@synth.on_arguments(base=A, index=int)
class C:
    pass
```

will generate

```
cached
private Raw::A getUnderlyingEntity() { this = Synth::TB(result) }
```
in the `B.qll` stub and
```
cached
private Raw::A getUnderlyingBase() { this = Synth::TC(result, _) }

cached
private int getUnderlyingIndex() { this = Synth::TC(_, result) }
```
in the `C.qll` stub.

As stubs these can be freely changed later on.
2023-02-16 10:49:21 +01:00
Chris Smowton
180246b99c Merge pull request #12197 from smowton/smowton/admin/go-120-features
Go: complete Go 1.20 support
2023-02-16 08:12:02 +00: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
Chad Bentz
f3124d3239 Merge branch 'main' into main 2023-02-15 18:46:15 -05:00
Chad Bentz
2f1bd93a49 change-notes for this minorAnalysis lib change 2023-02-15 18:40:40 -05:00
Chad Bentz
2f576a4fe9 test both arguments of getConnection
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-02-15 18:26:56 -05:00
Geoffrey White
00302dc05f Swift: Model NSObject. 2023-02-15 22:12:39 +00:00
Owen Mansel-Chan
45c1537f06 Merge pull request #12198 from github/smowton/admin/update-change-note
Update Twirp change note to new style
2023-02-15 21:54:48 +00:00
Geoffrey White
7e8645a1f6 Swift: Model NSMutableString. 2023-02-15 21:50:05 +00:00
Geoffrey White
d04ed14b8c fix model -2 2023-02-15 21:18:50 +00:00
Rasmus Wriedt Larsen
c4fbfb0d07 Merge branch 'main' into call-graph-code 2023-02-15 20:15:04 +01:00
Rasmus Wriedt Larsen
ee5382d8a6 Merge pull request #12193 from RasmusWL/import-resolution-fixup
Python: Fix `from <pkg> import *` import resolution
2023-02-15 20:13:24 +01:00
Chris Smowton
3ce7fafb67 Fix unsafe test routine name 2023-02-15 19:05:01 +00:00
Chris Smowton
14655e1d8c Autoformat go 2023-02-15 18:41:14 +00:00
Geoffrey White
75dd95f458 Swift: Correct one of the tests. 2023-02-15 18:37:51 +00:00
Geoffrey White
99caafb9b9 Swift: Model NSString. 2023-02-15 18:37:51 +00:00
Chris Smowton
261a1348f0 Update Twirp change note to new style 2023-02-15 18:37:50 +00:00
Chris Smowton
c65fd69374 Add change note 2023-02-15 18:35:17 +00:00
Chris Smowton
233bd8ce8c Claim Go 1.20 support 2023-02-15 18:31:28 +00:00
Chris Smowton
7e7850374e Implement standard library models for Go 1.20 2023-02-15 18:29:49 +00:00
Joe Farebrother
d9e5c6c48a Fix typo 2023-02-15 17:21:03 +00:00
Alex Ford
74782bf6a2 Merge branch 'main' into ruby_twirp_support 2023-02-15 17:15:08 +00:00
Chris Smowton
7d2b78b463 Note that all interface types are considered comparable as of Go 1.20 2023-02-15 17:15:00 +00:00
Alex Ford
1556b1a728 Merge branch 'main' into js-use-shared-cryptography 2023-02-15 17:13:53 +00:00
Alex Ford
801ed1ce7c Ruby: add Twirp.expected 2023-02-15 17:05:33 +00:00
Alex Ford
1958b9dcd5 JS: add missing qldoc 2023-02-15 16:59:03 +00:00
Alex Ford
43af306d60 dynamic: more detailed qldoc for CryptographicOperation#getBlockMode() 2023-02-15 16:55:18 +00:00
Alex Ford
e8cbf7287d JS: breaking change note for CryptographicOperation sync 2023-02-15 16:50:24 +00:00
Alex Ford
925b4a3fa8 JS: improve documentation on deprecated CryptographicOperation#getInput() predicate 2023-02-15 16:23:46 +00:00
Alex Ford
d4d0b91085 dynamic: switch CryptographicOperation::Range#getBlockMode() back to being an abstract predicate 2023-02-15 16:23:46 +00:00
Alex Ford
c7aaad9ed0 JS: avoid adding a deprecated CryptographicOperation#getInput to py/ruby 2023-02-15 16:23:46 +00:00
Joe Farebrother
95a131d0d3 Update help text 2023-02-15 16:18:47 +00:00
Joe Farebrother
8ee36a5278 Test generator improvements
- Accept yml files as input
- Output the correct type for constructors
2023-02-15 16:11:22 +00:00
erik-krogh
51ddb55d7b use tainted-object to precisely model that plain object are fine, but their properties are not 2023-02-15 15:02:03 +01:00
erik-krogh
09794fa836 delete PrefixStringSanitizer 2023-02-15 14:55:02 +01:00
Rasmus Wriedt Larsen
c72dbc49fc Merge pull request #12165 from RasmusWL/crypto-updates
Python/Ruby/JS Crypto: Add a few algorithms + block modes
2023-02-15 14:35:40 +01:00
Rasmus Wriedt Larsen
7e16fa9cbe Python: Add change-note 2023-02-15 14:25:33 +01:00
Rasmus Wriedt Larsen
220f227707 Python: Add wrapper for isPreferredModuleForName
We talked about how it's annoying that we in 4 places have the same fix
`isPreferredModuleForName(<module>.getFile(), <name> + ["", ".__init__"])`
, and that it would be nice to have a simple wrapper predicate that
ensures we never forget to do the `+ ["", ".__init__"]` dance...

I had trouble coming up with a name for this (ironically), but
I think `getModuleFromName` is good enough.
2023-02-15 14:23:39 +01:00
Rasmus Wriedt Larsen
66c3529465 Python: Fix import * from __init__.py files 2023-02-15 14:10:37 +01:00
Rasmus Wriedt Larsen
df6039d6cf Python: Add import resolution regression 2023-02-15 13:50:27 +01:00
Rasmus Wriedt Larsen
e1ae3c3cfb Python: sys.exit if import resolution tests fail 2023-02-15 13:44:45 +01:00
Chris Smowton
368ca6cb30 Add test exercising Go 1.20 array conversions 2023-02-15 12:31:09 +00:00
Mathias Vorreiter Pedersen
2203eb6607 C++: Fix Code Scanning error. 2023-02-15 11:51:55 +00:00
Geoffrey White
d763c5a3a0 Swift: Update LocalTaint.expected for the changes so far. 2023-02-15 11:42:42 +00:00
Geoffrey White
2882286c3f Swift: Test taint sources for NSString. 2023-02-15 11:42:42 +00:00
erik-krogh
17f7ba2a8f rewrite the taint-step for join() to a flowsummary 2023-02-15 12:34:59 +01:00
Geoffrey White
9f734076b7 Swift: Test taint through NSString member variables. 2023-02-15 11:04:16 +00:00
Geoffrey White
452ca4ef0f Swift: Test taint through NSMutableString. 2023-02-15 11:04:01 +00:00
Geoffrey White
16ec29e3df Swift: Test taint throguh some NSObject methods. 2023-02-15 11:03:45 +00:00
Geoffrey White
85a0fd9b30 Swift: Test taint through NSString. 2023-02-15 11:03:06 +00:00
erik-krogh
d2bd70dc33 Merge branch 'main' into more-shell-taint 2023-02-15 11:35:58 +01:00
Chris Smowton
2cd1e09a7e Merge pull request #12111 from smowton/smowton/feature/java-merge-classes-and-interfaces
Java: merge the @class and @interface database types and tables
2023-02-15 10:27:41 +00:00
erik-krogh
759854991a fix various nits based on feedback 2023-02-15 11:10:43 +01:00
Chris Smowton
5f0b1973ee Merge pull request #12188 from smowton/smowton/feature/go-1.20-support
Go: Upgrade extractor compiler and dependency versions
2023-02-15 10:06:01 +00:00
erik-krogh
bec8dc6775 add explicit this 2023-02-15 10:44:57 +01:00
erik-krogh
25a8469586 update expected output, now that .html.erb files are actually extracted 2023-02-15 10:28:05 +01:00
erik-krogh
710e79b2d5 bump extractor version 2023-02-15 10:26:00 +01:00
erik-krogh
f9b3a5b5e6 actually extract .html.erb files 2023-02-15 10:26:00 +01:00
Paolo Tranquilli
4be2e431ea Merge pull request #12180 from github/redsun82/swift-codegen
Swift: some restructuring of codegen
2023-02-15 10:15:20 +01:00
Rasmus Wriedt Larsen
9e2eb56032 Python: Remove support for late *args arguments
I found this to cause bad performance, so the implementation of this has
to be thought out more carefully.
2023-02-15 09:42:11 +01:00
Anders Schack-Mulligen
b52df0de0c Merge pull request #12191 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-02-15 09:07:40 +01:00
Harry Maclean
fb14920281 Merge pull request #12056 from hmac/test-refactor 2023-02-15 17:34:25 +13:00
github-actions[bot]
5f07d1f385 Add changed framework coverage reports 2023-02-15 00:17:48 +00:00
Mathias Vorreiter Pedersen
c11218fcde Merge pull request #12184 from MathiasVP/discriminate-union-contents 2023-02-14 23:36:02 +00:00
erik-krogh
b7305fd229 also consider relative exports when finding library inputs 2023-02-14 21:08:13 +01:00
Chris Smowton
194316d1c0 Accept test changes
Some diagnostics have been reworded for Go 1.20, and a standard library type parameter is visible to the TypeParamType test.
2023-02-14 18:33:53 +00:00
Chris Smowton
d075e016b2 Upgrade Go to 1.20 2023-02-14 17:59:18 +00:00
erik-krogh
de4f5017e1 add change-note 2023-02-14 18:36:07 +01:00
Chris Smowton
9e584eb241 Upgrade Go extractor compiler and dependency versions 2023-02-14 17:34:47 +00:00
Chris Smowton
62d10f91d8 Improve join ordering 2023-02-14 17:21:24 +00:00
Chris Smowton
d5f7ef08b7 Update stats 2023-02-14 17:21:24 +00:00
Chris Smowton
7f76d8ae55 Replace redundant use of Class or Interface 2023-02-14 17:21:24 +00:00
Chris Smowton
82a2f4349a Resolve a newly-introduced ambiguity
Also fix a simple redundancy noticed while debugging
2023-02-14 17:21:24 +00:00
Chris Smowton
f48d87ba55 Add deletions for removed tables 2023-02-14 17:21:24 +00:00
Chris Smowton
3514dd1e4d Java: merge the @class and @interface database types and tables
This will allow the extractor to emit class(id, ...) when all it knows about a class is its name, due to not having it available on the classpath. Previously it would have had to guess whether it belonged to @class or @interface, possibly introducing an inconsistency.
2023-02-14 17:21:23 +00:00
Jami
029e1d47fe Merge pull request #12081 from jcogs33/jcogs33/update-some-Files-sinks
Java: update `createTempDirectory` and `copy` "create-file" sinks
2023-02-14 10:53:17 -05:00
Taus
e40bb6ac87 Merge pull request #12029 from github/tausbn/python-clean-up-version-handling
Python: Clean up version handling
2023-02-14 16:40:09 +01:00
Alex Ford
8d90c02a67 JS: remove unused field 2023-02-14 15:24:22 +00:00
Jeroen Ketema
899f35a59b Merge pull request #12185 from jketema/test-annotations
C++: Update test annotations for use-use dataflow
2023-02-14 15:48:35 +01:00
Jeroen Ketema
1d4e9745a3 Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-02-14 15:40:36 +01:00
Mathias Vorreiter Pedersen
2591460731 Merge pull request #12181 from MathiasVP/fix-node-type
C++: Fix node types
2023-02-14 13:54:12 +00:00
Taus
1b30043422 Python: Move change note to correct directory 2023-02-14 13:48:55 +00:00
Jeroen Ketema
9e462866a0 C++: Update test annotations for use-use dataflow 2023-02-14 14:48:08 +01:00
erik-krogh
393649b7ce don't call environment variables for command-line arguments 2023-02-14 14:27:41 +01:00
Alvaro Muñoz
4644a88b89 address code review comments 2023-02-14 14:27:17 +01:00
Mathias Vorreiter Pedersen
ba0be2fd9f C++: Better discriminate for unions. 2023-02-14 13:26:40 +00:00
Taus
4f7c598ffc Python: Add change note 2023-02-14 13:22:48 +00:00
erik-krogh
36478124ae add process.env and process.argv etc. as source for js/regex-injection 2023-02-14 14:21:53 +01:00
erik-krogh
943bdeca6d make appliesTo recursive 2023-02-14 14:16:45 +01:00
erik-krogh
9549cac3e5 add an additional barrier guard that finds "=== true" versions of previous barrier guards 2023-02-14 14:15:23 +01:00
erik-krogh
c355a26657 add failing test 2023-02-14 14:12:35 +01:00
erik-krogh
3f0fe96f85 add getBoolValue() as a utility predicate on BooleanLiteral 2023-02-14 14:12:35 +01:00
Erik Krogh Kristensen
2f8c9a5a2c Merge pull request #12171 from erik-krogh/reg-dot
JS: dont recognize regexps that match dot as sanitizers
2023-02-14 14:10:44 +01:00
Erik Krogh Kristensen
e3e2df3247 Merge pull request #12166 from erik-krogh/more-html-san
JS: add `HtmlSanitizer` as a sanitizer DOMBasedXss
2023-02-14 14:09:56 +01:00
Taus
39516862c1 Merge remote-tracking branch 'origin/main' into tausbn/python-clean-up-version-handling 2023-02-14 13:07:40 +00:00
Mathias Vorreiter Pedersen
4ba5059064 Merge pull request #12182 from MathiasVP/content-approx
C++: Use `Content` approximation
2023-02-14 13:00:47 +00:00
Erik Krogh Kristensen
028fcc7edf Merge pull request #11959 from erik-krogh/ssrfSan
JS: add encodeURIComponent as a sanitizer for request-forgery
2023-02-14 13:39:53 +01:00
Erik Krogh Kristensen
a498936f16 Merge pull request #12170 from erik-krogh/more-lib
JS: More library inputs
2023-02-14 13:38:00 +01:00
Erik Krogh Kristensen
bca3fa94fd Merge pull request #12159 from erik-krogh/express-ws
JS: add express-ws as a source
2023-02-14 13:36:33 +01:00
Michael Nebel
469b289db9 C#: Add change note. 2023-02-14 13:14:45 +01:00
Michael Nebel
b3c234d020 C#: Add testcases for checked operators. 2023-02-14 12:59:36 +01:00
Michael Nebel
238a70fc55 C#: Add library support for checked operators. 2023-02-14 12:58:15 +01:00
Michael Nebel
b7123aaa89 C#: Add viable callable testcases for regular and checked operators. 2023-02-14 12:57:59 +01:00
Rasmus Wriedt Larsen
dc5bb4fb77 Python: Update a few examples so queries work on them
Fixes problem highlighted in https://github.com/github/codeql/issues/12156
2023-02-14 11:54:18 +01:00
Joe Farebrother
f68083872d Merge pull request #12174 from joefarebrother/stubgen-name-conflicts
Java: Stub generator: Use fully qualified names to avoid conflicts
2023-02-14 10:10:24 +00:00
Mathias Vorreiter Pedersen
b01a45f7be C++: Respond to PR reviews. 2023-02-14 09:51:48 +00:00
Mathias Vorreiter Pedersen
bda46b3748 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2023-02-14 09:49:32 +00:00
Paolo Tranquilli
81de500301 Swift: fix import not working in all python versions 2023-02-14 10:40:05 +01:00
Mathias Vorreiter Pedersen
ffef81bc47 C++: Add QLDoc. 2023-02-14 09:38:43 +00:00
Mathias Vorreiter Pedersen
0a3f958849 C++: Use content approximations. 2023-02-14 09:10:10 +00:00
Mathias Vorreiter Pedersen
7a81f06e84 C++: Accept test changes. 2023-02-14 09:01:51 +00:00
Mathias Vorreiter Pedersen
cc036c188f C++: Fix missing and spurious types. 2023-02-14 09:01:42 +00:00
Mathias Vorreiter Pedersen
748a345e7f C++: Add a test to reveal missing or spurious types on dataflow nodes. 2023-02-14 08:58:29 +00:00
Anders Schack-Mulligen
0600a2ba96 Merge pull request #12138 from aschackmull/java/gen-file-mark-perf
Java: Improve performance of GeneratedFileMarker.
2023-02-14 09:57:09 +01:00
Tony Torralba
935e22d10d Merge pull request #12139 from atorralba/atorralba/java/xxe-local-query
Java: Add local version of the XXE query
2023-02-14 09:54:36 +01:00
Paolo Tranquilli
8e079320f3 Swift: some restructuring of codegen
Loading of the schema and dbscheme has been moved to a separate
`loaders` package for better separation of concerns.
2023-02-14 09:53:02 +01:00
Michael Nebel
781aab3eb7 Merge pull request #11634 from michaelnebel/java/excludeinterfacemembers
Java: Exclude interface members from model generation.
2023-02-14 09:35:56 +01:00
Chad Bentz
b0c8992eef Adding CWE-798 MSSQL Tests 2023-02-13 19:44:02 -05:00
Chad Bentz
cfe169a4f9 Adding MSSQL to SensitiveAPI 2023-02-13 19:42:28 -05:00
erik-krogh
4140598769 update expected output for experimental query 2023-02-14 00:08:13 +01:00
erik-krogh
c17d057520 default to index.js when no main: is specified in package.json, and recognize more classes as library inputs 2023-02-13 21:24:41 +01:00
Joe Farebrother
0b722bfe30 Stub generator: Use fully qualified names to avoid conflicts 2023-02-13 17:09:32 +00:00
erik-krogh
68656274f4 dont recognize regexps that match dot as sanitizers 2023-02-13 17:36:51 +01:00
Jami Cogswell
e4c8387815 Java: update CaptureSinkModels.expected with read-file sink 2023-02-13 11:29:30 -05:00
Tony Torralba
1c57aa0456 Fix import locations 2023-02-13 17:13:01 +01:00
Tom Hvitved
8372ad9d84 Merge pull request #12169 from hvitved/util/numbers
Move `NumberUtils.qll` from Ruby into shared `util` pack
2023-02-13 16:37:51 +01:00
Tom Hvitved
2113c3c3d9 Ruby: Remove NumberUtils.qll 2023-02-13 15:59:50 +01:00
Tom Hvitved
29ce9bfe24 Util: Make some predicates private 2023-02-13 15:58:31 +01:00
Tom Hvitved
97f79602a9 Copy NumberUtils.qll from Ruby into shared util pack 2023-02-13 15:57:53 +01:00
Rasmus Wriedt Larsen
1c7fe97427 Python: Add modeling of hmac 2023-02-13 15:39:43 +01:00
Rasmus Wriedt Larsen
df22181963 Python: Add tests of hmac 2023-02-13 15:38:14 +01:00
erik-krogh
6192544fb4 add test for express-ws as a source 2023-02-13 15:26:50 +01:00
Jami Cogswell
1c3d4b98c8 Java: move change note 2023-02-13 09:15:31 -05:00
Jami Cogswell
191613e8bf Java: update change note 2023-02-13 09:11:53 -05:00
Owen Mansel-Chan
4fa484dad2 Merge pull request #12130 from owen-mc/go/port-integration-tests
Go: port integration tests
2023-02-13 13:49:59 +00:00
Rasmus Wriedt Larsen
39e50f745d Ruby: Fix .expected for CryptoAlgorithms 2023-02-13 14:21:12 +01:00
Michael Nebel
b3602a5b7f C#: Use functionname as stored in the database. 2023-02-13 13:53:46 +01:00
Kasper Svendsen
c66a44f2e2 Merge pull request #12162 from kaspersv/kaspersv/inline-late-docs
QLDocs: Document inline_late pragma
2023-02-13 13:35:28 +01:00
Anders Schack-Mulligen
e877b161d8 Merge pull request #12124 from hvitved/dataflow/stage1-dispatch
Data flow: Call context virtual dispatch pruning in stage 1
2023-02-13 13:13:43 +01:00
Owen Mansel-Chan
7ebe472cfe Move repo files into subfolder
This is so that the test-db doesn't get moved when all the repo files
are moved, which was causing some problems.
2023-02-13 11:59:38 +00:00
Owen Mansel-Chan
37d3793e87 Set LGTM_INDEX_IMPORT_PATH in two tests
This is needed for Dep and Glide
2023-02-13 11:59:38 +00:00
Owen Mansel-Chan
1f1e2dbf98 Make dep integration test linux-only
This is because there is no release of Dep for
MacOS (Arm).
2023-02-13 11:59:38 +00:00
Owen Mansel-Chan
3ee3acd8fd Make Glide integration test linux-only
This is because it is hard to install Glide on the other platforms.
2023-02-13 11:59:37 +00:00
Owen Mansel-Chan
e635140eae Add files needed for tests 2023-02-13 11:59:37 +00:00
Owen Mansel-Chan
f2c541a461 Delete build-sample test
This is adequately tested elsewhere.
2023-02-13 11:59:37 +00:00
Owen Mansel-Chan
f062a8d204 Copy LGTM integration tests over 2023-02-13 11:59:36 +00:00
Owen Mansel-Chan
947a9f12a1 Make DiagnosticsReporting.qll a library 2023-02-13 11:59:36 +00:00
Kasper Svendsen
11204987f1 Reword based on review comments 2023-02-13 12:49:50 +01:00
Michael Nebel
34c6b24882 Merge pull request #12147 from michaelnebel/csharp/relaxedshift
C# 11: Test of relaxed shift operator requirements.
2023-02-13 12:48:39 +01:00
Arthur Baars
457a2bb2a2 Merge pull request #12093 from aibaars/oneline-match
Ruby: add support for one-line pattern matches
2023-02-13 12:38:28 +01:00
Jeroen Ketema
73d877e3a5 Merge pull request #12163 from jketema/dataflow-new
C++: Add `semmle.code.cpp.dataflow.new`
2023-02-13 12:36:16 +01:00
Kasper Svendsen
ac54caac35 Update docs/codeql/ql-language-reference/annotations.rst
Co-authored-by: Philip Ginsbach <ginsbach@github.com>
2023-02-13 12:35:08 +01:00
Kasper Svendsen
426425a7ca Update docs/codeql/ql-language-reference/annotations.rst
Co-authored-by: Philip Ginsbach <ginsbach@github.com>
2023-02-13 12:34:50 +01:00
Chris Smowton
0537579b28 Merge pull request #12131 from owen-mc/go/named-type-location
Add `hasLocationInfo` for `Type`s
2023-02-13 11:33:50 +00:00
Erik Krogh Kristensen
2f404df17c Merge pull request #10782 from erik-krogh/rbPoly
Ruby: add library input as a source for `rb/polynomial-redos`
2023-02-13 12:26:07 +01:00
erik-krogh
b85bfc8ba6 add HtmlSanitizer as a sanitizer for DOMBasedXss 2023-02-13 11:57:29 +01:00
erik-krogh
c258e44772 add failing test for spurious edge through sanitizer 2023-02-13 11:49:57 +01:00
Erik Krogh Kristensen
26d5fb2412 Merge pull request #11824 from erik-krogh/secondMissAnchor
RB: add query detecting validators that use badly anchored regular expressions on library/remote input
2023-02-13 11:26:05 +01:00
Jeroen Ketema
b9200c92d5 C++: Address review comments 2023-02-13 11:14:48 +01:00
Kasper Svendsen
74472d786c QLDocs: Document inline_late pragma 2023-02-13 10:51:48 +01:00
erik-krogh
634087b417 Merge branch 'main' into rbPoly 2023-02-13 10:46:00 +01:00
Michael Nebel
2ce6d5f920 Java: Update negative models test to not produce a negative summary for interface member. 2023-02-13 10:45:54 +01:00
Rasmus Wriedt Larsen
5235964b07 sync files 2023-02-13 10:44:12 +01:00
Rasmus Wriedt Larsen
b2e79e2948 Python/Ruby/JS Crypto: Add a few algorithms + block modes
I have tried to add a few links to support the claim that these
algorithms are strong/safe. It wasn't always super easy, so in some
cases I have ended up just linking to the documentation of the
`cryptography` Python package.

Co-authored-by: REDMOND\brodes <brodes@microsoft.com>
2023-02-13 10:40:47 +01:00
Paolo Tranquilli
f07c598a22 Merge pull request #12164 from github/redsun82/swift-codegen-outside-bazel
Swift: make `codegen` run also outside `bazel`
2023-02-13 10:32:20 +01:00
Michael Nebel
80628596dd Java: Exclude interface members from model generation. 2023-02-13 10:21:32 +01:00
Geoffrey White
124e4ddd4f Merge pull request #12150 from geoffw0/cfg2
Swift: control flow for #available
2023-02-13 09:17:06 +00:00
Tom Hvitved
0b8173e2e7 Ruby: Add another data flow test 2023-02-13 09:50:50 +01:00
Jeroen Ketema
3dfe0adf0a C++: Fix formatting 2023-02-13 09:45:23 +01:00
Paolo Tranquilli
55aacd6fe9 Merge pull request #12137 from github/redsun82/swift-doc-for-schema-doc
Swift: add documentation for generated documentation
2023-02-13 09:43:34 +01:00
Paolo Tranquilli
483a87abe9 Swift: make codegen run also outside bazel 2023-02-13 09:39:31 +01:00
Jeroen Ketema
3482158fee C++: Add semmle.code.cpp.dataflow.new 2023-02-13 09:38:23 +01:00
Jeroen Ketema
996eb6c63c C++: Fix Ql-for-QL warnings 2023-02-13 09:22:31 +01:00
Tony Torralba
4fad01a739 Further refactoring
Avoid having two taint tracking configurations in the same file
2023-02-13 09:18:05 +01:00
Tony Torralba
f3e0b6e62c PathGraph shouldn't be imported in a QLL library 2023-02-13 09:18:05 +01:00
Tony Torralba
422eb0d1bb Add change note 2023-02-13 09:18:05 +01:00
Tony Torralba
5555b5cd19 Add local version of the XXE query 2023-02-13 09:18:05 +01:00
Paolo Tranquilli
542c9218de Merge branch 'main' into redsun82/swift-doc-for-schema-doc 2023-02-13 09:07:02 +01:00
Tom Hvitved
f7a5a33474 Address review comment 2023-02-13 09:01:15 +01:00
erik-krogh
91393a7bc8 add change-note 2023-02-12 23:28:01 +01:00
erik-krogh
6474cfd4c8 add support for express-ws 2023-02-12 23:25:27 +01:00
Jami Cogswell
ad8849c6b8 Java: fix typo 2023-02-12 16:33:26 -05:00
Jami Cogswell
676e4e8461 Java: add change note 2023-02-12 16:32:31 -05:00
Sim4n6
d7af80136e Fail tests when missing annotation on sink orfail 2023-02-12 21:27:20 +01:00
Sim4n6
518684b736 Put back the annotation result=BAD 2023-02-12 21:26:12 +01:00
Sim4n6
80d4fb5e33 Organisation TarSlip/UnsafeUnpack into two folders 2023-02-12 10:51:53 +01:00
Jami Cogswell
ce1c814daa Java: update path-injection query to use new 'read-file' sink kind 2023-02-11 17:10:58 -05:00
Jami Cogswell
c87c3e30c7 Java: update getInvalidModelKind with 'read-file' kind 2023-02-11 17:07:25 -05:00
Owen Mansel-Chan
685b8b4abd Tests are no longer fooled by type aliases 2023-02-10 22:09:21 +00:00
Owen Mansel-Chan
7042f67375 Refactor code to be simpler 2023-02-10 22:09:20 +00:00
Owen Mansel-Chan
778826b528 Accept test changes
Note that
go/ql/test/library-tests/semmle/go/Types/QualifiedNames.expected and
go/ql/test/library-tests/semmle/go/Types/Types.expected gain two lines.
In both cases this is because GenericArray and GenericSignature are
each instantiated twice, so they appear with two different locations.
2023-02-10 22:09:20 +00:00
Owen Mansel-Chan
202c0be303 Add hasLocationInfo for Types
It returns a dummy location except for named types with a type
declaration in the source.
2023-02-10 22:09:20 +00:00
Sim4n6
eed19a3e15 Fix autoformatting issues 2023-02-10 21:58:29 +01:00
Mathias Vorreiter Pedersen
378484ec01 Merge pull request #12149 from MathiasVP/fewer-flowthroughs
C++: Fix spurious flow-through
2023-02-10 18:45:46 +00:00
Geoffrey White
ad85b37585 Swift: Tidy up indenting. 2023-02-10 18:06:56 +00:00
Geoffrey White
d0efbbf5b8 Swift: More path injection models. 2023-02-10 18:02:50 +00:00
Geoffrey White
82f09b8511 Swift: More path injection test cases. 2023-02-10 17:55:06 +00:00
Arthur Baars
ecbd768df4 Ruby: reduce number of diagnostic messages with the status_page flag
For now we only report real parse errors and character encoding errors. Warnings about
unexpected or missing nodes in the AST are not reported. These are typically side effects
of earlier parse errors.
2023-02-10 18:53:46 +01:00
Arthur Baars
679f02c274 Address comments 2023-02-10 18:08:30 +01:00
Jeroen Ketema
7bd28183ba Merge pull request #12151 from jketema/remove-experimental-dataflow
C++: Remove experimental copy of the use-use IR dataflow library
2023-02-10 18:08:14 +01:00
Mathias Vorreiter Pedersen
168202dbf7 Update cpp/ql/test/library-tests/dataflow/dataflow-tests/has-parameter-flow-out.ql
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2023-02-10 16:36:40 +00:00
Jeroen Ketema
8522eddf5a Merge pull request #12148 from jketema/opt-in
C++: Revert `semmle.code.cpp.dataflow` to its old state
2023-02-10 17:34:27 +01:00
Jeroen Ketema
5f33827eca C++: Update test results 2023-02-10 17:10:52 +01:00
Geoffrey White
8624098318 Swift: sync identical files. 2023-02-10 15:24:57 +00:00
Jeroen Ketema
b023c6bb23 C++: Remove experimental copy of the use-use IR dataflow library 2023-02-10 16:20:33 +01:00
Nora
d55e9d5dac Merge pull request #12000 from github/nora/update-query-history-actions
Rename Query History Actions
2023-02-10 16:18:36 +01:00
Geoffrey White
eda331ebc2 Swift: Clean up. 2023-02-10 15:11:31 +00:00
Geoffrey White
11f022c69f Swift: Add some more qldoc. 2023-02-10 15:02:05 +00:00
Jeroen Ketema
1a83b712a0 C++: Add change note 2023-02-10 15:27:49 +01:00
Geoffrey White
15b8aa1979 Swift: Effect on other tests :) 2023-02-10 14:16:48 +00:00
Mathias Vorreiter Pedersen
9a8b3bad31 C++: Respond to PR reviews. 2023-02-10 13:56:19 +00:00
Geoffrey White
6cb9198ee2 Swift: Control flow through #available. 2023-02-10 13:32:33 +00:00
Paolo Tranquilli
9d433eb420 Merge branch 'main' into redsun82/swift-doc-for-schema-doc 2023-02-10 14:27:56 +01:00
Jeroen Ketema
ecdeb9a970 C++: Revert semmle.code.cpp.dataflow to its old state
While here make sure all queries and tests use IR dataflow when appropriate.
2023-02-10 14:21:44 +01:00
Mathias Vorreiter Pedersen
5bd7589109 C++: Fix spurious flow though and accept test changes. 2023-02-10 12:42:40 +00:00
Mathias Vorreiter Pedersen
faf9fd6253 C++: Add a testcase (and a new test) to test flow through functions. 2023-02-10 12:40:29 +00:00
Jeroen Ketema
ffbaef8771 C++: Update for test changes 2023-02-10 11:23:19 +01:00
Michael Nebel
db41463d72 C#: Test of relaxed shift operator requirements. 2023-02-10 10:33:20 +01:00
Geoffrey White
38f4f65fc0 Swift: Add CFG test cases for #available. 2023-02-10 09:29:08 +00:00
Mathias Vorreiter Pedersen
e1aef3127c Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-02-10 09:23:37 +00:00
Jeroen Ketema
8f15abc285 Merge pull request #12146 from jketema/global-indirect
C++: Do not mark global indirect flow as spurious in dataflow tests
2023-02-10 10:21:04 +01:00
Michael Nebel
1bd223b8c8 Merge pull request #12103 from michaelnebel/csharp/scopedmodfier
C# 11: Scoped parameters and local variables.
2023-02-10 10:04:09 +01:00
Jeroen Ketema
350fb89ebf C++: Also mention all locations in the AST case 2023-02-10 09:49:24 +01:00
Mathias Vorreiter Pedersen
9aa9187dd7 Merge pull request #12141 from MathiasVP/fix-multiple-out-nodes
C++: Deduplicate `OutNode`s
2023-02-10 08:39:16 +00:00
Mathias Vorreiter Pedersen
4719fd5235 C++: Accept more test changes. 2023-02-10 08:38:46 +00:00
Jeroen Ketema
12930c68fb C++: Do not mark global indirect flow as spurious in dataflow tests 2023-02-10 09:29:27 +01:00
Paolo Tranquilli
fc7c72db77 Swift: tweaks to the schema doc documentation 2023-02-10 08:58:07 +01:00
Paolo Tranquilli
adf47b9a9c Merge branch 'main' into redsun82/swift-doc-for-schema-doc 2023-02-10 08:49:31 +01:00
Paolo Tranquilli
c92fd97783 Merge pull request #12140 from github/redsun82/swift-fix-upgrade
Swift: remove query predicates in upgrade/downgrade scripts
2023-02-10 08:49:08 +01:00
Geoffrey White
224bc9381a Swift: Fix ConditionElement.toString(). 2023-02-09 21:15:36 +00:00
Michael Nebel
8d8ebeade1 Merge pull request #12067 from michaelnebel/csharp/reflectionload
C#: Delete dead assembly load code.
2023-02-09 18:49:36 +01:00
Mathias Vorreiter Pedersen
981c976754 C++: Expand comments. 2023-02-09 17:10:07 +00:00
Mathias Vorreiter Pedersen
6b851d0529 C++: Fix an inconsistency with too many out nodes. 2023-02-09 16:55:19 +00:00
Paolo Tranquilli
7fa85b34ea Swift: remove query predicates in upgrade/downgrade scripts 2023-02-09 17:24:27 +01:00
Mathias Vorreiter Pedersen
7439de37a3 C++: Add a new test that demonstrates multiple out nodes. 2023-02-09 16:23:32 +00:00
Jeroen Ketema
9d6098af15 Merge pull request #12004 from jketema/single-use
C++: Map operand nodes that are only used once onto the related instruction node
2023-02-09 17:18:39 +01:00
Sim4n6
09df055d86 Fix the exists cast warning 2023-02-09 15:25:54 +01:00
Sim4n6
b04d5684fb add a blank line at the end of the file 2023-02-09 15:23:58 +01:00
Anders Schack-Mulligen
770f3c24bb Java: Improve performance of GeneratedFileMarker. 2023-02-09 15:08:32 +01:00
Sim4n6
16ef50401b Update python/ql/src/experimental/Security/UnsafeUnpackQuery.qll
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-02-09 14:59:28 +01:00
Ian Lynagh
968f588893 Merge pull request #12090 from igfoo/igfoo/kotlin-1.8.10
Kotlin: 1.8.10 and 1.8.20 are supported, and use 1.8.10 for CI
2023-02-09 12:06:42 +00:00
Paolo Tranquilli
1e279125dc Swift: add documentation for generated documentation 2023-02-09 12:52:16 +01:00
Michael Nebel
0f469ee0f7 C#: Add stats for the scoped annotation relation. 2023-02-09 12:28:15 +01:00
Arthur Baars
07947e6528 Address comments 2023-02-09 12:02:14 +01:00
Jeroen Ketema
e4c211df2d C++: Address review comments 2023-02-09 11:58:41 +01:00
dependabot[bot]
80a397b4a5 Merge pull request #12134 from github/dependabot/cargo/ruby/serde_json-1.0.93 2023-02-09 10:50:27 +00:00
Michael Nebel
d4985a99e0 C#: Add change note. 2023-02-09 11:32:09 +01:00
Michael Nebel
59ab353827 C#: Add upgrade and downgrade scripts. 2023-02-09 11:32:09 +01:00
Michael Nebel
54b45134ef C#: Add example code including tests. 2023-02-09 11:32:09 +01:00
Michael Nebel
c00b089aa8 C#: Introduce library support for scoped. 2023-02-09 11:32:08 +01:00
Michael Nebel
955f23d021 C#: Introduce extractor support for scoped variables and parameters. 2023-02-09 11:32:08 +01:00
Michael Nebel
dd6ceb7053 C#: Extend the DB schema with a scoped annotation relation. 2023-02-09 11:32:08 +01:00
Michael Nebel
7e174dce8b C#: Re-factor. Introduce variablekind enum. 2023-02-09 11:32:08 +01:00
Michael Nebel
89bebe9d36 C#: Re-factor local variable populate. 2023-02-09 11:32:08 +01:00
Michael B. Gale
ad4ae1c331 Merge pull request #12132 from github/mbg/fix/log-injection-precision
Go: Downgrade `go/log-injection` precision to medium
2023-02-09 10:29:24 +00:00
Michael B. Gale
70a6ff84af Add change note 2023-02-09 09:56:36 +00:00
Geoffrey White
0f6b05dedf Merge pull request #12126 from geoffw0/append
Swift: Move some models into collections
2023-02-09 09:33:08 +00:00
Michael Nebel
b895065be9 Merge pull request #12058 from michaelnebel/csharp/structdefaults
C# 11: Check that we get AST for structs that doesn't initialise all fields.
2023-02-09 09:51:00 +01:00
Anders Schack-Mulligen
3e2bf23bfe Merge pull request #12118 from michaelnebel/telemetry/performancefix
C#/Java: Materialize sink/source/summary predicates to avoid bad join order.
2023-02-09 09:39:38 +01:00
dependabot[bot]
bd98ae0dcc build(deps): bump serde_json from 1.0.91 to 1.0.93 in /ruby
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.91 to 1.0.93.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.91...v1.0.93)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-09 08:13:18 +00:00
Erik Krogh Kristensen
f2904ca29b Merge pull request #12135 from github/dependabot/cargo/ql/serde_json-1.0.93
build(deps): bump serde_json from 1.0.92 to 1.0.93 in /ql
2023-02-09 09:08:45 +01:00
dependabot[bot]
5e2f9e1568 build(deps): bump serde_json from 1.0.92 to 1.0.93 in /ql
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.92 to 1.0.93.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.92...v1.0.93)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-09 03:09:08 +00:00
Chris Smowton
f113eaa77d Merge pull request #12059 from pwntester/go_twirp_support
[GoLang] Add support for Twirp framework
2023-02-08 21:55:56 +00:00
Sim4n6
4196230a8a use if-then-else rather than nested exists 2023-02-08 21:46:50 +01:00
Sim4n6
9e285020a1 Comment modif + remove redundant cast 2023-02-08 21:14:53 +01:00
Michael B. Gale
46d49cd66f Downgrade log injection precision to medium
This is in line with the precision of this query for other languages
2023-02-08 15:49:06 +00:00
Michael Nebel
f6a02310d3 C#: Fix bad join order in TestLibrary characteristic predicate. 2023-02-08 16:37:49 +01:00
Owen Mansel-Chan
18335854b6 Update go/ql/lib/semmle/go/frameworks/Twirp.qll
Co-authored-by: Michael B. Gale <mbg@github.com>
2023-02-08 15:33:35 +00:00
Rasmus Wriedt Larsen
5c23b47ef4 Python: Fix typo in QLDoc
Co-authored-by: Taus <tausbn@github.com>
2023-02-08 16:27:06 +01:00
Rasmus Wriedt Larsen
8bb1d8631a Python: Add call-graph hotfix for sympy 2023-02-08 16:19:29 +01:00
Rasmus Wriedt Larsen
23144f584a Merge branch 'main' into call-graph-code 2023-02-08 16:17:34 +01:00
Mathias Vorreiter Pedersen
946e301ed6 Merge pull request #12079 from rdmarsh2/rdmarsh2/use-use-taint-test-reads
C++: allow read steps at the sink in IR taint test
2023-02-08 15:08:00 +00:00
Erik Krogh Kristensen
3ebac65167 apply change-note suggestions from doc review
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
2023-02-08 14:55:54 +01:00
Robert
13c7c8449c Merge pull request #12123 from github/robertbrignull/telemetry_privacy_docs
Update telemetry privacy document for UI interaction and exceptions
2023-02-08 13:40:35 +00:00
Mathias Vorreiter Pedersen
825628675e C++: Only allow implicit reads of fields that exist on the sink node's type. 2023-02-08 13:08:22 +00:00
Arthur Baars
78ad9d67b4 Address comments 2023-02-08 13:40:46 +01:00
Ian Lynagh
844e372651 Kotlin: Add a changenote for 1.8.20 support 2023-02-08 11:35:23 +00:00
Ian Lynagh
069c9674d1 Kotlin: Update supported versions 2023-02-08 11:35:23 +00:00
Ian Lynagh
6255298876 Kotlin: Use 1.8.10 for CI
I don't think there's any need for the CI version to be one of the
versions we build extractors for, so I've removed that check.
2023-02-08 11:35:23 +00:00
Chris Smowton
99bed0b089 Merge pull request #12127 from smowton/smowton/perf/golang-less-string-construction
Go: Consolidate repeated calls to `matches` and `regexpMatch`
2023-02-08 11:07:39 +00:00
Michael Nebel
02364d072e Java: Fix bad join in TestLibrary characteristic predicate. 2023-02-08 11:59:59 +01:00
Alvaro Muñoz
764155ce97 remove bracket 2023-02-08 11:57:03 +01:00
Michael B. Gale
3abf321071 Merge pull request #11496 from github/mbg/add/writable-file-closed-error-query
Go: Add query to detect lack of error handling for `os.File.Close` on writable handles
2023-02-08 10:53:44 +00:00
Owen Mansel-Chan
931c683146 Use regex for case-insensitive string comparisons
This is slightly more efficient.
2023-02-08 10:45:07 +00:00
erik-krogh
eb564760be improve qhelp based on doc review 2023-02-08 11:00:54 +01:00
Mathias Vorreiter Pedersen
7f09684577 Merge pull request #12121 from github/alexdenisov/extract-availability-info
Swift: extract availability info
2023-02-08 09:54:42 +00:00
Michael Nebel
f8dbbe006e C#/Java: Materialize sink/source/summary predicates to avoid join on input/output before filtering. 2023-02-08 10:04:43 +01:00
Owen Mansel-Chan
c427f8fc95 Do not import file defining a Configuration 2023-02-08 06:31:25 +00:00
Henry Mercer
6e9484970f Merge pull request #12128 from github/codeql-ci/atm/release-0.4.7
JS: Bump version numbers of ML-powered packs after 0.4.7 release
2023-02-07 22:29:20 +00:00
Henry Mercer
e972cb069e Merge branch 'main' into codeql-ci/atm/release-0.4.7 2023-02-07 21:31:08 +00:00
github-actions[bot]
4f76ebbb0b JS: Bump version of ML-powered library and query packs to 0.4.8 2023-02-07 19:44:25 +00:00
github-actions[bot]
30b2644f17 JS: Bump patch version of ML-powered library and query packs 2023-02-07 19:34:58 +00:00
Chris Smowton
99d3f689dc Consolidate repeated calls to matches and regexpMatch
This is especially useful if it avoids temporary string construction, such as toLowerCase().matches(...)
2023-02-07 19:22:49 +00:00
Robert
15b293c56d Apply copy edits 2023-02-07 17:11:47 +00:00
Geoffrey White
60e7d6b540 Swift: Move insert to RangeReplaceableCollection. 2023-02-07 17:08:23 +00:00
Geoffrey White
7cb665cde1 Swift: Move popLast to BidirectionalCollection and add popFirst. 2023-02-07 16:56:00 +00:00
Geoffrey White
d17c7bb0e8 Swift: Move first(_:), last(_:) into Sequence, BidirectionalCollection. 2023-02-07 16:47:02 +00:00
Geoffrey White
3586926157 Swift: Move first, last into Collection, BidirectionalCollection. 2023-02-07 16:36:06 +00:00
Taus
080ce09bd7 Python: Update six test expectations 2023-02-07 16:21:15 +00:00
Taus
8dea993f41 Python: Update failing test
Seems the name for the codec changed between Python 2 and 3. :)
2023-02-07 16:21:15 +00:00
Taus
49a3dd6131 Python: Clean up version handling
Depends on an internal PR.
2023-02-07 16:21:15 +00:00
Mathias Vorreiter Pedersen
334c41c3e1 Merge pull request #12122 from github/post-release-prep/codeql-cli-2.12.2
Post-release preparation for codeql-cli-2.12.2
2023-02-07 16:17:57 +00:00
Geoffrey White
b69d8625e5 Swift: Move append methods into RangeReplaceableCollection. 2023-02-07 16:07:35 +00:00
Geoffrey White
f9f08fff83 Swift: Use RangeReplaceableCollection in the test. 2023-02-07 16:03:51 +00:00
Tom Hvitved
8e8897b08b Data flow: Sync files 2023-02-07 15:15:04 +01:00
Tom Hvitved
10534b62c9 Data flow: Call context virtual dispatch pruning in stage 1 2023-02-07 15:14:27 +01:00
Robert
80a503b65d Update telemetry privacy document for UI interaction and exceptions 2023-02-07 14:00:22 +00:00
Mathias Vorreiter Pedersen
1980e25ac9 Merge pull request #12120 from MathiasVP/even-fewer-strings
C++: Avoid unnecessary calls to `toLowerCase()`
2023-02-07 13:57:12 +00:00
Alex Denisov
3448cde048 Swift: add database migration 2023-02-07 14:31:19 +01:00
Alex Denisov
712c25e6f4 Swift: extract availability info 2023-02-07 14:26:39 +01:00
github-actions[bot]
522a892d32 Post-release preparation for codeql-cli-2.12.2 2023-02-07 13:19:06 +00:00
Jeroen Ketema
20ce4cdf91 C++: Map operand nodes that are only used once onto the related instruction node 2023-02-07 14:17:54 +01:00
Mathias Vorreiter Pedersen
746f04bafc C++: Construct fewer strings. 2023-02-07 11:44:32 +00:00
Tom Hvitved
984729f9b0 Merge pull request #12117 from hvitved/ruby/delay-location-to-string
Ruby: Avoid computing `Location::toString` in full
2023-02-07 12:42:03 +01:00
Mathias Vorreiter Pedersen
ff29356ae9 Merge pull request #12106 from MathiasVP/fewer-strings
C++: Replace `toUpperCase().matches("...")` with case-insensitive `regexpMatch`
2023-02-07 11:31:36 +00:00
Paolo Tranquilli
c9397a5abf Merge pull request #10950 from github/redsun82/swift-regex
Swift: extract `RegexLiteralExpr`
2023-02-07 11:30:43 +01:00
Alvaro Muñoz
642a138eaa Update Twirp.qll 2023-02-07 10:44:48 +01:00
Geoffrey White
d8616e77d5 Merge pull request #12108 from geoffw0/strings3
Swift: Remove a no-longer-needed special case from swift/unsafe-js-eval.
2023-02-07 09:44:41 +00:00
Mathias Vorreiter Pedersen
aef66c462a Merge pull request #12107 from aibaars/downgrade-tree-sitter
Ruby: downgrade tree-sitter to 0.20.7
2023-02-07 09:29:42 +00:00
Paolo Tranquilli
a3b443c310 Swift: add upgrade/downgrade scripts for regex extraction 2023-02-07 10:21:37 +01:00
Paolo Tranquilli
ad04a408c7 Swift: add doc to RegexLiteralExpression 2023-02-07 10:21:37 +01:00
Paolo Tranquilli
50889b8fa1 Swift: move regex test to integration tests 2023-02-07 10:21:37 +01:00
Tom Hvitved
c0e3186607 Ruby: Avoid computing Location::toString in full 2023-02-07 10:06:47 +01:00
Paolo Tranquilli
d201c1eadd Swift: support linux-only tests 2023-02-07 09:41:06 +01:00
Paolo Tranquilli
a244b825df Merge branch 'main' into redsun82/swift-regex 2023-02-07 09:37:09 +01:00
Anders Schack-Mulligen
3c580896dc Merge pull request #11712 from aschackmull/java/constant-guards
Java: Apply deadcode guard to data flow nodes.
2023-02-07 09:14:20 +01:00
Harry Maclean
43ce26e4d0 Ruby: re-add Eval.rb 2023-02-07 09:37:26 +13:00
Jeroen Ketema
a4c3ea2efc Merge pull request #9245 from ihsinme/ihsinme-patch-102
CPP: Add query for CWE-805: Buffer Access with Incorrect Length Value using some functions
2023-02-06 21:24:07 +01:00
Jeroen Ketema
1c35109675 C++: Add experimental tag to experimental query 2023-02-06 20:31:26 +01:00
Jeroen Ketema
868f07bc91 Merge branch 'main' into ihsinme-patch-102 2023-02-06 20:16:53 +01:00
Geoffrey White
996536b08e Swift: Remove a no-longer-needed special case from swift/unsafe-js-eval. 2023-02-06 17:35:21 +00:00
ihsinme
065ca3c227 Update DivideByZeroUsingReturnValue.ql 2023-02-06 19:42:46 +03:00
Mathias Vorreiter Pedersen
4016299aa8 Update cpp/ql/lib/semmle/code/cpp/security/Encryption.qll
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-02-06 15:55:15 +00:00
Jeroen Ketema
d108185ec7 Merge pull request #12102 from jketema/fix-typos
C++: Fix some typos in the use-use dataflow code
2023-02-06 16:50:48 +01:00
Arthur Baars
12f5732782 Ruby: downgrade tree-sitter to 0.20.7
The 0.20.9 version caused a stack overflow error on
the mongo-ruby-driver repository.
2023-02-06 16:27:51 +01:00
Erik Krogh Kristensen
4eebeab8a8 Merge pull request #12078 from erik-krogh/qlCache
QL: simplify the QL-for-QL workflow, which should also fix the cache
2023-02-06 16:21:45 +01:00
Mathias Vorreiter Pedersen
1c9a526afa C++: Construct fewer strings. 2023-02-06 15:18:15 +00:00
erik-krogh
9364a85e49 add Rust format check to QL-for-QL tests 2023-02-06 14:26:30 +01:00
Erik Krogh Kristensen
9360ae9638 Merge pull request #12076 from erik-krogh/poly-sink-track
PY: add tracking of strings to compile-sites for poly-redos
2023-02-06 14:21:04 +01:00
Anders Schack-Mulligen
b4607d3fab Java: Add change notes. 2023-02-06 13:55:34 +01:00
Geoffrey White
dc59ed08f9 Merge pull request #12094 from geoffw0/string2
Swift: Models for the String class
2023-02-06 11:24:19 +00:00
Mathias Vorreiter Pedersen
9e96d6182d Merge pull request #12096 from MathiasVP/recognize-more-iterators
C++: Teach iterator flow about `std::back_inserter`
2023-02-06 11:08:21 +00:00
Chris Smowton
cd2fc6566f Merge pull request #12101 from owen-mc/go/gofmt-remove-confusing-error-message
Fix files that gofmt can't parse
2023-02-06 10:58:54 +00:00
Jeroen Ketema
30952f6a24 C++: Fix some typos in the use-use dataflow code 2023-02-06 11:56:59 +01:00
Mathias Vorreiter Pedersen
00fe448e3a Merge pull request #12072 from aschackmull/dataflow/stage3-perf
Dataflow: Fix join in `fwdFlowRead` (take 2)
2023-02-06 10:43:11 +00:00
Erik Krogh Kristensen
f32fa25c1a Merge pull request #12100 from github/dependabot/cargo/ql/serde_json-1.0.92
build(deps): bump serde_json from 1.0.91 to 1.0.92 in /ql
2023-02-06 10:33:32 +01:00
Arthur Baars
e382d6d000 Ruby: update stats 2023-02-06 10:28:19 +01:00
Arthur Baars
ec46f33a01 Ruby: add change note 2023-02-06 10:17:19 +01:00
Arthur Baars
f391948b53 Ruby: update expected output 2023-02-06 10:17:19 +01:00
Arthur Baars
4af0c4bb03 Ruby: desugar one-line pattern matches 2023-02-06 10:17:19 +01:00
Arthur Baars
3c15fd266d Ruby: add one-line pattern match test 2023-02-06 10:17:19 +01:00
Arthur Baars
edbba85b96 Ruby: add one-line pattern matches to AST 2023-02-06 10:17:18 +01:00
Arthur Baars
e390ca50b0 Ruby: upgrade/downgrade scripts 2023-02-06 10:17:18 +01:00
Arthur Baars
90c51ef404 Ruby: re-generate dbscheme and library 2023-02-06 10:17:18 +01:00
Arthur Baars
c554a10e06 Ruby: update tree-sitter-ruby 2023-02-06 10:17:18 +01:00
Michael B. Gale
f7a2a8677a Rename change note file 2023-02-06 09:13:11 +00:00
Michael B. Gale
6c0d2bdee1 Add example without defer statement 2023-02-06 09:10:41 +00:00
Mathias Vorreiter Pedersen
316eecc064 C++: Accept test changes. 2023-02-06 09:09:00 +00:00
Michael B. Gale
25f907867b Update expected test output 2023-02-06 08:51:46 +00:00
Michael B. Gale
abe38373da Inline precededBySync 2023-02-06 08:47:47 +00:00
Michael B. Gale
c252ec0414 Add test for deferred close that returns error 2023-02-06 08:47:47 +00:00
Michael B. Gale
e05bce9863 Update expected test results 2023-02-06 08:47:46 +00:00
Michael B. Gale
314ecab90a Use dominatesNode and improve variable naming 2023-02-06 08:47:46 +00:00
Michael B. Gale
85a339030b Make the query a path-problem 2023-02-06 08:47:46 +00:00
Michael B. Gale
199c8641ec Rename close to sink in query 2023-02-06 08:47:46 +00:00
Michael B. Gale
f648b021a9 Despecialise parameter names for precededBySync 2023-02-06 08:47:46 +00:00
Michael B. Gale
bd6c167be6 Fixup: more docs improvements 2023-02-06 08:47:46 +00:00
Michael B. Gale
f866e16679 Use any instead of exists for isCloseSink 2023-02-06 08:47:45 +00:00
Michael B. Gale
5ab6056b26 Fixup: docs comment 2023-02-06 08:47:45 +00:00
Michael B. Gale
3f446bc76e Use three-argument hasQualifiedName 2023-02-06 08:47:45 +00:00
Michael B. Gale
07041bb659 Use Method instead of Function where able 2023-02-06 08:47:45 +00:00
Michael B. Gale
416ed57583 Fix qldoc comments 2023-02-06 08:47:45 +00:00
Michael B. Gale
f321adf9f4 Fix typo
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-02-06 08:47:44 +00:00
Michael B. Gale
10109b4925 Fix class comments 2023-02-06 08:47:44 +00:00
Michael B. Gale
49ce91fd5b Update precision to high 2023-02-06 08:47:44 +00:00
Michael B. Gale
7e9617f3ce Detect lack of error handling for os.File.Close 2023-02-06 08:47:43 +00:00
Tamás Vajk
c03fe70b8d Merge pull request #12086 from tamasvajk/feature/fix-exception-handling-archive
C#: Change handled exception in `TrapWriter.ArchiveContents`
2023-02-06 08:53:56 +01:00
Owen Mansel-Chan
9ed7836367 Fix files that gofmt can't parse
We have some .go files that gofmt can't parse because they don't start
with "package". This was intentional, as they are fragments to be
included in .qhelp files. They don't affect the return code as gofmt
doesn't change their formatting, so this wasn't changing the result of
the check. However, it was confusing that when the check failed because
some other files weren't formatted correctly, the user would see the
stderr complaining about those files, so we capture stderr.

It would be an improvement to print which files are not formatted
correctly, but that was beyond my abilities with bash and makefiles.
2023-02-06 07:16:58 +00:00
dependabot[bot]
33e8414fc4 build(deps): bump serde_json from 1.0.91 to 1.0.92 in /ql
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.91 to 1.0.92.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.91...v1.0.92)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 03:29:59 +00:00
Sim4n6
ec82d61991 Add another frequently used step 2023-02-05 14:36:17 +01:00
Chris Smowton
03385ac0b5 Merge pull request #12097 from github/smowton/admin/macos-ventura
Add MacOS Ventura to supported platforms
2023-02-04 17:54:21 +00:00
Philip Ginsbach
8cefde36bf Merge pull request #12088 from github/ginsbach/DocumentFinalAlias
document final type aliases
2023-02-04 12:23:03 +00:00
Chris Smowton
f8b574c654 Add MacOS Ventura to supported platforms
Rebase of e8bf8fe7a4
2023-02-04 08:28:03 +00:00
Harry Maclean
02b09ca9f7 Ruby: Remove unused test files 2023-02-04 14:42:59 +13:00
Harry Maclean
cfb3bc9dce Ruby: Remove unused test file 2023-02-04 14:30:56 +13:00
Harry Maclean
0711326619 Ruby: Move PosixSpawn tests to their own directory 2023-02-04 14:30:23 +13:00
Harry Maclean
dbbef0534b Ruby: Move Core tests into core directory 2023-02-04 14:28:25 +13:00
Harry Maclean
b5d98d9011 Ruby: Move GraphQL test to their own directory 2023-02-04 14:25:38 +13:00
Harry Maclean
6c816d5602 Ruby: Move ActionDispatch tests to own directory 2023-02-04 14:19:08 +13:00
Harry Maclean
58d7af4018 Ruby: Move ActionView tests into their own dir
This ensures that changes to unrelated test files don't affect these
tests.
2023-02-04 14:19:08 +13:00
Mathias Vorreiter Pedersen
7642245747 Merge pull request #12095 from github/post-release-prep/codeql-cli-2.12.2
Post-release preparation for codeql-cli-2.12.2
2023-02-04 01:03:14 +00:00
Jami Cogswell
2d7e71dfce Java: add read-file sink kind for first arg of copy 2023-02-03 17:28:46 -05:00
Mathias Vorreiter Pedersen
559c799309 C++: Also recognize iterators obtained via a function that doesn't receive the container as a qualiifer. 2023-02-03 21:43:21 +00:00
github-actions[bot]
57f40ccd48 Post-release preparation for codeql-cli-2.12.2 2023-02-03 21:12:22 +00:00
Alvaro Muñoz
23c7bc8143 import RequestForgery from tests.ql 2023-02-03 22:05:50 +01:00
Jami
b6805c6913 Merge pull request #11863 from jcogs33/jcogs33/update-paramsString
Java: update paramsString
2023-02-03 15:47:38 -05:00
erik-krogh
ecafce8191 improve the CryptoJS model by using API::Node 2023-02-03 21:44:23 +01:00
Sarita Iyer
8edd378290 Merge pull request #12077 from github/codeql-cli-articles-migration-update
Update CodeQL CLI docs articles and links to point to new location on GitHub Docs site
2023-02-03 15:25:33 -05:00
Geoffrey White
364c173fc3 Swift: Accept additional taint flow in UnsafeJsEval test. 2023-02-03 19:21:10 +00:00
Geoffrey White
1f69fff26c Swift: Fix mistake caught by QL-for-QL. 2023-02-03 19:15:08 +00:00
Geoffrey White
f82a548cf9 Swift: Comments and formatting. 2023-02-03 18:50:51 +00:00
Geoffrey White
c666f9c845 Merge pull request #12089 from geoffw0/filedoc
Swift: QLDoc models files consistently.
2023-02-03 18:45:20 +00:00
Mathias Vorreiter Pedersen
77250af444 Merge pull request #12050 from MathiasVP/flow-out-of-iterators-3 2023-02-03 18:43:37 +00:00
Mathias Vorreiter Pedersen
431738175d Merge pull request #11171 from MathiasVP/global-flow 2023-02-03 18:42:46 +00:00
Geoffrey White
ec72c7504c Swift: Add a partial model of Collection. 2023-02-03 18:42:42 +00:00
Geoffrey White
e357b44943 Swift: Add a partial model of Sequence. 2023-02-03 18:42:42 +00:00
Geoffrey White
4bb0bbf488 Swift: Remove redundant copies. 2023-02-03 18:42:41 +00:00
Geoffrey White
e230951a14 Swift: Model StringProtocol methods. 2023-02-03 18:42:41 +00:00
Sarita Iyer
75b0676c95 Add tocs with links to deprecated articles 2023-02-03 13:37:53 -05:00
Jonas Jensen
41f7c7ae53 Merge pull request #12092 from jbj/aliases-upper-case 2023-02-03 18:40:53 +01:00
Alvaro Muñoz
04d5b7e579 make RequestForgery import private 2023-02-03 18:19:35 +01:00
Alvaro Muñoz
4b198f9af8 apply code review feedback 2023-02-03 18:12:49 +01:00
Mathias Vorreiter Pedersen
09a7573163 C++: Add comments to the new FP. 2023-02-03 17:09:19 +00:00
Alvaro Muñoz
844193d065 use regexp to capture generated file names 2023-02-03 18:08:56 +01:00
Mathias Vorreiter Pedersen
ae774a6b95 C++: Add a test with an indirect source. 2023-02-03 16:59:54 +00:00
Alvaro Muñoz
1d0e80c2f5 Apply suggestions from code review
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-02-03 17:59:29 +01:00
Alvaro Muñoz
3002230af9 remove duplicated import 2023-02-03 17:48:13 +01:00
Philip Ginsbach
1ec2c2591b fix documentation generator problem 2023-02-03 16:42:07 +00:00
Robert Marsh
ad8e82ac65 C++: allow read steps at the sink in IR taint test 2023-02-03 11:38:49 -05:00
Owen Mansel-Chan
2f637e2c8e Remove unused variable 2023-02-03 16:36:20 +00:00
Alvaro Muñoz
c517eb89b2 add more sinks 2023-02-03 17:33:08 +01:00
Jonas Jensen
73112e401c Change type name to upper case
QL doesn't allow types to be declared in lower case, so the example did
not compile.
2023-02-03 17:30:12 +01:00
Calum Grant
7d8b624a71 Basic script to generate shared code metrics 2023-02-03 16:24:39 +00:00
Philip Ginsbach
a354e776bf document final type aliases 2023-02-03 15:59:47 +00:00
Alvaro Muñoz
20dc30d7e8 add RequestForgery test 2023-02-03 16:38:56 +01:00
Philip Ginsbach
a639f13fd9 Merge pull request #12085 from github/ginsbach/DocumentModuleSignatureMemberDefaults
document module signature member defaults
2023-02-03 15:33:00 +00:00
Alvaro Muñoz
6b3d458865 Apply suggestions from code review
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-02-03 16:20:21 +01:00
Alvaro Muñoz
c7637a7e1f Apply suggestions from code review
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-02-03 16:19:48 +01:00
Alex Ford
7768026e70 Merge branch 'main' into js-use-shared-cryptography 2023-02-03 15:18:30 +00:00
Anders Schack-Mulligen
2d6d8aaa74 Java: Account for additional constants in ArrayIndexOutOfBounds query. 2023-02-03 16:16:39 +01:00
Anders Schack-Mulligen
a1aeb995e6 Java: Apply deadcode guard to data flow nodes. 2023-02-03 16:16:39 +01:00
Anders Schack-Mulligen
e8dbd65d77 Java: Refactor compile-time constant calculation and apply to ConstantIntegerExpr. 2023-02-03 16:16:27 +01:00
Alvaro Muñoz
a0cf8e786c fix SSRF sink 2023-02-03 16:16:00 +01:00
Alvaro Muñoz
7140b956e8 improve generated files matching predicates 2023-02-03 16:13:44 +01:00
Sarita Iyer
d99f7b56bd Merge branch 'codeql-cli-articles-migration-update' of https://github.com/github/codeql into codeql-cli-articles-migration-update 2023-02-03 09:56:51 -05:00
Sarita Iyer
c33c5ed517 Update codeql-cli links 2023-02-03 09:56:49 -05:00
Alex Ford
6c35feaa98 ConceptsShared: add a default implementation of BlockMode CryptographicOperation#getBlockMode() for compatibility with external code 2023-02-03 14:39:32 +00:00
Alex Ford
b968b59afc CryptoAlgorithms: make CryptographicAlgorithm#matchesName hold only if that algorithm is the most specific match 2023-02-03 14:15:32 +00:00
Tamas Vajk
f90c5346bf C#: Change handled exception in TrapWriter.ArchiveContents 2023-02-03 15:13:23 +01:00
Mathias Vorreiter Pedersen
0a6f914bfc C++: Make the documentation on 'isSink' less ambiguous. 2023-02-03 14:09:01 +00:00
Mathias Vorreiter Pedersen
0aed890b15 C++: Undo QLDoc change. 2023-02-03 14:02:55 +00:00
erik-krogh
8e05fdb369 make more imports private 2023-02-03 15:00:31 +01:00
erik-krogh
c5350ca6a0 add change-note 2023-02-03 14:47:58 +01:00
erik-krogh
cf094c2f4f adjust which folders are seen as exported to remove an FP 2023-02-03 14:47:55 +01:00
erik-krogh
848b24cfe4 adjust concept tests after changing subprocess model 2023-02-03 14:47:55 +01:00
erik-krogh
ef44cb86c2 remove FPs related to parameters that are meant to be commands 2023-02-03 14:47:55 +01:00
erik-krogh
e9ebba3350 assume shell=False for subprocess calls, fixes FPs in e.g. youtube-dl 2023-02-03 14:47:55 +01:00
erik-krogh
d228cf0e7b use more API-nodes to model subprocess.run (and friends) 2023-02-03 14:47:55 +01:00
erik-krogh
bce83bfc4e add failing test for indirectly setting the shell=true flag for subprocess.run 2023-02-03 14:47:55 +01:00
erik-krogh
0a2c7d062c add Fabric test, and add tracking of the shell flag in Fabric 2023-02-03 14:47:55 +01:00
erik-krogh
6bbc4f4a48 add more tests 2023-02-03 14:47:55 +01:00
erik-krogh
33c506d7fe add minimal test for Array join as a sink, and learn that the order is flipped compared to JS. Thanks Copilot! 2023-02-03 14:47:55 +01:00
erik-krogh
5bddfc0d79 add test for f-strings as sink 2023-02-03 14:47:55 +01:00
erik-krogh
47a06d2824 add library inputs as a source, and get minimal test to work 2023-02-03 14:47:55 +01:00
erik-krogh
7fcc548665 add py/shell-command-constructed-from-input, but without a source.
It's a very direct port from Ruby, with only minor adjustments to fit the Python APIs
2023-02-03 14:47:55 +01:00
erik-krogh
187cfd7be7 add isShellInterpreted to the SystemCommandExecution concept 2023-02-03 14:47:54 +01:00
Geoffrey White
38eeb9c747 Swift: Model String methods. 2023-02-03 12:26:55 +00:00
Alex Ford
e17b3d975d JS: pick up CryptographicKeys used in asmCrypto encrypt/decrypt calls 2023-02-03 12:16:25 +00:00
Alex Ford
6b2a92a7ca JS: update CryptographicKey.expected 2023-02-03 12:12:47 +00:00
Geoffrey White
1077dcd2e3 Swift: Model String initializers. 2023-02-03 11:36:35 +00:00
Philip Ginsbach
b8bd98e476 Merge pull request #12075 from github/ginsbach/RemoveIncorrectStatement
remove statement about namespaces from documentation that no longer holds
2023-02-03 11:18:07 +00:00
Geoffrey White
142ca0c9fb Swift: Model StringProtocol initializers. 2023-02-03 10:53:44 +00:00
Geoffrey White
d888510688 Swift: Fix incorrect taint to String fields. 2023-02-03 10:21:52 +00:00
Geoffrey White
d25de8c764 Swift: Taint fields of StringProtocol. 2023-02-03 10:16:33 +00:00
Philip Ginsbach
e552a6206d shadowing and visibility of default predicates 2023-02-03 10:11:25 +00:00
Geoffrey White
21abe54d8d Swift: Greatly extend tests of taint through strings. 2023-02-03 10:11:12 +00:00
Philip Ginsbach
09fdf744d4 introduce module signature member defaults 2023-02-03 10:01:59 +00:00
Geoffrey White
bf6ef43451 Swift: Document library model files consistently. 2023-02-03 09:59:35 +00:00
erik-krogh
3545bb0819 adjust qhelp based on review 2023-02-03 10:50:18 +01:00
Mathias Vorreiter Pedersen
4e7ca1a175 Merge pull request #12082 from github/post-release-prep/codeql-cli-2.12.2
Post-release preparation for codeql-cli-2.12.2
2023-02-03 09:40:57 +00:00
Philip Ginsbach
808d3e3a1f Merge pull request #12084 from github/ginsbach/IncorrectEnvironmentNumbering
we actually only distinguish four environments
2023-02-03 09:37:39 +00:00
Alvaro Muñoz
50bd0707ce remove redundant import 2023-02-03 10:19:35 +01:00
Alvaro Muñoz
3a9d650cb9 add qldocs for member predicates 2023-02-03 10:09:16 +01:00
Philip Ginsbach
56e0b19df8 we actually only distinguish four environments 2023-02-03 09:04:43 +00:00
Alvaro Muñoz
8cb022713e include review feedback 2023-02-03 10:01:55 +01:00
Arthur Baars
9a4cec7691 Merge pull request #11956 from aibaars/json-log
Ruby: structured logging
2023-02-03 09:54:49 +01:00
Alvaro Muñoz
13242df149 Apply suggestions from code review
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-02-03 09:45:00 +01:00
Alvaro Muñoz
dd31be43e0 Support for Twirp framework 2023-02-03 09:35:22 +01:00
github-actions[bot]
faf21f3edb Post-release preparation for codeql-cli-2.12.2 2023-02-02 23:01:04 +00:00
erik-krogh
6e712b293a add tracking of strings to compile-sites for poly-redos, in the style of Ruby 2023-02-02 22:56:20 +01:00
Jami Cogswell
30b1a2edbc Java: add first argument to copy sink 2023-02-02 16:20:54 -05:00
Jami Cogswell
61a8f5e425 Java: add signature to createTempDirectory sink 2023-02-02 16:19:20 -05:00
erik-krogh
34266cfa4c simplify the QL-for-QL workflow, which should also fix the cache 2023-02-02 22:17:38 +01:00
Sarita Iyer
fd977cc277 Update CONTRIBUTING.md 2023-02-02 16:13:13 -05:00
Sim4n6
a0150849cb Updated the expected test file 2023-02-02 21:42:47 +01:00
Sarita Iyer
465a3e0ece fix typo 2023-02-02 15:36:34 -05:00
Alex Ford
b0b8f8725e JS: add some CryptographicOperation#getBlockMode() tests 2023-02-02 20:30:30 +00:00
Alex Ford
aa2c532a78 JS: adjust test whitespace 2023-02-02 20:30:30 +00:00
Alex Ford
c25dc978df JS: add blockMode to CryptographicOperation tests 2023-02-02 20:30:30 +00:00
Alex Ford
1435ef1862 CryptoAlgorithms: make CryptographicAlgorithm#matchesName split on underscores 2023-02-02 20:30:30 +00:00
Alex Ford
983055b8f9 JS: Use shared CryptographicOperation concept and implement BlockMode getBlockMode() 2023-02-02 20:30:30 +00:00
Alex Ford
e5dfbe2c8d ConceptsShared: Add BlockMode#matchesString(string) predicate 2023-02-02 20:27:52 +00:00
Alex Ford
61095b3c58 ConceptsShared: Add deprecated DataFlow::Node CryptographicOperation#getInput() predicate 2023-02-02 20:27:05 +00:00
Sarita Iyer
9943d0c054 update anchor links 2023-02-02 15:26:53 -05:00
Sim4n6
1a8c9abee2 Incorporate Sink & Source as steps from TarSlipQry 2023-02-02 21:09:40 +01:00
Sarita Iyer
9b17ee9326 add back hidden toc tree 2023-02-02 14:39:49 -05:00
Sarita Iyer
0ab982891e adding back toc-trees to fix error 2023-02-02 14:31:03 -05:00
Sarita Iyer
2772cf79f4 Update CodeQL CLI articles with migration message 2023-02-02 14:11:02 -05:00
erik-krogh
52959d7c0a add failing test for not tracking strings to re.compile 2023-02-02 19:10:32 +01:00
Erik Krogh Kristensen
c8cfb6a0cc Merge pull request #12065 from knewbury01/knewbury01/fix-js-cleartext-logging-doc
Update JS CleartextLogging qhelp
2023-02-02 18:23:59 +01:00
Philip Ginsbach
55cd436b06 Merge pull request #12074 from github/ginsbach/DocumentShadowing2
shadowing in the QL language specification
2023-02-02 17:13:47 +00:00
Philip Ginsbach
1542353af7 statement no longer holds for namespaces with shadowing 2023-02-02 16:55:06 +00:00
Alvaro Muñoz
2576a09af9 remove unnecessary line 2023-02-02 17:50:50 +01:00
Nora Dimitrijević
a3a01ddc11 Merge pull request #11855 from d10c/swift/extract-captures 2023-02-02 17:50:41 +01:00
Mathias Vorreiter Pedersen
cd660e1067 Merge pull request #12071 from github/release-prep/2.12.2
Release preparation for version 2.12.2
2023-02-02 16:49:44 +00:00
Philip Ginsbach
ab184ebd78 shadowing in the QL language specification 2023-02-02 16:19:18 +00:00
Kristen Newbury
21b4931fbb Merge branch 'main' into knewbury01/fix-js-cleartext-logging-doc 2023-02-02 11:12:57 -05:00
Kristen Newbury
231110ddca Update javascript/ql/src/Security/CWE-312/CleartextLogging.qhelp
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2023-02-02 11:12:44 -05:00
Henry Mercer
65863f1fc7 Merge pull request #10826 from github/dependabot/github_actions/actions/setup-dotnet-3.0.2
build(deps): bump actions/setup-dotnet from 2 to 3
2023-02-02 15:54:55 +00:00
Philip Ginsbach
1472d4b782 Merge pull request #12062 from github/ginsbach/DocumentShadowing
shadowing in the handbook
2023-02-02 15:52:54 +00:00
Anders Schack-Mulligen
67d4ed53b9 Dataflow: Sync. 2023-02-02 16:33:00 +01:00
Anders Schack-Mulligen
8cb233df1a Dataflow: A proper perf fix for the stage-dependent fanout direction of the Content-to-Ap relation. 2023-02-02 16:31:07 +01:00
Jeroen Ketema
3cf5107b45 Apply suggestions from code review 2023-02-02 15:48:29 +01:00
github-actions[bot]
a4fa984792 Release preparation for version 2.12.2 2023-02-02 14:34:55 +00:00
Michael Nebel
77283be6c0 Merge pull request #12068 from michaelnebel/csharp/dotnetpublishtest
C#: Avoid that the dotnet publish test refers to a specific .NET vers…
2023-02-02 15:34:06 +01:00
Michael Nebel
960f776e29 C#: Avoid that the dotnet publish test refers to a specific .NET version. 2023-02-02 14:18:50 +01:00
Philip Ginsbach
4282e1a18e explicitly mention aliases 2023-02-02 13:04:43 +00:00
Philip Ginsbach
2b719d503d visible namespaces also include private imports 2023-02-02 13:03:30 +00:00
Michael Nebel
ae10a6beb0 C#: Check that we get AST for struct that doesn't initialize all fields. 2023-02-02 12:50:59 +01:00
Mathias Vorreiter Pedersen
b53963a791 C++: QLDoc. 2023-02-02 11:49:31 +00:00
Michael Nebel
3cd2024a66 Merge pull request #12060 from michaelnebel/csharp11/nameof
C# 11: Nameof on attribute declarations.
2023-02-02 12:46:28 +01:00
Nora Dimitrijević
ad5dbe18a4 Swift: db upgrade/downgrade script 2023-02-02 12:00:47 +01:00
Rasmus Wriedt Larsen
db114bb104 Merge branch 'main' into call-graph-code 2023-02-02 11:56:55 +01:00
Nora Dimitrijević
50e5b29eb7 Swift: all Callables can have captures [codegen'd] 2023-02-02 11:56:51 +01:00
Nora Dimitrijević
ce2e7f1d12 Swift: all Callables can have captures [hand-written] 2023-02-02 11:35:50 +01:00
Nora Dimitrijević
d230431006 Swift: extract closure captures (codegen'd part) 2023-02-02 11:35:49 +01:00
Nora Dimitrijević
6895c113cf Swift: extract closure captures (hand-written part) 2023-02-02 11:30:33 +01:00
Nora Dimitrijević
87f7bc3a63 Swift: introduce closure capture AST test 2023-02-02 11:30:33 +01:00
Mathias Vorreiter Pedersen
968fff29ac Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into flow-out-of-iterators-3 2023-02-02 09:12:02 +00:00
Michael Nebel
470e4b64ea C#: Delete assembly load code as it always throws a PlatformNotSupported exception. 2023-02-02 10:06:04 +01:00
Tony Torralba
62158c5e49 Merge pull request #12044 from atorralba/atorralba/webview-models
Swift: Add new source and flow step related to WkWebView
2023-02-02 09:27:21 +01:00
Michael Nebel
4089845ea4 C#: Test that nameof can used on method parameters and type parameters in attribute declarations. 2023-02-02 09:25:24 +01:00
dependabot[bot]
787fe38d90 build(deps): bump actions/setup-dotnet from 2 to 3.0.2
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 2 to 3.0.2.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v2...v3.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-02 08:09:43 +00:00
Michael Nebel
7271d9987e Merge pull request #11940 from michaelnebel/csharp/dotnet7
C#: Update project targets, workflows and other scripts to use .NET 7.
2023-02-02 08:14:55 +01:00
Nora Dimitrijević
e137993acd Merge pull request #12061 from d10c/cpp/missing-check-scanf-join-order-fix 2023-02-02 07:57:21 +01:00
Kristen Newbury
dc5eb40d5f Update JS CleartextLogging qhelp 2023-02-01 16:29:13 -05:00
Harry Maclean
d671cc6e43 Merge pull request #12052 from hmac/barrier-guard-fix 2023-02-02 08:16:07 +13:00
Chuan-kai Lin
255f989ede Merge pull request #12034 from cklin/document-assume-small-delta
Document pragma[assume_small_delta]
2023-02-01 10:36:40 -08:00
Alvaro Muñoz
d6f1dfa205 update tests 2023-02-01 17:58:32 +01:00
Philip Ginsbach
c5deb8544b rework documentation of namespaces to take account of shadowing 2023-02-01 16:56:35 +00:00
Tony Torralba
24527bfc4e Minor change in WKNavigationDelegateSource to work around a bug 2023-02-01 17:44:08 +01:00
Tony Torralba
644bc56568 Add new source and flow step related to WkWebView 2023-02-01 17:44:06 +01:00
Tony Torralba
407e7cbbde Merge pull request #12045 from atorralba/atorralba/more-custom-url-schemes
Swift: Add more sources for custom URL schemes
2023-02-01 17:40:20 +01:00
Joe Farebrother
97b2e852c9 Merge pull request #11713 from joefarebrother/sensitive-result-receiver
Java: Add query for leaking sensitive data through a ResultReceiver
2023-02-01 16:34:17 +00:00
Nora Dimitrijević
1df0be3ca2 C++: Fix join order in cpp/missing-check-scanf
The issues were:
* `revFlow`: `revFlow` joins `fwdFlow` on `vn`.
* `Node.getASuccessor()`: `MkNode` self-join on `vn`.
* `hasFlow/5`: `MkNode` self-join on `vn`.
2023-02-01 16:29:43 +01:00
Tony Torralba
834fc51a3a Update java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql 2023-02-01 15:26:26 +01:00
Tony Torralba
43b234eeb5 Switch to MaD models for UISceneDelegate methods 2023-02-01 15:15:51 +01:00
Tony Torralba
f7cc5f9627 Add more sources for custom URL schemes
Also add the appropriate steps so that these sources are useful
2023-02-01 15:07:37 +01:00
Alvaro Muñoz
4d6b35f891 apply gofmt 2023-02-01 14:51:48 +01:00
Alvaro Muñoz
70a151af02 add change-notes 2023-02-01 14:49:30 +01:00
Geoffrey White
96ee0f68b0 Merge pull request #11935 from geoffw0/protocol-extension
Swift: Flow sources through protocol extensions
2023-02-01 13:47:09 +00:00
Alvaro Muñoz
a3188f2e10 address review feedback 2023-02-01 14:43:51 +01:00
Mathias Vorreiter Pedersen
eb31160ae0 C++: Accept test changes. 2023-02-01 13:42:03 +00:00
Alvaro Muñoz
3502ab6523 fix missing QLDocs and refactor ServiceInterface 2023-02-01 14:37:38 +01:00
Mathias Vorreiter Pedersen
702b10ff96 Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into global-flow 2023-02-01 13:37:10 +00:00
Mathias Vorreiter Pedersen
0e1dcc8062 C++: Accept test changes. These all appear to be good changes. 2023-02-01 13:25:37 +00:00
Mathias Vorreiter Pedersen
136b5d189c C++: Small cleanup by making 'GlobalUse' extend 'UseImpl'. 2023-02-01 13:24:40 +00:00
Rasmus Wriedt Larsen
fdb33ff48e Python: Fix grammar in change-note
Co-authored-by: Taus <tausbn@github.com>
2023-02-01 14:01:20 +01:00
Alvaro Muñoz
afa6b1cec5 Initial support for Twirp framework 2023-02-01 13:55:09 +01:00
Joe Farebrother
74dba953ca Apply suggestions from docs review
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
2023-02-01 12:54:19 +00:00
Erik Krogh Kristensen
bc36a75bde Merge pull request #12057 from erik-krogh/syncPyFlow
PY: Sync a dataflow config
2023-02-01 11:58:40 +01:00
erik-krogh
77e014c5a4 sync added dataflow config 2023-02-01 11:46:57 +01:00
Erik Krogh Kristensen
01f6862965 Merge pull request #11833 from erik-krogh/trackPyReg
PY: track string-constants to regular expression uses
2023-02-01 11:40:42 +01:00
Arthur Baars
a46061541b Ruby: address review comment 2023-02-01 09:59:05 +01:00
Arthur Baars
fa81d9da18 Apply suggestions from code review
Co-authored-by: Harry Maclean <hmac@github.com>
2023-02-01 09:47:39 +01:00
Tony Torralba
837cdf7782 Merge pull request #12046 from atorralba/atorralba/urlrequest-models
Swift: Add taint for URLRequest fields
2023-02-01 09:24:17 +01:00
Geoffrey White
b9d487ac35 Merge branch 'main' into protocol-extension 2023-02-01 08:21:05 +00:00
Jeroen Ketema
ce8a84abb3 Merge pull request #12043 from jketema/subpaths
C++: Fix missing subpaths when displaying dataflow paths
2023-02-01 09:17:16 +01:00
Erik Krogh Kristensen
16049d694b Merge pull request #12055 from github/dependabot/cargo/ql/tracing-0.1.37
Bump tracing from 0.1.35 to 0.1.37 in /ql
2023-02-01 09:07:11 +01:00
dependabot[bot]
373148decd Bump tracing from 0.1.35 to 0.1.37 in /ql
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.35 to 0.1.37.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.35...tracing-0.1.37)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 03:11:28 +00:00
Harry Maclean
da45d3aa7f Ruby: Fix string comparison barrier guard
`strNode` was not properly restricted for some cases.
2023-02-01 14:40:53 +13:00
Harry Maclean
0d68d88741 Merge pull request #11934 from hmac/actioncontroller-filters 2023-02-01 09:10:30 +13:00
Geoffrey White
7f58a2222a Merge branch 'main' into protocol-extension 2023-01-31 16:06:55 +00:00
Mathias Vorreiter Pedersen
88338bdfcf C++: Flow out of functions that write to iterators. 2023-01-31 15:11:47 +00:00
Chris Smowton
6b0b73b5f6 Merge pull request #12033 from intrigus-lgtm/patch-8
Fix errorneous slash
2023-01-31 14:39:51 +00:00
Mathias Vorreiter Pedersen
41ea71c31c Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-01-31 14:12:23 +00:00
Mathias Vorreiter Pedersen
a2248e6ca6 Merge pull request #12030 from MathiasVP/iterator-public-models
C++: Make iterator classes public
2023-01-31 14:11:52 +00:00
Mathias Vorreiter Pedersen
0d38ff8e8c Merge pull request #11920 from gsingh93/bit-shift-range
C++: Improve left shift and right shift range analysis accuracy
2023-01-31 14:01:41 +00:00
Erik Krogh Kristensen
8bc9ce749f Merge pull request #12038 from github/dependabot/cargo/ql/tracing-subscriber-0.3.16
Bump tracing-subscriber from 0.3.15 to 0.3.16 in /ql
2023-01-31 14:35:35 +01:00
Arthur Baars
57012714d6 Ruby: serialize timestamps as ISO8601 2023-01-31 14:32:29 +01:00
dependabot[bot]
56a0b1d2d8 Merge pull request #12024 from github/dependabot/cargo/ruby/clap-3.0.14 2023-01-31 13:30:21 +00:00
dependabot[bot]
597c71011e Bump tracing-subscriber from 0.3.15 to 0.3.16 in /ql
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.15 to 0.3.16.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.15...tracing-subscriber-0.3.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-31 13:09:13 +00:00
Erik Krogh Kristensen
683761098d Merge pull request #12041 from github/dependabot/cargo/ql/flate2-1.0.25
Bump flate2 from 1.0.24 to 1.0.25 in /ql
2023-01-31 14:07:09 +01:00
Mathias Vorreiter Pedersen
fcc4c91739 C++: More responding to comments. 2023-01-31 13:01:00 +00:00
dependabot[bot]
7f22c4c474 Bump clap from 3.0.12 to 3.0.14 in /ruby
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.12 to 3.0.14.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.0.12...v3.0.14)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-31 12:49:34 +00:00
dependabot[bot]
8410e46067 Bump flate2 from 1.0.24 to 1.0.25 in /ql
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.24 to 1.0.25.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.24...1.0.25)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-31 12:48:10 +00:00
Erik Krogh Kristensen
481dab700c Merge pull request #12037 from github/dependabot/cargo/ql/num_cpus-1.14.0
Bump num_cpus from 1.13.1 to 1.14.0 in /ql
2023-01-31 13:45:43 +01:00
Michael Nebel
478474bbed C#: Add ref field test case. 2023-01-31 13:35:47 +01:00
yoff
7ae389bb28 Merge pull request #12026 from erik-krogh/nodePty
JS: add code-injection sink for node-pty
2023-01-31 13:27:32 +01:00
Michael Nebel
ecadb56419 C#: Update CIL consistency test expected output. 2023-01-31 13:21:00 +01:00
Michael Nebel
5657bd0547 C#: Update type annontations test to exclude OS specific stuff. 2023-01-31 13:21:00 +01:00
Michael Nebel
177fcbb4eb C#: Update attribute test to exclude OS specific declarations. 2023-01-31 13:21:00 +01:00
Michael Nebel
0ed48616a7 C#: Use stubs for CWE-321/HardcodedSymmetricEncryptionKey. 2023-01-31 13:21:00 +01:00
Michael Nebel
9808482c41 C#: Update Minimal stubs from source testcase expected output. 2023-01-31 13:21:00 +01:00
Michael Nebel
3510f465b2 C#: Use stubs for ThreadUnsafeICryptoTransformLambda. 2023-01-31 13:21:00 +01:00
Michael Nebel
f3555b1076 C#: Update options files as some classes has been moved to other dll's. 2023-01-31 13:21:00 +01:00
Michael Nebel
5ccfc4d3f4 C#: Add System.Security.Cryptography as a dependency to the HashWithoutSalt query test. 2023-01-31 13:21:00 +01:00
Michael Nebel
fd74c10b06 C#: Use stubs for ThreadUnsafeICryptoTransform. 2023-01-31 13:21:00 +01:00
Michael Nebel
14888d4382 C#: Use stubs for CWE-327 test cases. 2023-01-31 13:21:00 +01:00
Michael Nebel
89de6cb8a0 C#: Update library tests. 2023-01-31 13:20:59 +01:00
Michael Nebel
33a923a85b C#: Use IsKind instead of Kind (compiler warning). 2023-01-31 13:20:59 +01:00
Michael Nebel
3a4e5700e8 C#: Update project targets, workflows and other scripts to use .NET 7. 2023-01-31 13:20:59 +01:00
Michael Nebel
86e9bf2f81 Merge pull request #11996 from michaelnebel/csharp/refstructreffield
C# 11: Extractor support for `ref` fields in `ref struct`.
2023-01-31 13:08:57 +01:00
dependabot[bot]
423bab54d3 Bump num_cpus from 1.13.1 to 1.14.0 in /ql
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.13.1 to 1.14.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.13.1...v1.14.0)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-31 12:05:11 +00:00
Erik Krogh Kristensen
38bcb2b727 Merge pull request #12039 from github/dependabot/cargo/ql/serde-1.0.152
Bump serde from 1.0.140 to 1.0.152 in /ql
2023-01-31 13:03:03 +01:00
dependabot[bot]
198b97ca8d Bump serde from 1.0.140 to 1.0.152 in /ql
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.140 to 1.0.152.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.140...v1.0.152)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-31 11:48:44 +00:00
Erik Krogh Kristensen
f2526d1784 Merge pull request #12040 from github/dependabot/cargo/ql/tree-sitter-0.20.9
Bump tree-sitter from 0.20.8 to 0.20.9 in /ql
2023-01-31 12:46:43 +01:00
Gulshan Singh
1a109cab4d Remove unicode characters 2023-01-31 03:38:03 -08:00
dependabot[bot]
807b715320 Bump tree-sitter from 0.20.8 to 0.20.9 in /ql
Bumps [tree-sitter](https://github.com/tree-sitter/tree-sitter) from 0.20.8 to 0.20.9.
- [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-01-31 11:27:40 +00:00
Erik Krogh Kristensen
34ca12e5d2 Merge pull request #12042 from erik-krogh/qlTools
QL: update codeql-action in QL-for-QL
2023-01-31 12:24:37 +01:00
Mathias Vorreiter Pedersen
1a27a069ac Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-01-31 11:15:42 +00:00
erik-krogh
94cec17505 bump codeql-action 2023-01-31 12:09:21 +01:00
erik-krogh
4436ec070e ensure the test is run when the workflow is updated 2023-01-31 12:09:21 +01:00
Geoffrey White
ee442e4d4b Merge pull request #11979 from geoffw0/modern1
Swift: Modernize injection queries
2023-01-31 10:54:35 +00:00
erik-krogh
0cefa98490 add missing word to the change-note 2023-01-31 11:53:17 +01:00
Mathias Vorreiter Pedersen
daf7d1b7e7 C++: Add more QLDoc. 2023-01-31 10:37:51 +00:00
Mathias Vorreiter Pedersen
7583fe2ad8 C++: Respond to PR reviews. 2023-01-31 10:31:02 +00:00
Tony Torralba
e9a46c926d Add taint for URLRequest fields 2023-01-31 11:15:45 +01:00
erik-krogh
95c19698c7 add change-note 2023-01-31 11:09:07 +01:00
Jeroen Ketema
24891c3f43 C++: Fix missing subpaths when displaying dataflow paths 2023-01-31 10:57:06 +01:00
erik-krogh
e5e8496084 fix QL-for-QL warnings 2023-01-31 10:55:27 +01:00
Arthur Baars
d944c2bd79 Ruby: address comments 2023-01-31 10:22:12 +01:00
Gulshan Singh
2f38d363ff Fix typo in dependsOnChild 2023-01-30 19:55:53 -08:00
Gulshan Singh
fb31570af3 Fix bitshift test 2023-01-30 19:55:53 -08:00
Gulshan Singh
1758e25207 Merge lshift/rshift range expressions into a single file and address PR comments 2023-01-30 19:55:53 -08:00
Gulshan Singh
051d36ee6a Add ConstantLShiftExprRange and ConstantRShiftExprRange classes 2023-01-30 19:55:53 -08:00
Gulshan Singh
5710289460 Add bitshift test 2023-01-30 19:55:53 -08:00
Harry Maclean
c99a096c9b Ruby: Update test fixtures 2023-01-31 11:27:19 +13:00
Harry Maclean
69ed00cdf1 Ruby: QL4QL fix 2023-01-31 11:06:32 +13:00
Mathias Vorreiter Pedersen
cd596403a0 Merge pull request #12031 from MathiasVP/ir-get-call-predicate 2023-01-30 21:23:02 +00:00
erik-krogh
c2e8206090 add more array taint steps that taint the entire array 2023-01-30 21:14:27 +01:00
Chuan-kai Lin
396d2de6e7 Document pragma[assume_small_delta] 2023-01-30 11:42:57 -08:00
intrigus-lgtm
f23d517236 Fix errorneous slash
The additional slash causes the request to fail.
Compare `gh api /repos/openjdk/jdk/code-scanning/codeql/databases/` (fails) with:
```
gh api /repos/openjdk/jdk/code-scanning/codeql/databases/
{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest"
}
gh: Not Found (HTTP 404)
```
While `gh api /repos/openjdk/jdk/code-scanning/codeql/databases` (works).
2023-01-30 20:26:40 +01:00
Mathias Vorreiter Pedersen
a01a4734ed C++/C#: Sync identical files. 2023-01-30 17:32:53 +00:00
Mathias Vorreiter Pedersen
3a1a9a771c C++: Add a 'getCall' predicate to 'ArgumentOperand'. 2023-01-30 17:31:52 +00:00
Mathias Vorreiter Pedersen
f90007ae71 C++: Make our iterator models public. 2023-01-30 17:23:52 +00:00
erik-krogh
962465f77a add array-taint-steps to unsafe-shell-command-construction 2023-01-30 16:56:03 +01:00
Mathias Vorreiter Pedersen
be359a32c0 Merge pull request #11976 from MathiasVP/fewer-uses-2
C++: Don't count every conversion as a use
2023-01-30 15:51:12 +00:00
erik-krogh
a4c42aa14b more custom array steps from unsafe-code-construction to a utility predicate 2023-01-30 16:46:13 +01:00
erik-krogh
31743afa87 add change-note 2023-01-30 16:34:23 +01:00
erik-krogh
e01002368f add query detecting validators that use badly anchored regular expressions on library/remote input 2023-01-30 16:34:20 +01:00
Jami
7f6efae7dc Merge pull request #12008 from jcogs33/jcogs33/update-queryproducer-package
Java: update package for `QueryProducer` sinks
2023-01-30 10:27:58 -05:00
Alexander Eyers-Taylor
89d835b9ec Merge pull request #11988 from github/alexet/force-java-11
Use Java 11 for some integration tests
2023-01-30 15:19:00 +00:00
Nora Dimitrijević
fb88372c0f Merge pull request #11862 from d10c/swift/rename-iterabledeclcontext 2023-01-30 16:03:49 +01:00
AlexDenisov
48434f4be3 Merge pull request #12025 from github/alexdenisov/ignore-sandbox-exec
Swift: ignore sandbox-exec
2023-01-30 15:59:19 +01:00
erik-krogh
02da718786 add code-injection sink for node-pty 2023-01-30 15:14:25 +01:00
Alex Denisov
b71c5e6c4b Swift: ignore sandbox-exec 2023-01-30 15:10:30 +01:00
Mathias Vorreiter Pedersen
22202afbf5 Merge pull request #12007 from MathiasVP/fix-is-chi-before-iterator-use
C++: Add missing condition to `isChiBeforeIteratorUse`
2023-01-30 14:01:39 +00:00
Erik Krogh Kristensen
862948f1cc Merge pull request #12014 from erik-krogh/axios
JS: add support for axios used as a global variable
2023-01-30 14:55:49 +01:00
Ian Lynagh
25e703e562 Merge pull request #11579 from igfoo/igfoo/only_lockless
Kotlin: Remove legacy trap-locking support
2023-01-30 13:44:31 +00:00
Michael Nebel
115a0a4318 C#: Add change note. 2023-01-30 14:28:35 +01:00
Michael Nebel
b25414fe93 C#: Add DB upgrade and downgrade scripts. 2023-01-30 14:28:35 +01:00
Michael Nebel
ff546c1497 C#: Add test cases for ref fields. 2023-01-30 14:28:35 +01:00
Michael Nebel
2be090bb91 C#: Add predicate isRef to the CIL Field class. 2023-01-30 14:28:35 +01:00
Michael Nebel
db047c2c4a C#: Extract CIL fields using their underlying types for a reference type field and annotate the field as a reference type. 2023-01-30 14:28:35 +01:00
Michael Nebel
812bc20812 C#: Add CIL fields as entities that can carry type annotations. 2023-01-30 14:28:35 +01:00
Michael Nebel
23acd5c255 C#: Small re-factor of the Modifier class. 2023-01-30 14:28:34 +01:00
Michael Nebel
3a4ec90ae9 C#: Extraction of ref modifier for fields. 2023-01-30 14:28:34 +01:00
Erik Krogh Kristensen
e46960e0cf Merge pull request #12022 from github/dependabot/cargo/ql/regex-1.7.1
Bump regex from 1.6.0 to 1.7.1 in /ql
2023-01-30 13:11:54 +01:00
dependabot[bot]
e3afb1640a Bump regex from 1.6.0 to 1.7.1 in /ql
Bumps [regex](https://github.com/rust-lang/regex) from 1.6.0 to 1.7.1.
- [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.6.0...1.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 11:19:30 +00:00
Erik Krogh Kristensen
8198bbf893 Merge pull request #12019 from github/dependabot/cargo/ql/serde_json-1.0.91
Bump serde_json from 1.0.82 to 1.0.91 in /ql
2023-01-30 12:16:49 +01:00
Nora Dimitrijević
9346f4d760 Swift: fix failing tests 2023-01-30 11:39:06 +01:00
dependabot[bot]
f430e83fca Bump serde_json from 1.0.82 to 1.0.91 in /ql
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.82 to 1.0.91.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.82...v1.0.91)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 10:36:14 +00:00
Erik Krogh Kristensen
f647910e0c Merge pull request #12018 from erik-krogh/qlDependabot
QL: fixup the dependabot config for QL-for-QL
2023-01-30 11:35:05 +01:00
Erik Krogh Kristensen
78683e4e8a Merge pull request #11879 from erik-krogh/rbRegConcept
RB: add a RegexExecution concept, and use it for better regexp tracking
2023-01-30 11:33:09 +01:00
erik-krogh
40a576b775 fixup the dependabot config for QL-for-QL 2023-01-30 11:22:17 +01:00
erik-krogh
f04a9cb523 Merge branch 'main' into rbRegConcept 2023-01-30 11:05:40 +01:00
Erik Krogh Kristensen
3508a4b799 Merge pull request #12016 from erik-krogh/newEntity
QL: support the NewEntity module in QL-for-QL
2023-01-30 11:01:11 +01:00
Arthur Baars
907ebb723e Merge branch 'main' into json-log 2023-01-30 10:49:42 +01:00
erik-krogh
54c4c23b46 support the NewEntity module in QL-for-QL 2023-01-30 10:34:06 +01:00
Mathias Vorreiter Pedersen
7cc7675cdc C++: Accept query changes. These are just deduplications. 2023-01-30 09:26:14 +00:00
Mathias Vorreiter Pedersen
6a8c570915 Merge pull request #12009 from MathiasVP/fix-fwd-flow-read-join
DataFlow: Fix join in `fwdFlowRead`
2023-01-30 09:23:43 +00:00
Mathias Vorreiter Pedersen
1b45c5f96a C++: Accept test changes. 2023-01-30 09:13:42 +00:00
Mathias Vorreiter Pedersen
9de8d5c501 C++: Reduce the number of uses by excluding conversions. 2023-01-30 09:13:42 +00:00
Mathias Vorreiter Pedersen
7ecc3466cf C++: Add another column to 'conversionFlow'. 2023-01-30 09:13:42 +00:00
Harry Maclean
f7cdd430a2 Ruby: Small fix 2023-01-30 21:55:19 +13:00
Harry Maclean
7778524e08 Ruby: Refactor 2023-01-30 21:52:59 +13:00
Rasmus Wriedt Larsen
c7e552b343 Python: Fix grammar in qldoc
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-30 09:45:45 +01:00
Rasmus Wriedt Larsen
a1c2f4c138 Python: Small rewrite of **kwargs getParameter logic 2023-01-30 09:42:43 +01:00
Harry Maclean
5e9210fcea Ruby: use getAnAncestor 2023-01-30 21:21:38 +13:00
Harry Maclean
708e303c01 Ruby: Model except: with a const argument 2023-01-30 21:17:31 +13:00
Harry Maclean
28716866d8 Ruby: getAction -> getAnAction 2023-01-30 18:52:47 +13:00
Harry Maclean
246ad46eb1 Ruby: Account for filter skip ordering
A `skip_*_filter :foo` call only has an effect if there was an earlier
call that registered `:foo` as a filter.
2023-01-30 18:50:30 +13:00
Harry Maclean
a164e76a5d Ruby: Model actioncontroller filter overrides
If a filter is registered twice with the same name, the last
registration wins.
2023-01-30 18:05:22 +13:00
Harry Maclean
28c3bd3e2f Ruby: QL4QL fix 2023-01-30 17:41:36 +13:00
Harry Maclean
fb86ef4aac Ruby: Model ActionController filters
ActionController filters provide a way to register callbacks that run
before, after or around an action (i.e. HTTP request handler). They run
in the same class context as the action, so can get/set instance
variables and generally interact with the action in arbitrary ways.

In order to track flow between filters and actions, we have to model the
callback chain. This commit does that. A later change will add dataflow
steps to actually track flow through the chain.
2023-01-30 17:41:36 +13:00
Sim4n6
7079def7ce Add an S3 source with Session or download_fileobj 2023-01-30 00:49:23 +01:00
erik-krogh
e3455a9b21 add support for axios used as a global variable 2023-01-29 22:55:20 +01:00
Mathias Vorreiter Pedersen
9573395237 Merge pull request #12005 from MathiasVP/flow-out-of-invalid-functions
C++: Flow out of invalid functions
2023-01-29 16:15:40 +00:00
Sim4n6
0707064ab5 Constrain the save/path step 2023-01-28 10:14:24 +01:00
Sim4n6
a4aaf0ec6f Remove a write step & update the builtin open step 2023-01-28 09:53:54 +01:00
Nora Dimitrijević
d5f11dfe60 Swift: db upgrade/downgrade script 2023-01-28 00:44:49 +01:00
Nora Dimitrijević
1396d07662 Swift: subsume IterableDeclContext into Decl [tests] 2023-01-28 00:44:49 +01:00
Nora Dimitrijević
9a5614e8c5 Swift: subsume IterableDeclContext into Decl [codegen'd] 2023-01-28 00:44:49 +01:00
Nora Dimitrijević
f96c18a6db Swift: subsume IterableDeclContext into Decl [hand-written] 2023-01-28 00:44:48 +01:00
Sim4n6
0e2f37825d Organize steps to correspond to the sample code 2023-01-27 23:58:03 +01:00
Sim4n6
ee213123ac Add builtin open as an additional step 2023-01-27 18:16:11 +01:00
Mathias Vorreiter Pedersen
95b15825f9 DataFlow: Sync identical files. 2023-01-27 16:24:31 +00:00
Mathias Vorreiter Pedersen
a691535e77 C++: Fix join order in 'fwdFlowRead'. 2023-01-27 16:24:08 +00:00
Jami Cogswell
85c228a0cd Java: remove old sinks 2023-01-27 10:40:17 -05:00
Jami Cogswell
a3fe8c0e93 Java: add change note 2023-01-27 10:35:16 -05:00
Jami Cogswell
9bf43483db Java: update package for QueryProducer sinks 2023-01-27 10:16:42 -05:00
Sim4n6
0b27b1314a Update python/ql/src/experimental/Security/UnsafeUnpackQuery.qll
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-27 16:12:08 +01:00
Sim4n6
7a126a2317 Merge branch 'github:main' into UnsafeUnpack 2023-01-27 16:09:41 +01:00
Sim4n6
8ef2aa00e7 Update python/ql/src/experimental/Security/UnsafeUnpackQuery.qll
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-27 16:07:39 +01:00
Rasmus Wriedt Larsen
cef933f813 Python: Add comment explaining SINK3_F(kwargs["c"]) test
Co-authored-by: yoff <yoff@github.com>
2023-01-27 15:48:59 +01:00
Geoffrey White
6c0b50c696 Merge pull request #11980 from geoffw0/modern2
Swift: Structure modernized queries more consistently
2023-01-27 14:33:43 +00:00
Geoffrey White
794ba428a7 Merge pull request #11942 from geoffw0/rncrypt4
Swift: add RNCryptor sinks to swift/static-initialization-vector
2023-01-27 14:33:06 +00:00
Rasmus Wriedt Larsen
c099dbd04c Python: Expand notes around bound methods self argument passing 2023-01-27 15:27:45 +01:00
Sim4n6
207ed3da9c Constrain the object & the call 2023-01-27 15:07:20 +01:00
Mathias Vorreiter Pedersen
587b4fee9d C++: Add missing condition to 'isChiBeforeIteratorUse'. 2023-01-27 14:04:01 +00:00
James Fletcher
812306cb52 Merge pull request #12006 from felickz/patch-2
Add link to codeql metadata article for problem.severity
2023-01-27 13:59:06 +00:00
Mathias Vorreiter Pedersen
e48c93a3b5 Merge pull request #12003 from MathiasVP/positive-formulated-sanitizer-nonconst-format
C++: Positively phrased sanitizer in `cpp/non-constant-format`
2023-01-27 13:58:04 +00:00
alexet
1b0952c512 Use Java 11 for some integration tests 2023-01-27 13:51:44 +00:00
Chad Bentz
4fee536e6d table spacing 2023-01-27 08:19:43 -05:00
Sim4n6
18d8bbc9a4 Updated the expected results accordingly 2023-01-27 14:05:25 +01:00
Chad Bentz
3ef4d3118c Add link to codeql metadata article for problem.severity 2023-01-27 08:01:07 -05:00
Sim4n6
e41042418a Update the import relative to the dataflow config 2023-01-27 13:46:57 +01:00
Sim4n6
5f0bf1053a Update the dataflow test query and the expected results 2023-01-27 13:42:57 +01:00
Sim4n6
bca053f855 Move the config query to the parent directory 2023-01-27 13:42:14 +01:00
Mathias Vorreiter Pedersen
2b47e150c6 C++: Accept test changes. 2023-01-27 11:44:17 +00:00
Mathias Vorreiter Pedersen
ec7b406cc9 C++: Generate flow out of parameters whose enclosing function is missing a return statement. 2023-01-27 11:44:04 +00:00
Rasmus Wriedt Larsen
02b3a1b515 Python: At most one **kwargs ParameterNode per callable
Similar to the Ruby changes from
https://github.com/github/codeql/pull/11461

I feel the change to `DataFlowFunciton.getParameter` where we use
`not exists(func.getArgByName(_))` is not very great, but I was not allowed
to use `not exists(this.getParameter(any(ParameterPosition _).isKeyword(_)))`
because of negative recursion.
2023-01-27 11:14:42 +01:00
Mathias Vorreiter Pedersen
e8db563e98 C++: Reformulate the sanitizer in 'NonConstantFormat.ql'. It should no longer incorrectly sanitize indirect nodes for which there is no result for 'asIndirectExpr'. 2023-01-27 10:04:48 +00:00
Robert Marsh
6a91e85981 C++: fix UseImpl after merge conflict 2023-01-26 16:01:37 -05:00
Sim4n6
998f1bf215 Some reformatting 2023-01-26 18:54:36 +01:00
Robert Marsh
3648f26cca Merge remote-tracking branch 'origin/mathiasvp/replace-ast-with-ir-use-usedataflow' into global-flow
Resolved trivial conflicts.
2023-01-26 11:58:53 -05:00
Ian Lynagh
75562e7fb5 Kotlin: Remove legacy trap-locking support 2023-01-26 16:58:51 +00:00
Mathias Vorreiter Pedersen
ee62f2a223 C++: Fix global variable exclusion in DTT. 2023-01-26 16:49:58 +00:00
Mathias Vorreiter Pedersen
8c224429b3 C++: Better 'getType' for global variable nodes. 2023-01-26 16:49:49 +00:00
Nora
5993b60980 Update copy 2023-01-26 17:37:15 +01:00
Sim4n6
1a211485a4 Restrain the source and add two steps. 2023-01-26 17:07:59 +01:00
Michael B. Gale
f192191e8c Merge pull request #11997 from github/smowton/fix/deperrors-conditional
Go: Fix DepErrors test
2023-01-26 14:52:27 +00:00
Sim4n6
51b11de44a Add a Django Upload examples 2023-01-26 15:16:24 +01:00
Mathias Vorreiter Pedersen
bfe9ae22ad Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-01-26 13:03:49 +00:00
Mathias Vorreiter Pedersen
508027e0e5 Merge pull request #11998 from MathiasVP/fix-iterator-test 2023-01-26 12:35:12 +00:00
Sim4n6
54cc4d6498 Opt for any source from RemoteFlowSource. 2023-01-26 12:51:55 +01:00
Mathias Vorreiter Pedersen
13baa5b60b C++: Add iterator typedefs to properly instantiate 'int_iterator_by_trait' and 'insert_iterator_by_trait'. 2023-01-26 11:43:33 +00:00
Chris Smowton
7921de243a Fix DepErrors test
This was likely harmlessly causing `go get` reruns, since most (all?) real dependency errors cause `go list` to exit with a nonzero return code in any case.
2023-01-26 11:37:41 +00:00
dependabot[bot]
295152cd32 Merge pull request #11992 from github/dependabot/cargo/ruby/serde-1.0.152 2023-01-26 10:17:56 +00:00
dependabot[bot]
bf02340a6a Merge pull request #11982 from github/dependabot/cargo/ruby/num_cpus-1.14.0 2023-01-26 10:13:09 +00:00
Sim4n6
aaa0040612 Seperate the dataflow config from the query 2023-01-26 08:53:47 +01:00
dependabot[bot]
6e69acdd7e Bump serde from 1.0.131 to 1.0.152 in /ruby
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.131 to 1.0.152.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.131...v1.0.152)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-26 03:08:58 +00:00
Sim4n6
9464940214 Add expected results for argparse source 2023-01-26 01:00:19 +01:00
Sim4n6
2e4cb63049 Optimize the Argparse filename as a source. 2023-01-26 01:00:01 +01:00
Sim4n6
f867c9008f Commit the expected results 2023-01-26 00:08:54 +01:00
Sim4n6
9b5b0c60b8 Handle the download of a tarball using wget pkg. 2023-01-26 00:02:20 +01:00
Sim4n6
22af6f5182 Restrict download_file() to boto3 lib 2023-01-25 23:00:00 +01:00
Harry Maclean
07a7a213b3 Merge pull request #11871 from hmac/rack 2023-01-26 08:40:30 +13:00
Sim4n6
2d38993075 Add a missing "and" 2023-01-25 19:46:13 +01:00
Sim4n6
0ed480855a Update python/ql/src/experimental/Security/CWE-022bis/UnsafeUnpack.ql
Yes, definitely

Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-25 19:44:28 +01:00
Sim4n6
10d6ebf95b Use of inline tests for dataflow queries 2023-01-25 19:28:05 +01:00
Sim4n6
b5a6f6e165 Merge pull request #1 from github/main
Sync with the upstream
2023-01-25 19:13:35 +01:00
Rasmus Wriedt Larsen
1fcfae2464 Merge pull request #11987 from RasmusWL/suite-lists
Misc: Add `security-experimental` to `generate-code-scanning-query-list.py`
2023-01-25 17:29:36 +01:00
Geoffrey White
e92a5eb467 Merge pull request #11911 from geoffw0/rncrypt2
Swift: Add RNCryptor sinks to swift/hardcoded-key
2023-01-25 15:11:16 +00:00
Rasmus Wriedt Larsen
e8714c9edb Misc: Add Swift to generate-code-scanning-query-list.py 2023-01-25 15:22:20 +01:00
Rasmus Wriedt Larsen
b220c2f51d Misc: Add security-experimental to generate-code-scanning-query-list.py
Since not all experimental queries is part of this new suite, it's nice
to be able to list them explicitly without having to replicate the logic
from the .qls file.
2023-01-25 15:20:49 +01:00
Geoffrey White
f6fe627f4b Merge pull request #11914 from geoffw0/rncrypt3
Swift: Add RNCryptor sinks to swift/constant-salt
2023-01-25 13:05:33 +00:00
Alex Ford
3dd9392f5e Merge pull request #11869 from alexrford/rails/render_locals_shared
Ruby: Rails - generalize rails flow step for accessing render locals hash in view
2023-01-25 12:07:26 +00:00
Erik Krogh Kristensen
39e9eaf2bc Merge pull request #11986 from erik-krogh/redosNote2
RB: add note in ReDoS qhelp that Ruby 3.2 has fixed ReDoS
2023-01-25 11:56:04 +01:00
Paolo Tranquilli
f4cb920624 Merge pull request #11932 from github/redsun82/swift-docs
Swift: add and fix some `schema.py` documentation
2023-01-25 10:52:00 +01:00
Geoffrey White
fe13137b48 Swift: Make default implementations private. 2023-01-25 09:29:03 +00:00
erik-krogh
54b0350cac add note in ReDoS qhelp that Ruby 3.2 has fixed ReDoS 2023-01-25 10:24:11 +01:00
Rasmus Wriedt Larsen
f262dc68f8 Python: Reword note about debugging getNextClassInMro 2023-01-25 10:08:43 +01:00
dependabot[bot]
531c0559a0 Bump num_cpus from 1.13.0 to 1.14.0 in /ruby
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-25 08:48:08 +00:00
Arthur Baars
358ae7529b Merge pull request #11973 from github/dependabot/cargo/ruby/serde_json-1.0.91
Bump serde_json from 1.0.72 to 1.0.91 in /ruby
2023-01-25 09:45:32 +01:00
Arthur Baars
068b71bc3d Merge pull request #11972 from github/dependabot/cargo/ruby/regex-1.7.1
Bump regex from 1.5.5 to 1.7.1 in /ruby
2023-01-25 09:44:57 +01:00
Arthur Baars
e634ab771f Merge pull request #11971 from github/dependabot/cargo/ruby/flate2-1.0.25
Bump flate2 from 1.0.22 to 1.0.25 in /ruby
2023-01-25 09:44:29 +01:00
Rasmus Wriedt Larsen
63b2bd0871 Python: Fixup test_only_starargs addition
validTest.py did not pass, since we use `SINK3_F`.

I initially tried swapping the order

```
args = (arg1, arg2) # $ arg1 arg2 func=starargs_only
more_args = (arg4, arg3)
starargs_only(*args, *more_args)
```

But then asked myself, what is it _actually_ we're testing here? and it
seems to be the way we handle multiple *args arguments in the same call,
so I converted the test to be that instead! (and it matches what we do
in test_stararg_mixed)
2023-01-25 09:37:07 +01:00
Erik Krogh Kristensen
99bad77972 Merge pull request #11906 from erik-krogh/moreStem
JS: expand what is parsed as the stem of a pathexpr
2023-01-25 08:44:44 +01:00
erik-krogh
80d05c0425 also recognize protected methods as library-input sources 2023-01-24 20:55:25 +01:00
erik-krogh
a017b7500b Merge branch 'main' into rbPoly 2023-01-24 20:51:36 +01:00
Geoffrey White
439d9199be Swift: Add CSV extension points. 2023-01-24 19:28:05 +00:00
Geoffrey White
13d308a4d6 Swift: Autoformat. 2023-01-24 19:15:51 +00:00
Geoffrey White
5375678ca6 Swift: Add consistent CSV extension points. 2023-01-24 18:49:50 +00:00
Geoffrey White
6a210d719b Swift: Rename QueryExtensions.qll files for consistency. 2023-01-24 17:58:13 +00:00
Paolo Tranquilli
ddef87f6e2 Merge pull request #10956 from github/redsun82/swift-linkage-awareness
Swift: disambuigate entities using linkage awareness on modules
2023-01-24 18:49:24 +01:00
Geoffrey White
6a946f6eed Swift: Modernize. 2023-01-24 17:26:51 +00:00
Paolo Tranquilli
4880ab41a2 Swift: use weakly_canonical instead of canonical
`weakly_canonical` will resolve as much as possible in the path, and not
return an error if it can't resolve everything (for example due to a
non existant file). In any case in case of problems with the file we
will see an error when actually using the resolved path.

This tunes down some unhelpful log messages.
2023-01-24 16:34:47 +01:00
Paolo Tranquilli
a74247e5d8 Swift: add filename to an error message 2023-01-24 16:29:10 +01:00
Paolo Tranquilli
6b77e6748a Swift: use same implementation for createTarget{Link,Object}Domain 2023-01-24 16:27:21 +01:00
Geoffrey White
78eff0dc60 Swift: Split off the Extensions.qll as well. 2023-01-24 15:19:41 +00:00
James Fletcher
176b2cae19 Merge pull request #11882 from github/charisk/rename-vscode-run-query-cmd
Rename VS Code Extension Run Query command
2023-01-24 15:17:30 +00:00
Geoffrey White
cbfa7e7252 Swift: Move query logic into .qlls. 2023-01-24 15:04:10 +00:00
Paolo Tranquilli
23344a7183 Merge branch 'main' into redsun82/swift-linkage-awareness 2023-01-24 15:47:44 +01:00
Jeroen Ketema
ae2fa6c1a4 Merge pull request #11975 from MathiasVP/another-dataflow-loop
C++: Add another looping dataflow test
2023-01-24 14:21:16 +01:00
Mathias Vorreiter Pedersen
b1dcb01ed7 Merge pull request #11977 from MathiasVP/accept-test-changes
C++: Accept test changes on the use-use flow branch
2023-01-24 12:00:04 +00:00
Mathias Vorreiter Pedersen
ec297fb838 C++: Accept more test changes. 2023-01-24 11:59:14 +00:00
Mathias Vorreiter Pedersen
9f9c486268 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-01-24 11:39:04 +00:00
Mathias Vorreiter Pedersen
7fb9db49be C++: Accept test changes. 2023-01-24 11:11:11 +00:00
Calum Grant
522c9d640d Merge pull request #11957 from github/yoff-list-support-for-python-3.11
Update supported-versions-compilers.rst
2023-01-24 10:15:11 +00:00
Mathias Vorreiter Pedersen
510211a4c7 C++: Add testcase with looping behavior in C/C++ def-use flow. 2023-01-24 09:44:30 +00:00
Michael Nebel
4df615f994 Merge pull request #11922 from michaelnebel/csharp11/strings
C# 11: String related functionality.
2023-01-24 10:31:31 +01:00
Michael Nebel
0b04654f33 C#: Update expected test output. 2023-01-24 09:51:47 +01:00
Michael Nebel
4c966f2b8a C#: Add some more UTF-8 encoded string examples. 2023-01-24 09:49:38 +01:00
Mathias Vorreiter Pedersen
ca5916f3dc Merge pull request #11946 from MathiasVP/fix-taint-models-2 2023-01-24 08:13:43 +00:00
dependabot[bot]
fd22c7c73e Bump serde_json from 1.0.72 to 1.0.91 in /ruby
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.72 to 1.0.91.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.72...v1.0.91)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-24 06:39:13 +00:00
dependabot[bot]
c4bf25f33c Bump regex from 1.5.5 to 1.7.1 in /ruby
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.5 to 1.7.1.
- [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.5.5...1.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-24 06:39:09 +00:00
dependabot[bot]
b1f73b59cd Bump flate2 from 1.0.22 to 1.0.25 in /ruby
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.22 to 1.0.25.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.22...1.0.25)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-24 06:39:03 +00:00
Arthur Baars
c512eddb69 Merge pull request #11969 from hmac/simplify-ruby-dependabot-config
Ruby: Simplify dependabot config
2023-01-24 07:34:45 +01:00
Harry Maclean
8050639b16 Ruby: Simplify dependabot config
Dependabot is able to understand cargo workspaces, so it's not necessary
to enumerate each workspace member. It should be enough to configure it
with the workspace root directory. This will hopefully ensure that the
Cargo.lock file gets updated correctly.
2023-01-24 16:37:10 +13:00
Harry Maclean
e6e4e29bf8 Ruby: newline 2023-01-23 21:53:52 +00:00
Harry Maclean
224db456af Ruby: Simplify isRackResponse 2023-01-23 21:53:09 +00:00
Harry Maclean
60f9635ada Ruby: Move import 2023-01-23 21:51:27 +00:00
Harry Maclean
c1207e0938 Ruby: Fix rack response tracking
Use type tracking instead of getReturningNode, which seems to be faster
and works correctly for the cases I've tried.
2023-01-23 21:43:04 +00:00
erik-krogh
49f5e89f36 update expected output for experimental query 2023-01-23 22:29:49 +01:00
Erik Krogh Kristensen
fc66c905ff Merge pull request #11859 from erik-krogh/moreShell
JS: slightly broaden the regular expression that recognizes bad string-concats used as shell commands
2023-01-23 22:26:17 +01:00
Mathias Vorreiter Pedersen
ecbcee5bc8 Merge pull request #11945 from MathiasVP/refactor-param-out-nodes-2 2023-01-23 21:21:13 +00:00
Henry Mercer
21e63a8a86 Merge pull request #11967 from github/codeql-ci/atm/release-0.4.6
JS: Bump version numbers of ML-powered packs after 0.4.6 release
2023-01-23 20:43:18 +00:00
Henry Mercer
241951f53e Merge branch 'main' into codeql-ci/atm/release-0.4.6 2023-01-23 18:24:36 +00:00
github-actions[bot]
be481d975c JS: Bump version of ML-powered library and query packs to 0.4.7 2023-01-23 18:22:18 +00:00
github-actions[bot]
40a67d61d2 JS: Bump patch version of ML-powered library and query packs 2023-01-23 18:15:56 +00:00
Geoffrey White
25bcaa3a54 Merge pull request #11966 from geoffw0/usenumerics
Swift: Use numeric types in CleartextLogging.qll.
2023-01-23 18:06:17 +00:00
Sid Shankar
e32823c3e0 Merge pull request #11964 from github/sidshank/update-supported-language-versions-Jan-2023
Update supported language versions in documentation
2023-01-23 12:12:43 -05:00
Geoffrey White
19527016a5 Swift: Use numeric types in CleartextLogging.qll. 2023-01-23 16:52:03 +00:00
Geoffrey White
5ddff790b6 Swift: Autoformat. 2023-01-23 16:46:58 +00:00
Rasmus Wriedt Larsen
0879c8f8e1 Python: Expand comments on C3 MRO 2023-01-23 17:40:24 +01:00
Rasmus Wriedt Larsen
80324735bb Python: Fixup annotation for CWE-022-PathInjection/pathlib_use.py 2023-01-23 17:40:24 +01:00
Mathias Vorreiter Pedersen
79b77b01fd Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-01-23 15:49:36 +00:00
Sid Shankar
f77d156e9a Update supported version of Java 2023-01-23 15:41:35 +00:00
Sid Shankar
444df6fccb Update supported version of Go 2023-01-23 15:41:02 +00:00
Erik Krogh Kristensen
240248b9cf Merge pull request #11453 from erik-krogh/unsafeHtmlConstruction
RB: add unsafe-html-construction query
2023-01-23 16:40:25 +01:00
erik-krogh
11894144aa remove regular expression that did nothing 2023-01-23 16:38:09 +01:00
Jeroen Ketema
0a0d6d0841 Merge pull request #11963 from MathiasVP/testcase-with-loop
C++: Add testcase with looping behavior
2023-01-23 16:33:36 +01:00
Erik Krogh Kristensen
5be97f3761 Merge pull request #11909 from erik-krogh/concatCode
Rb: recognize string concatenations as sinks for unsafe-code-construction
2023-01-23 16:22:46 +01:00
Mathias Vorreiter Pedersen
a217017859 C++: Add testcase with looping behavior in C/C++ use-use flow. 2023-01-23 14:29:39 +00:00
erik-krogh
ae00518ddf remove the isAdditionalTaintStep predicate from UnsafeHtmlConstructionQuery, as it was not needed 2023-01-23 15:27:19 +01:00
erik-krogh
7c6ee5f293 Merge branch 'main' into unsafeHtmlConstruction 2023-01-23 15:01:01 +01:00
Erik Krogh Kristensen
32c4cf5769 Apply suggestions from code review
Co-authored-by: Alex Ford <alexrford@users.noreply.github.com>
2023-01-23 14:58:04 +01:00
erik-krogh
800077dabe changes based on feedback 2023-01-23 14:54:36 +01:00
Erik Krogh Kristensen
a10b45e0db Merge pull request #11927 from mvogelgesang/express-rate-limit
JS: Updated express-rate-limit example to match implementation examples f…
2023-01-23 14:37:50 +01:00
Jeroen Ketema
05ecd2e015 Merge pull request #11958 from jketema/argv-if-tests
C++: Add some additional uncontrolled format string tests
2023-01-23 14:05:07 +01:00
erik-krogh
3cece50f78 add encodeURIComponent as a sanitizer for request-forgery 2023-01-23 13:53:53 +01:00
erik-krogh
be8ef1b324 add failing test 2023-01-23 13:52:36 +01:00
Erik Krogh Kristensen
45aaeb897a Merge pull request #11955 from erik-krogh/docFrameworks
JS: add Fastify and restify to the list of supported frameworks
2023-01-23 13:14:15 +01:00
Philip Ginsbach
78a2dfa7c4 Merge pull request #11939 from github/ginsbach/DocumentNewNamespaces
document new namespaces
2023-01-23 12:12:49 +00:00
Chris Smowton
fea97a22c6 Merge pull request #11827 from smowton/smowton/admin/test-gradle-script-parsing
Java: Add integration tests for Android projects
2023-01-23 11:39:24 +00:00
Philip Ginsbach
8a3972049b fix grammar 2023-01-23 11:15:22 +00:00
Mathias Vorreiter Pedersen
9dbea539ed Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into refactor-param-out-nodes-2 2023-01-23 10:51:46 +00:00
Jeroen Ketema
cfc0dabad9 C++: Add some additional uncontrolled format string tests
These duplicate the `i9` and `i91` tests slightly earlier in the same file, but
use an explicit `if` instead of the ternary operator.
2023-01-23 11:50:45 +01:00
Mathias Vorreiter Pedersen
470abfd0aa C++: Conflate iterator value and indirection for taint-flow to fix AST dataflow. 2023-01-23 10:40:25 +00:00
yoff
fe0290fb39 Update supported-versions-compilers.rst
List 3.11 as supported for Python
2023-01-23 11:33:32 +01:00
Rasmus Wriedt Larsen
753192bb4d Merge branch 'main' into call-graph-code 2023-01-23 11:25:02 +01:00
Mathias Vorreiter Pedersen
962b651c44 C++: Fix models. 2023-01-23 10:10:02 +00:00
Alex Ford
3b10a2de11 Merge branch 'main' into rails/render_locals_shared 2023-01-23 10:00:22 +00:00
Alex Ford
55550e7980 Merge pull request #11941 from alexrford/summary-component-tostring-syntheticglobal
Add missing toString case for synthetic globals
2023-01-23 10:00:00 +00:00
Jeroen Ketema
3f9deb66ce Merge pull request #11936 from jketema/pretty-path
C++: In use-use dataflow use the AST representation of IR Instructions and Operands as their strings
2023-01-23 10:30:17 +01:00
Erik Krogh Kristensen
1ee9957838 Merge pull request #9807 from erik-krogh/endFilter
JS: recognize "-->" as a bad tag filter
2023-01-23 10:06:50 +01:00
Arthur Baars
99148244a4 Merge pull request #11856 from aibaars/update-grammars
Update grammars
2023-01-23 09:46:50 +01:00
erik-krogh
dc1bfa3a04 add Fastify and restify to the list of supported frameworks 2023-01-23 09:36:49 +01:00
Michael Nebel
69a42d8b1f Merge pull request #11931 from michaelnebel/csharp/refactor
Remove the Csv postfix of some predicate names.
2023-01-23 09:09:48 +01:00
Michael Nebel
440fe80c14 C#: Update stats. 2023-01-23 09:06:34 +01:00
Harry Maclean
21ce9b448a Ruby: Attempt to fix performance of AppCandidate
`DataFlow::MethodNode.getAReturningNode` is expensive to compute.
Instead we look for rack responses which flow to the `SynthReturnNode`.
Each method has only one of these (vs many "returning" nodes) so it is
a lot faster.
I'm not sure yet whether the results are the same.
2023-01-23 15:25:52 +13:00
Chris Smowton
a2e7b83411 Add additional note to Android tests 2023-01-21 11:57:54 +00:00
Chris Smowton
81e59e9005 Force Gradle tests to run sequentially
Otherwise starting multiple Gradle daemons in parallel can fail
2023-01-21 11:57:53 +00:00
Chris Smowton
4197d7bd20 Android tests: use Java 11 under Actions
Some runners still default to Java 8 (e.g. windows-2022 and macos-12), so we need to manually pull Java 11 in in such cases.
2023-01-21 11:57:53 +00:00
Chris Smowton
b6df415fe8 Add Android and Kotlin build script tests
This adds a single plain Gradle project that uses a modern Kotlin build script (i.e. settings.gradle.kts and no build.gradle.kts), plus basic Android samples exercising the possible permutations of: (old vs. new-style build script, Groovy vs. Kotlin build script, wrapper present vs. absent)

Old vs. new style tests our recognition of different cues that this is likely a Droid project and requires `gradle assemble` not `gradle testClasses` (the example given at https://developer.android.com/studio/build/#top-level changed style as of plugin version ~7.3.0).

Groovy vs. Kotlin build script language checks that the regexes recognising Android dependencies and versions work for both build script kinds.

Wrapper present vs. absent exercises the autobuilder logic that guesses an appropriate Gradle version and sets it up in the event the Gradle wrapper isn't provided.
2023-01-21 11:57:53 +00:00
Mathias Vorreiter Pedersen
da6bbbbc5e C++: Accept test changes. 2023-01-21 01:43:23 +00:00
Mathias Vorreiter Pedersen
ae998583be C++: Refactor parameter out nodes to not depend on 'ReturnIndirectionInstruction's. 2023-01-21 01:43:23 +00:00
Mathias Vorreiter Pedersen
e664662df9 Merge pull request #11944 from github/post-release-prep/codeql-cli-2.12.1
Post-release preparation for codeql-cli-2.12.1
2023-01-20 21:52:55 +00:00
github-actions[bot]
b62cb6ba84 Post-release preparation for codeql-cli-2.12.1 2023-01-20 19:49:56 +00:00
Arthur Baars
2b9bc3c7e3 Ruby: write errors to json log 2023-01-20 20:11:55 +01:00
Sarita Iyer
f5406570f7 Merge pull request #11817 from github/saritai/docs-contributing-info
Add CONTRIBUTING.MD file for contributing to docs
2023-01-20 12:41:20 -05:00
Rasmus Wriedt Larsen
25a68c4d71 Python: Include @yoff's suggestion on synthetic *args handling 2023-01-20 16:49:33 +01:00
Rasmus Wriedt Larsen
41ebb4fb55 Python: Add p2 in QLDoc example code for synthetic **kwargs 2023-01-20 16:40:39 +01:00
Rasmus Wriedt Larsen
d9fbe58ad5 Python: Expand starargs_only test 2023-01-20 16:34:59 +01:00
Geoffrey White
f05be77a0b Swift: Recognize more array sources. 2023-01-20 15:25:00 +00:00
Geoffrey White
7648e8f6a3 Swift: Recognize more sources. 2023-01-20 15:08:12 +00:00
Jean Helie
9e6f9c2705 Merge pull request #11709 from github/jhelie/add-shell-command-injection
ATM: add boosted version for `ShellCommandInjectionFromEnvironment` query
2023-01-20 16:03:30 +01:00
Geoffrey White
581c478872 Swift: Model RNCryptor. 2023-01-20 14:50:23 +00:00
Geoffrey White
bb59d055ff Swift: Add tests for RNCryptor library. 2023-01-20 14:50:21 +00:00
Mathias Vorreiter Pedersen
3059ce3070 Merge pull request #11938 from github/release-prep/2.12.1
Release preparation for version 2.12.1
2023-01-20 14:30:42 +00:00
Rasmus Wriedt Larsen
0df3dd68d6 Python: Remove (now) redundant cast 2023-01-20 15:13:02 +01:00
Rasmus Wriedt Larsen
1bd969c219 Merge branch 'main' into call-graph-code 2023-01-20 15:11:49 +01:00
Alex Ford
8ae993185c Ruby: fix missing docs 2023-01-20 13:40:19 +00:00
Alex Ford
c986ea1070 Ruby: scope local_assigns synthetic globals to both render call and template file 2023-01-20 13:40:19 +00:00
Alex Ford
14c896215c Ruby: factor out some RenderCall methods into a helper module 2023-01-20 13:40:19 +00:00
Alex Ford
03070c9fd0 Ruby: restrict AccessLocalsKeySummary to method calls against self 2023-01-20 13:40:19 +00:00
Alex Ford
f6516db105 Ruby: correct preservesValue in AccessLocalsKeySummary 2023-01-20 13:40:19 +00:00
Alex Ford
ab72301a4c Ruby: add a change note for rails render locals dataflow 2023-01-20 13:40:19 +00:00
Alex Ford
8fec4b804f Ruby: StoredXSS test whitespace change 2023-01-20 13:40:19 +00:00
Alex Ford
fd8dd5e103 Ruby: update StoredXSS test output 2023-01-20 13:40:19 +00:00
Alex Ford
8845157d08 Ruby: slightly limit AccessLocalsKeySummary summarized callables 2023-01-20 13:40:19 +00:00
Alex Ford
b5cc1087fe Ruby: add LocalAssignsHashSyntheticGlobal#getARenderCall predicate 2023-01-20 13:40:19 +00:00
Alex Ford
022171923c Ruby: fix some ql for ql alerts 2023-01-20 13:40:19 +00:00
Alex Ford
bea110b598 Ruby: remove blank line in test file 2023-01-20 13:40:19 +00:00
Alex Ford
b78ae1608e Ruby: remove a fixed TODO 2023-01-20 13:40:19 +00:00
Alex Ford
e5fbc92856 Ruby: generalize rails flow step for accessing render locals hash in view 2023-01-20 13:40:19 +00:00
Alex Ford
e4df1f5a6f Ruby: add missing toString case for synthetic globals 2023-01-20 13:31:43 +00:00
Jeroen Ketema
cddaa0c8fa Apply suggestions from code review 2023-01-20 14:10:27 +01:00
Michael Nebel
4d321d6833 C#: Add upgrade and downgrade scripts. 2023-01-20 13:39:41 +01:00
Michael Nebel
6c7c0854d1 C#: Add change note. 2023-01-20 13:39:41 +01:00
Michael Nebel
5a1e96d671 C#: Update string literal test query and expected output. 2023-01-20 13:39:41 +01:00
Michael Nebel
5c5d330704 C#: Add UTF-8 encoded string test case. 2023-01-20 13:39:41 +01:00
Michael Nebel
20398f1299 C#: Add PrintAst testcase for C# 11 test code. 2023-01-20 13:39:41 +01:00
Michael Nebel
c52dbcbb52 C#: Update all PrintAst test expected output. 2023-01-20 13:39:41 +01:00
Michael Nebel
c87668a91d C#: Library support for string UTF8/UTF16 encodings. 2023-01-20 13:39:41 +01:00
Michael Nebel
e8eedb7b4d C#: Extractor support for UTF-8 encoded strings. 2023-01-20 13:39:41 +01:00
Michael Nebel
72fa3bd905 C#: Add test cases for raw string literals. 2023-01-20 13:39:41 +01:00
Michael Nebel
3b93cd45ea C#: Extract the ValueText instead of Text for interpolated string literals as this contains the value after eg. indentation processing. 2023-01-20 13:39:41 +01:00
Michael Nebel
ad20e81d05 C#: Add test for interpolated strings, where newlines are used in the provided expression. 2023-01-20 13:39:41 +01:00
Philip Ginsbach
3998c9a89a document the existence of a global QlBuiltins module 2023-01-20 12:16:24 +00:00
Philip Ginsbach
127b1ac114 update handbook and reference with signature namespaces 2023-01-20 12:16:22 +00:00
github-actions[bot]
005b3e4a47 Release preparation for version 2.12.1 2023-01-20 12:03:19 +00:00
Geoffrey White
976b0401be Merge pull request #11876 from geoffw0/coredata
Swift: Improve Core Data sinks for swift/cleartext-storage-database
2023-01-20 11:02:03 +00:00
Jeroen Ketema
f628152be1 C++: In dataflow use the AST representation of IR Instructions and Operands 2023-01-20 10:39:50 +01:00
Harry Maclean
16baea22c0 Ruby: doc fix
Co-authored-by: Alex Ford <alexrford@users.noreply.github.com>
2023-01-20 22:06:29 +13:00
Paolo Tranquilli
1c086aae7c Swift: add internal imports to ParentChild.qll 2023-01-20 09:59:36 +01:00
Ian Lynagh
05c80b3f3c Merge pull request #11894 from igfoo/igfoo/make-private
Kotlin: Make a couple of functions private
2023-01-19 20:59:32 +00:00
Sarita Iyer
3a8479614b fix link 2023-01-19 15:13:34 -05:00
Paolo Tranquilli
e840b8f707 Swift: add and fix some schema.py documentation 2023-01-19 18:07:47 +01:00
Ian Lynagh
c2d5281e73 Merge pull request #11930 from igfoo/igfoo/fetch-codeql
CI: fetch-codeql: Set $CODEQL_FETCHED_CODEQL_PATH in the enivironment
2023-01-19 15:33:08 +00:00
Sarita Iyer
a83a98226c Update README.rst 2023-01-19 09:45:43 -05:00
Sarita Iyer
27a5051282 Update README.md 2023-01-19 09:45:01 -05:00
Sarita Iyer
894a494186 Apply suggestions from code review
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-01-19 09:39:55 -05:00
Paolo Tranquilli
c2c14cdddb Merge pull request #11929 from github/redsun82/swift-expand-ref-in-auto-docs
Swift: expand `ref` in autogenerated docs
2023-01-19 15:24:05 +01:00
Michael B. Gale
14cc27e49b Merge pull request #11910 from owen-mc/go/log-injection-sanitizer-newreplacer-replace
Add missing string replacement sanitizers to log-injection and string-break
2023-01-19 14:23:03 +00:00
Michael Nebel
dc223cb82e Sync files and make corresponding changes for other languages. 2023-01-19 15:14:06 +01:00
Chris Smowton
9a5e1f5e28 Make import private 2023-01-19 14:10:17 +00:00
Michael Nebel
9cd1dc70e5 C#: Remove the Csv postfix of some predicates. 2023-01-19 15:02:52 +01:00
Owen Mansel-Chan
13d1c88a11 Make new data flow copy for StringOps.StringsNewReplacer 2023-01-19 13:05:31 +00:00
Arthur Baars
d5e60dfb22 Ruby: pass diagnostics::LogWriter to extractor 2023-01-19 13:53:56 +01:00
Geoffrey White
62125fa767 Swift: Explanatory comments. 2023-01-19 11:55:16 +00:00
Ian Lynagh
3a5bec5778 CI: fetch-codeql: Set $CODEQL_FETCHED_CODEQL_PATH in the enivironment 2023-01-19 11:37:05 +00:00
Geoffrey White
2875d8645c Swift: Cover additional edge case. 2023-01-19 11:34:07 +00:00
Geoffrey White
4c47de58c1 Swift: Add a few more test cases. 2023-01-19 11:27:44 +00:00
Geoffrey White
5f8875ff89 Swift: give variables more helpful names. 2023-01-19 10:31:23 +00:00
Geoffrey White
b033114f64 Swift: sources in extension protocols. 2023-01-19 10:04:04 +00:00
Paolo Tranquilli
57ec5db1a9 Merge branch 'main' into redsun82/swift-linkage-awareness 2023-01-19 10:49:33 +01:00
Paolo Tranquilli
490bd051cd Swift: expand ref in autogenerated docs 2023-01-19 09:27:44 +00:00
Michael Nebel
e6aebd9df0 Merge pull request #11814 from michaelnebel/csharp/genericattributes
C# 11: Generic attributes
2023-01-19 07:35:17 +01:00
Erik Krogh Kristensen
ee9b01b5e6 Apply suggestions from code review
Co-authored-by: Alex Ford <alexrford@users.noreply.github.com>
2023-01-18 22:14:46 +01:00
Mark Vogelgesang
a3ff0725a3 Removed change-note as it was not necessary 2023-01-18 16:08:29 -05:00
Mark Vogelgesang
e50a81cbb7 Merge branch 'main' into express-rate-limit 2023-01-18 14:44:29 -05:00
Mark Vogelgesang
c9119848d9 Updated express-rate-limit example to match implementation examples found on packages README 2023-01-18 14:42:40 -05:00
Mathias Vorreiter Pedersen
14468b64fb Merge pull request #11924 from atorralba/atorralba/optbinding-getters
Swift: Support more CFG node types in optional binding flow
2023-01-18 16:37:11 +00:00
Owen Mansel-Chan
3fda9f6e65 Add change note 2023-01-18 15:42:42 +00:00
Arthur Baars
e85e61b6d7 Ruby: add diagnostics module 2023-01-18 16:28:16 +01:00
Owen Mansel-Chan
30f0dd8c03 Add string replacement sanitizer to log injection 2023-01-18 15:24:39 +00:00
Owen Mansel-Chan
015ef4c3ef Add use of strings.Replacer to replace sanitizer 2023-01-18 15:20:14 +00:00
Owen Mansel-Chan
2b1a7898d9 Move ReplaceAll sanitizer to shared code 2023-01-18 15:12:52 +00:00
AlexDenisov
5173f10e68 Merge pull request #11925 from github/alexdenisov/swift-drop-dead-code
Swift: drop dead code
2023-01-18 16:10:25 +01:00
Alex Denisov
35620c4c86 Swift: drop dead code 2023-01-18 15:35:40 +01:00
Mathias Vorreiter Pedersen
e26e83b8df Merge pull request #11728 from github/rdmarsh2/parameterize-range-analysis
C++: Parameterize the semantic range analysis
2023-01-18 14:22:35 +00:00
Geoffrey White
5d6f2436e4 Merge branch 'main' into coredata 2023-01-18 13:39:02 +00:00
Tony Torralba
90517e254a Accept test expectation changes 2023-01-18 13:25:04 +01:00
Mathias Vorreiter Pedersen
48439bc252 Merge pull request #11905 from geoffw0/rncrypt
Swift: Add RNCryptor sinks to swift/constant-password
2023-01-18 11:43:23 +00:00
Tony Torralba
d75a5212b2 Support more CFG node types in optional binding flow 2023-01-18 12:42:44 +01:00
Tony Torralba
4a89a30abd Add failing test 2023-01-18 12:41:59 +01:00
Rasmus Wriedt Larsen
4df946b161 Python: call-graph: Don't design for special method calls yet
The `call` arguments were not `CallNode`s before, to allow for easier
support of special method calls, such as `a + b` going to `__add__`.

However, this is not implemented yet, so for now we can keep things
simple.

Co-authored-by: Taus <tausbn@github.com>
2023-01-18 12:30:53 +01:00
Mathias Vorreiter Pedersen
c8bcfb77b2 Merge pull request #11836 from geoffw0/optbinding
Swift: Data flow through optional binding
2023-01-18 11:25:27 +00:00
Geoffrey White
71c1ca53a9 Merge branch 'main' into rncrypt 2023-01-18 11:09:09 +00:00
erik-krogh
e4d4873d0d remove the dataflow copy for regexp tracking now that type-tracking is used 2023-01-18 11:04:51 +01:00
Michael Nebel
4c94adb5ec C#: Add change note. 2023-01-18 10:50:04 +01:00
Michael Nebel
3846349ba0 C#: Add testcase for CIL generic attribute extraction. 2023-01-18 10:49:44 +01:00
Michael Nebel
821d294be8 C#: Add library support for CIL generic attributes. 2023-01-18 10:49:44 +01:00
Michael Nebel
5ff89a2ccf C#: Update expected test output for printing of constructed generic CIL types. 2023-01-18 10:49:44 +01:00
Michael Nebel
8b231c51f9 C#: Improve printing of constructed generic CIL types. 2023-01-18 10:49:44 +01:00
Michael Nebel
b680795d15 C#: The generic attribute type is a constructed class. 2023-01-18 10:49:44 +01:00
Michael Nebel
62e7c22783 C#: Add generic attribute test and expected results. 2023-01-18 10:48:30 +01:00
Michael Nebel
211af1943c C#: Library support for generic attributes. 2023-01-18 10:48:30 +01:00
Michael Nebel
3a4623b437 Merge pull request #11907 from michaelnebel/csharp/cil/attributes
C#: CIL attributes
2023-01-18 10:46:34 +01:00
Rasmus Wriedt Larsen
e0ccb9306a Merge pull request #11908 from RasmusWL/dataflow-consistency-more-excludes
DataFlow: Add `uniqueParameterNodePositionExclude`
2023-01-18 10:44:51 +01:00
AlexDenisov
8910ba4f32 Merge pull request #11919 from github/redsun82/swift-obsolete-conf
Swift: remove obsolete configuration fields
2023-01-18 10:34:24 +01:00
erik-krogh
1477974bf1 the RegexExecution concept does not need to have getTerm() 2023-01-18 10:10:36 +01:00
erik-krogh
1a3c9c8305 improve performance of regular-expression type-tracking by adding an exploratory initial analysis 2023-01-18 10:10:36 +01:00
erik-krogh
b8f6feb68b delete old test 2023-01-18 10:10:36 +01:00
erik-krogh
45316b6381 rename RegExpConfiguration to RegExpTracking 2023-01-18 10:10:36 +01:00
erik-krogh
25e65e0d9f rewrite the regexp tracking DataFlow::Configuration to TypeTracking 2023-01-18 10:10:36 +01:00
erik-krogh
d0b627b018 move the implementation detail of how regular-expressions are tracked into RegExpConfiguration.qll" 2023-01-18 10:10:05 +01:00
Paolo Tranquilli
f383fd1dc1 Swift: introduce module disambuigation via linkage awareness 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
d7feb001be Swift: prepare extractSwiftInvocation 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
a3b4c32f07 Swift: stamp all named declarations with an id-ref to the containing module 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
f7a046ccd2 Swift: add trap linkage awareness infrastructure 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
5fdb09380c Swift: move TargetTrapDomain to TargetDomains in infra 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
7f389b9f9a Swift: introduce TrapType 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
353536b826 Swift: collect original output module paths 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
84b285a4c6 Swift: collect source files 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
33c4a8233c Swift: collect encountered modules 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
c7f13f1036 Swift: collect TRAP files related to an extractor run
In order to do this a mutable `SwiftExtractorState` is introduced.
2023-01-18 10:07:46 +01:00
Paolo Tranquilli
c31c515205 Swift: move TargetFile as managed inside TrapDomain 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
20eaa34485 Swift: failing tests for linkage awareness 2023-01-18 10:07:46 +01:00
Tony Torralba
c8e894b854 Merge pull request #11917 from github/workflow/coverage/update
Update CSV framework coverage reports
2023-01-18 10:02:22 +01:00
erik-krogh
f516ccb4e2 limit the fieldFlowBranchLimit for the regexp tracker to improve performance 2023-01-18 09:31:04 +01:00
erik-krogh
2fceee4e35 track regular expressions that gets compiled with Regexp.compile 2023-01-18 09:31:04 +01:00
erik-krogh
acf28ebd98 add a RegexExecution, and use it to track regular expressions to their uses in a nice way in rb/polynomial-redos 2023-01-18 09:31:04 +01:00
erik-krogh
6e33dd5df6 add failing test 2023-01-18 09:31:04 +01:00
Erik Krogh Kristensen
1a64393c4c Merge pull request #11893 from erik-krogh/csharpIndexFiles
C#: add --working-dir=. to pre-finalize
2023-01-18 09:05:29 +01:00
Paolo Tranquilli
2c4c2dfeb3 Swift: remove obsolete configuration fields 2023-01-18 08:55:59 +01:00
Michael Nebel
8e3e6505ad C#: Add change note. 2023-01-18 07:56:24 +01:00
github-actions[bot]
571942fb21 Add changed framework coverage reports 2023-01-18 00:17:19 +00:00
Jeroen Ketema
6cd52237c3 Merge pull request #11913 from jketema/test-fixes
C++: Some minor test fixes
2023-01-17 21:52:57 +01:00
erik-krogh
4b74dec18f expand what is parsed as the stem of a pathexpr 2023-01-17 21:28:21 +01:00
yoff
5a82012d03 Merge pull request #11854 from yoff/python/fix-tarslip-improv-bug
Python: fix bug  in `py/tarslip-extended`
2023-01-17 20:44:06 +01:00
Geoffrey White
a568d0af7f Swift: Remove unused variable. 2023-01-17 18:10:02 +00:00
Geoffrey White
b3d30bfc4f Swift: Add NumberLiteral sources as well. 2023-01-17 18:04:26 +00:00
Jeroen Ketema
ee19c3d80f C++: Rename identically named classes in syntax-zoo
Conceptually the test that comprises the whole of `syntax-zoo` forms one
single binary. To this binary ODR applies. There were two class definitions
`Foo` in `syntax-zoo`, violating ODR. Rename those classes to have different
names.
2023-01-17 19:02:40 +01:00
Jeroen Ketema
06767c6760 C++: Split bad_asts.cpp IR test into two files
The statements from `errorExpr` - which does not parse correctly - affected the
tuples that were being generated for the other code in `bad_asts.cpp` due to
the way the front-end handles parse errors. This did not affect the test
results, but was also not the intention of the test. Split off `errorExpr` into
a separate file.
2023-01-17 18:57:29 +01:00
Geoffrey White
d1cfdb97ee Swift: Model RNCryptor. 2023-01-17 17:55:52 +00:00
Sarita Iyer
c8298356dc Rename CONTRIBUTING.MD to CONTRIBUTING.md 2023-01-17 12:32:36 -05:00
Geoffrey White
a92e1c7ea0 Swift: Add tests for RNCryptor library. 2023-01-17 17:31:49 +00:00
Mathias Vorreiter Pedersen
39d44adbc5 Merge pull request #11896 from jketema/spurious-default-taint
C++: Fix spurious results in default taint tracking
2023-01-17 17:10:15 +00:00
Geoffrey White
5e5c4e9a8c Swift: Accept QL-for-QL recommendation. 2023-01-17 16:25:34 +00:00
Geoffrey White
9911dd53e1 Merge branch 'main' into coredata 2023-01-17 16:22:53 +00:00
Geoffrey White
ea06ad1933 Merge pull request #11529 from geoffw0/format
Swift: Uncontrolled format string query
2023-01-17 16:16:10 +00:00
Geoffrey White
3c55cdd5be Swift: Catch the last two test results as well. 2023-01-17 16:04:58 +00:00
Geoffrey White
d42848bb7e Swift: Upgrade the query from dataflow to taint tracking, so as to support more flows. 2023-01-17 16:04:58 +00:00
Geoffrey White
28a707a956 Swift: Model RNCryptor. 2023-01-17 16:04:58 +00:00
Geoffrey White
a8ef9cc987 Swift: Add tests for RNCryptor library. 2023-01-17 16:04:57 +00:00
Edward Minnix III
4c018759c8 Merge pull request #11283 from egregius313/egregius313/webview-setAllowContentAccess
Java: Android WebView Content Access Query
2023-01-17 11:02:47 -05:00
Michael Nebel
62533501fe C#: Update CIL attributes test case and the expected output. 2023-01-17 17:00:01 +01:00
Geoffrey White
54b3262d9c Merge pull request #11891 from geoffw0/authbypass
C++: Fix issue with cpp/user-controlled-bypass
2023-01-17 15:43:08 +00:00
Jami
babdee36aa Merge pull request #11779 from jcogs33/jcogs33/model-more-top-jdk-apis
Java: model top JDK APIs
2023-01-17 10:20:32 -05:00
Geoffrey White
d628cc5ab8 Update cpp/ql/src/Security/CWE/CWE-290/AuthenticationBypass.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-01-17 14:37:19 +00:00
erik-krogh
8251ad5e99 add unsafe-html-construction query 2023-01-17 15:35:17 +01:00
erik-krogh
8715790fe7 add explicit this 2023-01-17 15:17:48 +01:00
Geoffrey White
037b49b454 Update swift/ql/test/query-tests/Security/CWE-259/rncryptor.swift
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2023-01-17 14:16:52 +00:00
Paolo Tranquilli
6b43ff45a4 Merge pull request #11904 from github/redsun82/swift-extension-protocols
Swift: extract `ExtensionDecl` protocols
2023-01-17 15:16:20 +01:00
Paolo Tranquilli
d9bd41b8b1 Merge pull request #11571 from github/redsun82/swift-open-redirection
Swift: generalize open redirection on both platforms and rework output rewriting
2023-01-17 15:15:56 +01:00
Jami Cogswell
10f0975812 Java: remove models for System.[get|set]Property 2023-01-17 08:51:48 -05:00
erik-krogh
a562568522 add string concat as a sink for command-construction 2023-01-17 14:48:09 +01:00
erik-krogh
9d9de18bc9 add a generalized AddExprRoot into Operation.qll 2023-01-17 14:48:08 +01:00
erik-krogh
8fc3b268e8 add string concat as a sink for code-construction 2023-01-17 14:48:06 +01:00
Paolo Tranquilli
9e5db7c6ec Merge branch 'main' into redsun82/swift-extension-protocols 2023-01-17 14:39:09 +01:00
Rasmus Wriedt Larsen
b83fc3b6eb Python: Update QLDoc for clsArgumentTracker 2023-01-17 14:38:56 +01:00
Michael Nebel
5f57a097ab C#: CIL method attribute extraction. 2023-01-17 14:17:35 +01:00
Rasmus Wriedt Larsen
24892801ec Python: clsTracker => clsArgumentTracker
Co-authored-by: Taus <tausbn@github.com>
2023-01-17 14:16:56 +01:00
Rasmus Wriedt Larsen
1c8cc6a32a Python: Add QLDoc for TFunction 2023-01-17 14:14:05 +01:00
Michael Nebel
951f6362aa Merge pull request #11825 from michaelnebel/csharp/genericmathsupport
C# 11: Support for static virtual and static abstract interface members.
2023-01-17 14:14:02 +01:00
Rasmus Wriedt Larsen
a0b1c2ea79 DataFlow: Add uniqueParameterNodePositionExclude 2023-01-17 14:05:22 +01:00
Rasmus Wriedt Larsen
2b0a5fd5d1 DataFlow: Add uniqueParameterNodeAtPositionExclude 2023-01-17 14:05:17 +01:00
Rasmus Wriedt Larsen
dad6221b61 Python: Accept dataflow-consistency.expected changes for now
As highlighted in the configuration file, there are some things to catch
up on, and we also need to apply the same fix as Ruby for **kwargs
handling.
2023-01-17 13:58:40 +01:00
Rasmus Wriedt Larsen
749e81367d Python: Allow multiple **kwargs parameters outside our test code 2023-01-17 13:58:40 +01:00
Rasmus Wriedt Larsen
b6272b383d Python: Allow non-unique parameter positions for normal parameters 2023-01-17 13:58:40 +01:00
Rasmus Wriedt Larsen
a6fd5b6e59 DataFlow: Add uniqueParameterNodePositionExclude 2023-01-17 13:58:37 +01:00
Rasmus Wriedt Larsen
7a423622f8 DataFlow: Add uniqueParameterNodeAtPositionExclude 2023-01-17 13:57:31 +01:00
Rasmus Wriedt Larsen
e3fcfd0a66 Python: Use configuration for dataflow consistency checks in dataflow/exceptions 2023-01-17 13:55:22 +01:00
Erik Krogh Kristensen
2e4f4c64fe Merge pull request #11903 from erik-krogh/revertClap
QL: Revert "update clap to 3.0 in QL-for-QL"
2023-01-17 13:29:04 +01:00
Paolo Tranquilli
0a792f2f61 Swift: add upgrade and downgrade scripts for ExtensionDecl new protocols property 2023-01-17 13:07:02 +01:00
Paolo Tranquilli
0d32f00020 Swift: update ExtensionDecl test results 2023-01-17 12:58:02 +01:00
Paolo Tranquilli
d6e0ef9ff9 Swift: extract ExtensionDecl protocols 2023-01-17 12:56:09 +01:00
Paolo Tranquilli
f6e26211f9 Swift: add protocols to ExtensionDecl schema 2023-01-17 12:54:50 +01:00
Geoffrey White
74a37475db Swift: Model RNCryptor. 2023-01-17 11:54:12 +00:00
Mathias Vorreiter Pedersen
44ebc77ada Update cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/RangeAnalysisSpecific.qll 2023-01-17 11:52:43 +00:00
Paolo Tranquilli
8906e101cb Swift: add ExtensionDecl QL test 2023-01-17 12:49:53 +01:00
erik-krogh
5a4fe71529 Revert "update clap to 3.0 in QL-for-QL"
This reverts commit d072ed969e.
2023-01-17 12:38:30 +01:00
Erik Krogh Kristensen
50b9f5bba0 Merge pull request #11892 from erik-krogh/clap
QL: update clap to 3.0 in QL-for-QL
2023-01-17 12:33:18 +01:00
Jean Helie
fec7ea6964 ATM: add missing query help files 2023-01-17 12:20:17 +01:00
Jean Helie
b08fa43fdf update tests 2023-01-17 12:20:17 +01:00
Jean Helie
f07984bab2 update test data 2023-01-17 12:20:17 +01:00
Jean Helie
13aaa22df5 add bosted version of ShellCommandInjectionFromEnvironment 2023-01-17 12:20:17 +01:00
Mathias Vorreiter Pedersen
77a9cea737 Merge pull request #11901 from github/redsun82/swift-ql-internal
Swift: introduce `@ql.internal` pragma for classes
2023-01-17 10:46:56 +00:00
Rasmus Wriedt Larsen
f8d7a367ad Python: Rewrite test for __add__ special method
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-17 11:45:57 +01:00
Paolo Tranquilli
67bd8cba32 Merge pull request #11900 from github/alexdenisov/swift-ignore-lsregister
Swift: do not trace lsregister
2023-01-17 11:26:22 +01:00
Rasmus Wriedt Larsen
ae1d4decc3 Python: ExternalAPIs.qll: Swap order of classes
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-17 11:01:47 +01:00
Rasmus Wriedt Larsen
b6f76d784c Python: Remove accidentally committed files 2023-01-17 10:59:11 +01:00
Rasmus Wriedt Larsen
479f019eb0 Python: Minor rewrite removing unnecessary exists
Co-authored-by: Taus <tausbn@github.com>
2023-01-17 10:59:11 +01:00
Rasmus Wriedt Larsen
608b16c98a Python: Minor adjustment in QLDoc
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-17 10:56:53 +01:00
Chris Smowton
29425982a5 Merge pull request #11899 from ataillefer/patch-1
Fix partial path traversal Java example
2023-01-17 09:39:36 +00:00
Rasmus Wriedt Larsen
700e40b11b Python: Fix ql4ql 2023-01-17 10:35:20 +01:00
Rasmus Wriedt Larsen
4f3876f184 Python: Accept rewrite for _join( predicates
Co-authored-by: yoff <lerchedahl@gmail.com>
2023-01-17 10:32:31 +01:00
Rasmus Wriedt Larsen
7c242b1409 Python: Minor QLDoc fix
Co-authored-by: Taus <tausbn@github.com>
2023-01-17 10:32:15 +01:00
Paolo Tranquilli
6106edd5e2 Swift: add INTERNAL doc marker to ql.internal classes 2023-01-17 10:30:59 +01:00
Paolo Tranquilli
b22da25e05 Swift: remove ql.internal classes from global import 2023-01-17 10:18:03 +01:00
Paolo Tranquilli
48825442c3 Swift: add ql.internal pragma in schema definitions 2023-01-17 10:10:35 +01:00
Paolo Tranquilli
cdc99b5240 Swift: simplify pragma definition 2023-01-17 10:10:02 +01:00
Geoffrey White
449ebb8a12 Swift: Add tests for RNCryptor library. 2023-01-17 09:03:07 +00:00
Paolo Tranquilli
e3502e2e5f Merge branch 'main' into redsun82/swift-open-redirection 2023-01-17 09:43:00 +01:00
Alex Denisov
63b4e5ef5c Swift: do not trace lsregister 2023-01-17 09:26:31 +01:00
Erik Krogh Kristensen
51bd1ef1e1 Merge pull request #11884 from erik-krogh/qlWin
QL/Ryby: fix qltest on Windows
2023-01-16 21:57:01 +01:00
Antoine Taillefer
660e6d7085 Fix partial path traversal Java example
The Java recommendation example for the "Partial path traversal vulnerability from remote" query doesn't seem right to me. Indeed, the following statement doesn't compile, since `dir.getCanonicalPath()` returns a String:
```
dir.getCanonicalPath().toPath()
```
Maybe the author wanted to state `dir.getCanonicalFile().toPath()`, which would compile, but is useless compared to `dir.getCanonicalPath()`.

Moreover, `parent.getCanonicalFile().toPath()` or `parent.getCanonicalPath()` will **not** be slash-terminated, contrary to what the description says.
From what I can see (and test), the correct fix is to concatenate `File.separator` to the parent canonical path.
2023-01-16 21:14:29 +01:00
Rasmus Wriedt Larsen
690a09d9b6 Python: new-call-graph: pragma[noinline] => pragma[nomagic]
As suggested by @tausbn. Obviously, this needs to be performance tested.
2023-01-16 20:45:44 +01:00
Rasmus Wriedt Larsen
a3b7273844 Python: Fix duplicated meta query id 2023-01-16 20:33:28 +01:00
Rasmus Wriedt Larsen
3fcb8f3f4b Python: Accept suggestions from code-review 2023-01-16 20:33:28 +01:00
Jeroen Ketema
a892ae8764 C++: Fix spurious results in default taint tracking 2023-01-16 19:10:10 +01:00
erik-krogh
dcc1c3d487 add --working-dir=. to pre-finalize for c# 2023-01-16 18:09:00 +01:00
Ian Lynagh
17de5c120a Kotlin: Make a couple of functions private 2023-01-16 15:29:14 +00:00
Tony Torralba
bd5619147d Merge pull request #11590 from atorralba/atorralba/swift/sensitive-info-logs
Swift: Add Cleartext Logging query
2023-01-16 16:22:20 +01:00
erik-krogh
713599963b add --working-dir to Ruby qltest.cmd to fix Windows 2023-01-16 15:37:35 +01:00
erik-krogh
9e153cfb0d change the Ruby-build test such that Windows fails 2023-01-16 15:37:35 +01:00
erik-krogh
587adea809 QL: add --working-dir to qltest.cmd to fix qltest 2023-01-16 15:37:14 +01:00
erik-krogh
2c1ecb507d fix windows 2023-01-16 15:36:57 +01:00
erik-krogh
1de65131fe add compilation cache to QL-for-QL tests 2023-01-16 15:36:57 +01:00
erik-krogh
0685732e3f delete ql/ specific format step now that we have an all-languages format check 2023-01-16 15:36:57 +01:00
erik-krogh
1d62751e15 test QL-for-QL on mac/win 2023-01-16 15:36:55 +01:00
Tony Torralba
0017461e2d Update swift/ql/src/queries/Security/CWE-312/CleartextLogging.ql
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-01-16 15:35:58 +01:00
Tony Torralba
cca6a13fbb Update java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.qhelp 2023-01-16 14:21:03 +01:00
Rasmus Wriedt Larsen
a1513cc1d3 Python: Minor QLDoc fix 2023-01-16 14:07:11 +01:00
Rasmus Wriedt Larsen
dfbb744a7a Python: Add comment on *args argument handling 2023-01-16 14:04:25 +01:00
Rasmus Wriedt Larsen
e5e5d84361 Python: Add change-note 2023-01-16 13:44:24 +01:00
Michael Nebel
8981d4c06b C#: Add change note. 2023-01-16 13:43:26 +01:00
Rasmus Wriedt Larsen
61151d4aa7 Merge branch 'main' into call-graph-code 2023-01-16 13:39:15 +01:00
Michael Nebel
2f602a629f C#: Add upgrade and downgrade scripts. 2023-01-16 13:27:37 +01:00
Erik Krogh Kristensen
8ccc384043 Merge pull request #11858 from erik-krogh/moreSpawn
JS: track shell:true more in js/shell-command-constructed-from-input
2023-01-16 13:24:50 +01:00
Erik Krogh Kristensen
59a8b21851 Merge pull request #10862 from erik-krogh/unsafeCodeConstruction
Rb: Add an `unsafe-code-construction` query
2023-01-16 13:22:58 +01:00
Michael Nebel
3552a41552 C#: Add test case for static abstract and static virtual interface members. 2023-01-16 13:07:50 +01:00
Michael Nebel
dc50b6bad3 C#: Support for operators in implements relations. 2023-01-16 13:07:50 +01:00
Michael Nebel
8c2931cbb8 C#: Operators are now allowed to be declared virtual. 2023-01-16 13:07:50 +01:00
erik-krogh
d072ed969e update clap to 3.0 in QL-for-QL 2023-01-16 12:34:56 +01:00
Paolo Tranquilli
874fe2b8f9 Swift: introduce an in-memory file hash cache
File hashing is now done internally in `SwiftFileInterception` (and
exported as a `getHashOfRealFile` function for future use in linkage
awareness), and using a per-process in-memory cache. The persistent
caching of paths is removed, so the solution is now robust against input
file changes during the build.

For the same reason, the hash to artifact mapping have the symlinks
reversed now. The artifacts themselves are stored using the hash as
filenames, and the original paths of the artifacts are reacreated in the
scratch dir with symlinks mostly for debugging purposes (to understand
what artifact each hash corresponds to, and to follow what was built by
the extractor).
2023-01-16 12:05:36 +01:00
Tony Torralba
fdb3b65bce Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2023-01-16 11:57:37 +01:00
Tony Torralba
7f880a24df Merge pull request #11886 from jelaiw/jelaiw-patch-1
Fix small typo in good/bad code sample.
2023-01-16 09:43:23 +01:00
Paolo Tranquilli
738412260f Merge branch 'main' into redsun82/swift-open-redirection 2023-01-16 09:09:10 +01:00
jelaiw
cf7189bb28 Fix small typo in good/bad code sample. 2023-01-13 19:16:11 -06:00
Geoffrey White
1a416884d4 C++: Do something similar with the other three cases. 2023-01-14 00:09:01 +00:00
Geoffrey White
316117f5c9 C++: Reduce number of regexps. 2023-01-13 18:50:41 +00:00
Geoffrey White
2f09f0e2c1 C++: Turn the huge list into a predicate. 2023-01-13 18:47:18 +00:00
Geoffrey White
13ae15b867 C++: Add tests for more edge cases. 2023-01-13 18:38:29 +00:00
Jami Cogswell
fb6725ddaa Java: add WithoutElement comment for clear methods 2023-01-13 13:20:45 -05:00
Mathias Vorreiter Pedersen
2dbacbc302 Merge pull request #11841 from MathiasVP/swift-add-integral-types
Swift: Add integral type classes
2023-01-13 17:30:57 +00:00
Robert Marsh
601b43ac0a Merge branch 'main' into rdmarsh2/parameterize-range-analysis
Conflicting change to boundedPhiInp copied to RangeAnalysisStage.qll
2023-01-13 12:06:21 -05:00
Geoffrey White
c9a0067705 Swift: Remove flow in cases with multiple variables. 2023-01-13 16:37:23 +00:00
Mathias Vorreiter Pedersen
c5038ed281 Merge pull request #11883 from MathiasVP/fold-definitions
C++: Fix bad join in `definitionOf`
2023-01-13 16:28:26 +00:00
Mathias Vorreiter Pedersen
6e6f2115c0 Merge pull request #11857 from MathiasVP/speedup-missing-check-scanf
C++: Speedup `cpp/missing-check-scanf`
2023-01-13 16:11:16 +00:00
Geoffrey White
2c35af51cd Swift: Move logic into Ssa::WriteDefinition.assigns. 2023-01-13 15:19:33 +00:00
Geoffrey White
8a77906296 Swift: Use Ssa::Definition rather than ConcreteVarDecl. 2023-01-13 15:01:20 +00:00
Mathias Vorreiter Pedersen
2aace0df2c Merge pull request #11743 from MathiasVP/fix-pointer-to-const-nodes
C++: `PostUpdateNode`s for const-pointer arguments
2023-01-13 14:03:21 +00:00
Mathias Vorreiter Pedersen
cdd9567062 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternalsCommon.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2023-01-13 13:54:07 +00:00
Michael Nebel
2d46272295 Merge pull request #11881 from michaelnebel/java/modeldiffignore
Java: Ignore missing html artifacts in the Model Diff workflow.
2023-01-13 14:11:19 +01:00
Michael Nebel
b36be009d4 Merge pull request #11834 from michaelnebel/csharp/operators
C# 11: Extractor and library support for Unsigned right shift.
2023-01-13 13:21:02 +01:00
erik-krogh
71af8ab022 simplifications inspired by review 2023-01-13 13:18:52 +01:00
Mathias Vorreiter Pedersen
2283eacc0b C++: Fix bad join in 'definitionOf'. 2023-01-13 11:42:15 +00:00
Mathias Vorreiter Pedersen
59072f9e81 C++: Improve QLDoc. 2023-01-13 11:01:23 +00:00
Mathias Vorreiter Pedersen
dd8bead21a C++: Fix spurious backticks. 2023-01-13 10:57:44 +00:00
Mathias Vorreiter Pedersen
cf9998b932 Merge pull request #5 from geoffw0/integraltypes
Swift: Work on integral type classes
2023-01-13 10:01:23 +00:00
Arthur Baars
5865b51a94 Ruby: build extractor using cross 2023-01-13 10:25:27 +01:00
Arthur Baars
dc6f5f60d1 Ruby: update stats 2023-01-13 10:22:42 +01:00
Arthur Baars
28c9b52dce Ruby: add change note 2023-01-13 10:22:42 +01:00
Arthur Baars
46063c7d04 Ruby: update expected output 2023-01-13 10:22:41 +01:00
Arthur Baars
c4ec674057 Ruby: support anonymous (hash)splat parameters/arguments 2023-01-13 10:22:41 +01:00
Arthur Baars
4d3e2bb814 Ruby: upgrade/downgrade scripts 2023-01-13 10:22:41 +01:00
Arthur Baars
290167e1a3 Ruby: re-generated dbscheme/library 2023-01-13 10:22:41 +01:00
Arthur Baars
3a887d1c92 Ruby: update tree-sitter-{ruby, embedded-template} 2023-01-13 10:22:41 +01:00
Charis Kyriakou
792d4a83f9 Rename VS Code Extension Run Query command 2023-01-13 08:46:35 +00:00
Michael Nebel
600412db48 Java: Ignore missing html artifacts. 2023-01-13 08:58:53 +01:00
Michael Nebel
3b15f2359b Merge pull request #11861 from michaelnebel/java/testmodeldiff
Java: Update the Model Difference workflow to use the `gh api`.
2023-01-13 08:20:18 +01:00
Jami Cogswell
a43f3cf95f Java: remove Supplier.get model 2023-01-12 17:09:13 -05:00
Jami Cogswell
f040ff2d8d Java: undo change to Function.apply test case 2023-01-12 17:01:58 -05:00
Robert Marsh
337a747bde C++: cleanup some unneeded code 2023-01-12 16:38:58 -05:00
Robert Marsh
b2b45237c6 C++: use rounding to prevent float wobble in range analysis 2023-01-12 16:38:57 -05:00
Robert Marsh
31b61b1aa6 C++: fix a join order in range analysis 2023-01-12 16:38:57 -05:00
Robert Marsh
938176c9da C++: update test QL for modulus and sign analysis
These now instantiate their respective parameterized modules. No
results change.
2023-01-12 16:38:56 -05:00
Robert Marsh
7586762b10 C++: fix ambiguous import warnings 2023-01-12 16:38:56 -05:00
Robert Marsh
488368ecde C++: private import for module params 2023-01-12 16:38:55 -05:00
Robert Marsh
23281410e3 C++: Make bounds import private to preserve API 2023-01-12 16:38:54 -05:00
Robert Marsh
6db728190e C++: autoformat 2023-01-12 16:38:36 -05:00
Robert Marsh
02f1957919 C++: make SemBound a RangeAnalysis parameter 2023-01-12 16:38:11 -05:00
Robert Marsh
71b93d125e C++: Make RangeAnalysis.qll expose the old API 2023-01-12 16:38:11 -05:00
Robert Marsh
fb1ef07e9f C++: more parameterized modules in range analysis
This makes the modulus analysis and sign analysis into parameterized
modules which are instantiated in the main range analysis module, and
makes RangeAnalysisSpecific and RangeUtils into parameters to the main
range analysis.
Some classes also need to be moved and made into `instanceof` extensions
because they'd otherwise be extending across parameterized module
boundaries.
2023-01-12 16:38:10 -05:00
Robert Marsh
c062d5e206 C++: move language specific predicates to LangParam 2023-01-12 16:38:10 -05:00
Robert Marsh
c10733f926 C++: fix float binding issue in range analysis 2023-01-12 16:38:09 -05:00
Robert Marsh
b8c43d7a71 C++: convert RangeAnalysis to float 2023-01-12 16:38:09 -05:00
Robert Marsh
eebada46b1 C++: rename to RagneAnalysisStage.qll 2023-01-12 16:38:08 -05:00
Robert Marsh
edbe95837f Convert RangeAnalysis to trivial parameterized mod 2023-01-12 16:38:08 -05:00
Jami Cogswell
c3a1d088ac Java: update change note 2023-01-12 16:32:52 -05:00
Jami Cogswell
a39b2aaaac Java: remove endsWith test case 2023-01-12 16:24:57 -05:00
Jami Cogswell
ffb267937a Java: add endsWith additionalTaintStep to ConditionalBypassFlowConfig 2023-01-12 16:24:05 -05:00
Sarita Iyer
4acd1ababe Update docs/codeql/CONTRIBUTING.MD
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-01-12 15:57:43 -05:00
Arthur Baars
af8cb65b2e Merge pull request #11877 from aibaars/ql-ql-cross
QL/Ruby: include OS version in cache keys for Rust binaries
2023-01-12 20:02:25 +01:00
Michael Nebel
fd80974210 Java: Download databases using the gh api instead of lgtm. 2023-01-12 19:30:12 +01:00
Michael Nebel
c1c0ff4308 C#: Update database stats. 2023-01-12 19:06:29 +01:00
Michael Nebel
1384aa669b C#: Add change note. 2023-01-12 19:06:29 +01:00
Michael Nebel
5e89119b3d C#: Add upgrade- and downgrade scripts for unsigned right shift operators. 2023-01-12 19:06:29 +01:00
Michael Nebel
529be7ef18 C++: Sync files. 2023-01-12 19:06:29 +01:00
Michael Nebel
5c466f3319 Java: Sync files and update other relavant files related to the new naming of shift. 2023-01-12 19:06:29 +01:00
Michael Nebel
49a87e152a C#: Add unsigned right shift operator test case. 2023-01-12 19:06:28 +01:00
Michael Nebel
30738103f0 C#: Add unsigned right shift operator class. 2023-01-12 19:06:28 +01:00
Michael Nebel
148dc6de5a C#: Rename shift operator classes. 2023-01-12 19:06:28 +01:00
Michael Nebel
f48eda829f C#: Rename some of the TBinarySignOperation constructors. 2023-01-12 19:06:28 +01:00
Michael Nebel
d92b226041 C#: Add test example for unsigned right shift assignment in intermediate representation. 2023-01-12 19:06:28 +01:00
Michael Nebel
5bb8f8ed5c C#: Support for unsigned shift right in the experimental intermediate representation. 2023-01-12 19:06:28 +01:00
Michael Nebel
f74c7c28ae C#: Auto format test file and update expected test output. 2023-01-12 19:06:28 +01:00
Michael Nebel
0f032c5be9 C#: Sign analysis testcase for unsigned right shift. 2023-01-12 19:06:28 +01:00
Michael Nebel
2568318460 C#: Sign analysis support for unsigned right shift. 2023-01-12 19:06:28 +01:00
Michael Nebel
d06a877709 C#: Introduce test cases and expected result for unsigned right shift. 2023-01-12 19:06:28 +01:00
Michael Nebel
9eb7933778 C#: Implement library support for unsigned right shift. 2023-01-12 19:06:28 +01:00
Michael Nebel
99b7bc3b73 C#: Implement extractor support for unsigned right shift. 2023-01-12 19:06:28 +01:00
Michael Nebel
14c92e6eb3 C#: Add expressions kind including dummy stats for unsigned right shift and unsigned right shift assigment. 2023-01-12 19:06:28 +01:00
Michael Nebel
902b0a60d0 C#: Fixup ShiftExpr rename. 2023-01-12 19:06:28 +01:00
Michael Nebel
36980bbf42 C#: Rename shift expression classes. 2023-01-12 19:06:27 +01:00
Michael Nebel
a9f1c95513 C#: Rename shift assignment expression classes. 2023-01-12 19:06:27 +01:00
Chris Smowton
8aa2c23ba8 Merge pull request #11700 from JLLeitschuh/doc/JLL/improve-java-unsafe-deserialization-documentation
[Java] Document fixes for deserialization vulnerabilities by framework
2023-01-12 18:04:13 +00:00
Chris Smowton
09d8a50494 Spelling 2023-01-12 17:46:00 +00:00
Michael Nebel
aefb43324b Merge pull request #11738 from michaelnebel/go/maddataextensions
Go: Models as Data using extensions.
2023-01-12 18:42:35 +01:00
Erik Krogh Kristensen
8f9ad1f5ba Merge pull request #11872 from erik-krogh/jsAst
JS: Fixup some problems in PrintAST
2023-01-12 16:56:56 +01:00
Geoffrey White
7f31c9c7e5 Swift: Add a test. 2023-01-12 15:19:57 +00:00
Jami Cogswell
e0444449c8 Java: remove Function.apply model 2023-01-12 09:58:53 -05:00
Arthur Baars
e29e077a03 Ruby/QL4QL: include OS version in cache keys 2023-01-12 15:47:10 +01:00
erik-krogh
7ae27bcc34 fix errors in JS printAst 2023-01-12 15:37:52 +01:00
Henry Mercer
15ead6d0e6 Merge pull request #11864 from github/codeql-ci/atm/release-0.4.5
JS: Bump version numbers of ML-powered packs after 0.4.5 release
2023-01-12 13:51:24 +00:00
Jami
c725c447ac Merge branch 'main' into jcogs33/update-paramsString 2023-01-12 08:24:57 -05:00
Henry Mercer
70f1015fba Merge branch 'main' into codeql-ci/atm/release-0.4.5 2023-01-12 12:32:25 +00:00
Ian Lynagh
9ebe59d353 Merge pull request #11637 from igfoo/igfoo/kotlin-1.8
Kotlin: Add 1.8 support
2023-01-12 12:15:00 +00:00
Geoffrey White
3d1b2fdbda Swift: Rename NumericOrCharType.qll -> Numer> NumericType.qll. 2023-01-12 11:46:51 +00:00
Joe Farebrother
e12febfd96 Add change note 2023-01-12 11:44:39 +00:00
Joe Farebrother
b565f997a0 Improve qhelp 2023-01-12 11:44:39 +00:00
Joe Farebrother
639c42c9e9 Fix qhelp errors and ql-for-ql errors 2023-01-12 11:44:39 +00:00
Joe Farebrother
f52db7f9a3 Add qhelp 2023-01-12 11:44:39 +00:00
Joe Farebrother
a88759283a Fix typo in qldoc 2023-01-12 11:44:39 +00:00
Joe Farebrother
7e7b5b4488 Improve test case 2023-01-12 11:44:39 +00:00
Joe Farebrother
8449dabefe Add qldoc 2023-01-12 11:44:39 +00:00
Joe Farebrother
de565f9ccc Add test and fix a bug 2023-01-12 11:44:39 +00:00
Joe Farebrother
b96edb9c64 Add Sensitive Result Receiver query 2023-01-12 11:44:39 +00:00
Geoffrey White
418d593a97 Swift: Replace NumericOrCharType with a more basic NumericType, and rename classes for consistency with other static languages. 2023-01-12 11:43:20 +00:00
Geoffrey White
d0eb167d47 Swift: Merge FloatingPointType.qll into NumericOrCharType.qll, because it is a numeric type and other stuff like CharacterType is there. 2023-01-12 11:42:36 +00:00
Geoffrey White
4e5483744f Swift: Add a test case we're discussing. 2023-01-12 10:52:03 +00:00
Michael Nebel
48d0eccbf6 Go: Cleanup and renaming. 2023-01-12 11:13:34 +01:00
Michael Nebel
3749a1bd4d Go: Migrate unit tests to use data extensions for Models as Data. 2023-01-12 11:13:33 +01:00
Michael Nebel
218f553fef Go: Convert remaining CSV production models to use data extensions. 2023-01-12 11:13:33 +01:00
Michael Nebel
ebb3485a73 Go: Use the extensible predicates for model definitions. 2023-01-12 11:13:33 +01:00
Michael Nebel
5fd687d3df Go: Add MaD related extensible predicates. 2023-01-12 11:13:33 +01:00
Michael Nebel
0f993a0d26 Go: Prepare library for adding extensions. 2023-01-12 11:13:28 +01:00
Mathias Vorreiter Pedersen
1ae52b6c7e C++: Speedup 'MissingCheckScanf'. 2023-01-12 10:13:02 +00:00
Paolo Tranquilli
4f5f0aad45 Merge branch 'main' into redsun82/swift-open-redirection 2023-01-12 10:54:04 +01:00
Michael Nebel
18a815ca8b Merge pull request #11721 from michaelnebel/csharpjava/refactorprovenance
C#/Java: Re-factor provenance related predicates.
2023-01-12 10:50:31 +01:00
yoff
006eaf3e2a Merge pull request #11088 from yoff/python/inline-query-tests
Python: Inline query tests
2023-01-12 10:32:26 +01:00
Geoffrey White
994ea704da Swift: Clean up the QL a little. 2023-01-12 09:31:48 +00:00
Jami Cogswell
fd593fd4f0 Java: undo changes to tests that were affected by numeric-flow summary models 2023-01-11 22:34:19 -05:00
Harry Maclean
33a1469a56 Ruby: Add change note 2023-01-12 16:29:00 +13:00
Jami Cogswell
ce74c9d959 Java: Date models as neutral 2023-01-11 22:15:41 -05:00
Jami Cogswell
6bb865ad05 Java: make numeric flow models neutral 2023-01-11 18:04:43 -05:00
Henning Makholm
1d4b2fd0bb Merge pull request #11870 from github/hmakholm/pr/mergeback-2.12.0
Merge codeql-cli-2.12.0 back to main
2023-01-11 23:51:56 +01:00
Harry Maclean
8219465389 Ruby: fix missing doc 2023-01-12 11:35:35 +13:00
Harry Maclean
0626d693f5 Ruby: Recognise rack applications
This is a basic first step in modelling rack apps. We recognise classes
that look like rack applications and then treat the argument to `call`
in the same way that we treat `request.env` in ActionController classes.

This finds a TP in CVE-2021-43840.
2023-01-12 11:28:31 +13:00
Pierre
4e1f772f23 Merge pull request #11702 from github/turbo/experimental/combined
Introduce the security-experimental CodeQL suite and experimental tag
2023-01-11 20:37:42 +01:00
Geoffrey White
6a0b56bf40 Swift: Fix for extensions. 2023-01-11 18:32:07 +00:00
Geoffrey White
2622de9747 Swift: Improve Core Data coverage. 2023-01-11 18:26:34 +00:00
Geoffrey White
82f9903bf0 Swift: Additional test cases for swift/cleartext-storage-database on Core Data. 2023-01-11 18:22:32 +00:00
Jami Cogswell
0c7ffb0554 Java: update System.getProperty model 2023-01-11 12:04:22 -05:00
Pierre
c3116b3f0f Merge branch 'main' into turbo/experimental/combined 2023-01-11 18:02:55 +01:00
Mathias Vorreiter Pedersen
cc0371648b C++: Accept test changes. 2023-01-11 16:25:21 +00:00
Mathias Vorreiter Pedersen
a83879fa42 C++: Make sure that arguments of const pointer-type (as opposed to arguments of pointer to const-type) has an outgoing argument node. 2023-01-11 16:24:22 +00:00
Jami Cogswell
2a99af0e6d Java: remove summary model for String.endsWith 2023-01-11 10:58:46 -05:00
Jami Cogswell
99ee6c95a1 Java: remove models for Consumer.accept and Collectors.toMap 2023-01-11 10:44:38 -05:00
Mathias Vorreiter Pedersen
cd24405a22 Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into global-flow 2023-01-11 15:42:34 +00:00
Jami Cogswell
ac064ac2a7 Java: remove model for Collectors.joining 2023-01-11 10:30:49 -05:00
Michael Nebel
7e4f7a0c17 C#: Address review comments and sync files. 2023-01-11 16:29:24 +01:00
Michael Nebel
67cbe38255 Sync files. 2023-01-11 16:20:55 +01:00
Michael Nebel
8112058a0a Java: Adapt TopJdpApi library to the re-factor. 2023-01-11 16:20:55 +01:00
Michael Nebel
372ecf402f Go: Delete unused summaryModel predicate. 2023-01-11 16:20:55 +01:00
Michael Nebel
80a4197604 Swift: Re-factor provenance related predicates for summarized callable. 2023-01-11 16:20:55 +01:00
Michael Nebel
c01361a1fd Ruby: Re-factor provenance related predicates for summarized callable. 2023-01-11 16:20:55 +01:00
Michael Nebel
59a9e255c7 Python: Re-factor provenance related predicates for summarized callable. 2023-01-11 16:20:55 +01:00
Michael Nebel
6622eda04c Go: Re-factor provenance related predicates for summarized callable. 2023-01-11 16:20:55 +01:00
Michael Nebel
6a047d6916 Java: Re-factor provenance related predicates for summarized callable. 2023-01-11 16:20:55 +01:00
Michael Nebel
ea173f9516 Sync files. 2023-01-11 16:20:55 +01:00
Michael Nebel
7422029e49 C#: Re-factor provenance related predicates for summarized callable. 2023-01-11 16:20:48 +01:00
Michael Nebel
4b47b08ed2 Merge pull request #11760 from michaelnebel/movemodelgenerator
C#/Java: Move the modelgenerator.
2023-01-11 16:02:36 +01:00
Tony Torralba
c6d9e1ec81 Merge pull request #11742 from atorralba/atorralba/swift/more-path-injection-sinks
Swift: Add more path injection sinks
2023-01-11 15:15:42 +01:00
Tony Torralba
c115a9fee4 Add more path injection sinks 2023-01-11 14:28:24 +01:00
Tony Torralba
5d54482c71 Merge pull request #11770 from atorralba/atorralba/ql/omittable-exists
QL: Add OmittableExists query
2023-01-11 14:27:40 +01:00
Michael Nebel
11ca3f49f6 C#/Java: Adjust imports after moving files. 2023-01-11 13:13:33 +01:00
Michael Nebel
787b4743ee C#/Java: Rename the directories containing the model generator and tests. 2023-01-11 13:13:33 +01:00
Michael Nebel
178fd0e9e1 C#/Java: Remove all dashes in mode-generator. 2023-01-11 13:13:33 +01:00
erik-krogh
6914e9a17a Merge branch 'main' into atorralba/ql/omittable-exists 2023-01-11 13:09:38 +01:00
Erik Krogh Kristensen
466f24663e Merge pull request #11867 from erik-krogh/qlFix
QL: move queries folder instead of .cache folder now that we got .qlx
2023-01-11 13:03:47 +01:00
Erik Krogh Kristensen
3fa6a7cbff cache -> queries
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-01-11 12:29:15 +01:00
Tony Torralba
a4f813183e Merge pull request #11785 from atorralba/atorralba/swift/grdb-sinks
Swift: Add sinks for the GRDB library
2023-01-11 11:49:37 +01:00
erik-krogh
74a58f64aa move queries folder instead of .cache folder now that we got .qlx 2023-01-11 11:13:42 +01:00
erik-krogh
ed2dd87bda update the codeql-action version used in QL-for-QL 2023-01-11 11:13:06 +01:00
Tony Torralba
ecf568629b Add ExprAggregate as a negative edge in getConjunctionParentRec 2023-01-11 09:41:16 +01:00
Jami Cogswell
181a711f04 Java: switch Collectors.joining model from neutral to summary 2023-01-10 21:06:03 -05:00
github-actions[bot]
76e121e359 JS: Bump version of ML-powered library and query packs to 0.4.6 2023-01-10 21:11:23 +00:00
github-actions[bot]
dc88bdccc7 JS: Bump patch version of ML-powered library and query packs 2023-01-10 21:04:31 +00:00
Jami Cogswell
faae811be7 Java: try simplification of paramsString and paramsStringPart 2023-01-10 13:35:52 -05:00
Jami Cogswell
65aa064838 Java: update paramsString qldoc 2023-01-10 13:33:47 -05:00
Edward Minnix III
ce06df3152 Merge pull request #11628 from egregius313/egregius313/android-webview-addjavascriptinterface-dataflow
Java: Add parameters of methods annotated @JavascriptInterface as remote flow sources
2023-01-10 12:41:52 -05:00
Mathias Vorreiter Pedersen
8b01dfe696 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2023-01-10 17:30:29 +00:00
erik-krogh
38ca68febb recognize "-->" as a bad tag filter 2023-01-10 18:09:56 +01:00
Florin Coada
4c1c12dd70 suggestions in list format 2023-01-10 11:18:56 -05:00
Jonathan Leitschuh
1d7881e03f Apply suggestions from code review
Co-authored-by: Chris Smowton <smowton@github.com>
2023-01-10 11:18:56 -05:00
Tony Torralba
b7364f5428 Update UnsafeDeserialization.qhelp
Move the table under <recommendation>, minor fixes.
2023-01-10 11:18:56 -05:00
Jonathan Leitschuh
3fa11c21c3 [Java] Document fixes for deserialization vulnerabilities by framework
Related https://github.com/github/codeql/issues/11603
2023-01-10 11:18:56 -05:00
Paolo Tranquilli
0ad585cfe6 Merge pull request #11860 from github/redsun82/swift-clang-14
Swift: make compilation with newer STL possible
2023-01-10 17:17:56 +01:00
Erik Krogh Kristensen
54c780bdf9 Merge pull request #11853 from erik-krogh/assignMore
JS: add local flow when recognizing Object.assign calls for library-inputs
2023-01-10 17:04:29 +01:00
Tony Torralba
ae8c75ac97 Generalize ConjunctionParent 2023-01-10 16:08:42 +01:00
Tony Torralba
72a11e737d Merge pull request #11775 from atorralba/atorralba/all/omittable-exists
All: Remove omittable exists variables
2023-01-10 16:07:06 +01:00
Ian Lynagh
3367da82c4 Kotlin: Accept test changes
We get better locations with Kotlin 1.8.0.
2023-01-10 14:41:30 +00:00
Ian Lynagh
b7eb521fa0 Kotlin: Fix custom_plugin test for Kotlin 1.8.0 2023-01-10 14:41:30 +00:00
Ian Lynagh
c71ea80029 Kotlin: Accept test changes
We now get better locations, with Kotlin 1.8.0.
2023-01-10 14:41:30 +00:00
Ian Lynagh
20b35e5d02 Kotlin: 1.8.0 changes 2023-01-10 14:41:30 +00:00
Ian Lynagh
c4119761cc Kotlin: Another 1.8 build fix 2023-01-10 14:41:30 +00:00
Ian Lynagh
89b3363761 Kotlin: Bump CI version to 1.8.0-Beta 2023-01-10 14:41:30 +00:00
Ian Lynagh
b51c3aae85 Kotlin: Logs test: Allow for -Beta versions etc when parsing the logs 2023-01-10 14:41:29 +00:00
Ian Lynagh
6fbda1a9f0 Kotlin: Accept test changes with 1.8 2023-01-10 14:41:29 +00:00
Ian Lynagh
f7d8d16ed3 Kotlin: Fix build for 1.8.0-Beta
The build no longer works for Kotlin < 1.8: We get

    error: class 'org.jetbrains.kotlin.ir.IrElement' was compiled
           with an incompatible version of Kotlin. The binary version
           of its metadata is 1.8.0, expected version is 1.6.0.
2023-01-10 14:41:29 +00:00
erik-krogh
62b69bbd3e autoformat 2023-01-10 15:38:13 +01:00
Erik Krogh Kristensen
6623e5fbf3 Merge pull request #11852 from erik-krogh/jsInfiniteChar
JS: recognize an infinite repetition of a char-class like regex as a char-class like regex
2023-01-10 15:32:22 +01:00
Erik Krogh Kristensen
ce8836fb65 Update javascript/ql/lib/semmle/javascript/PackageExports.qll
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2023-01-10 15:30:44 +01:00
erik-krogh
43696f5e27 add explicit this 2023-01-10 15:27:37 +01:00
erik-krogh
23a847b1cf track shell:true more in js/shell-command-constructed-from-input 2023-01-10 15:27:37 +01:00
Erik Krogh Kristensen
9f8d10de11 Merge pull request #11851 from erik-krogh/jsFixMissingThis
JS: fix bad join-order in js/missing-this-qualifier
2023-01-10 15:23:25 +01:00
Paolo Tranquilli
2fb5621527 Swift: replace $(CC) with clang
On macOS `$(CC)` points to a wrapper that requires `DEVELOPER_DIR` to be
set in the environment. Using `clang` is slightly less generic, but
that's our default any way. Even if we do set a different clang version
somewhere, the selected version of GCC would not change, and the test
is targeting that.
2023-01-10 14:58:21 +01:00
Paolo Tranquilli
943763a026 Swift: add -Wno-pragma-once-outside-header to check 2023-01-10 14:30:35 +01:00
Paolo Tranquilli
28d79eeb77 Swift: make compilation with different STL versions possible
Previous to this patch the code contained a workaround for the standard
defect

https://cplusplus.github.io/LWG/issue3657

where `std::filesystem::path` did not have a `std::hash` implementation.

This patch allows compiling against versions of the STL that contain the
fix to the above issue. This is done by running the compiler against
code defining `std::hash<std::filesystem::path>`: if compilation
succeeds, it means the fix is not there and we need to use the
workaround, contained in `PathHash.h.workaround`. Otherwise, the fix is
there and we use `PathHash.h.fixed` instead, which only includes the
standard headers included by `PathHash.h.workaround`, so that one is a
drop-in replacement of the other.
2023-01-10 14:14:33 +01:00
Jeroen Ketema
1a4048d238 Merge pull request #11830 from jketema/frontend-update
C++: Changes for frontend update
2023-01-10 14:01:46 +01:00
erik-krogh
5c388c554c fix that the TypeTracker was unrestricted for the base-case of nonFirstLocationType 2023-01-10 13:39:50 +01:00
erik-krogh
e02b67af63 add failing test 2023-01-10 13:39:50 +01:00
Tony Torralba
50cd40ed20 Swift: Remove omittable exists variables 2023-01-10 13:39:50 +01:00
Tony Torralba
7ef8099a8b Shared: Remove omittable exists variables 2023-01-10 13:39:50 +01:00
Tony Torralba
c9d1cd97fb Ruby: Remove omittable exists variables 2023-01-10 13:39:49 +01:00
Tony Torralba
f6c3f77602 QL: Remove omittable exists variables 2023-01-10 13:37:58 +01:00
Tony Torralba
d87c8c75d6 Python: Remove omittable exists variables 2023-01-10 13:37:35 +01:00
Tony Torralba
3b6dae41cd JavaScript: Remove omittable exists variables 2023-01-10 13:37:21 +01:00
Tony Torralba
32471d326e Java: Remove omittable exists variables 2023-01-10 13:37:19 +01:00
Tony Torralba
7a92970d89 Go: Remove omittable exists variables 2023-01-10 13:36:48 +01:00
Tony Torralba
2ca0df0369 C#: Remove omittable exists variables 2023-01-10 13:36:25 +01:00
Tony Torralba
3fcc99e5cb C++: Remove omittable exists variables 2023-01-10 13:36:01 +01:00
Erik Krogh Kristensen
f2658a0936 apply suggestions from doc review
Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com>
2023-01-10 12:56:22 +01:00
erik-krogh
79e161e046 slightly broaden the regular expression that recognizes bad string-concats used as shell commands 2023-01-10 12:49:37 +01:00
Tony Torralba
da90ae0e8f Update java/ql/lib/semmle/code/java/dataflow/FlowSources.qll 2023-01-10 11:18:53 +01:00
Jeroen Ketema
8d46642de3 C++: Update dbscheme stats file 2023-01-10 10:41:43 +01:00
Jeroen Ketema
2fc6484162 C++: Add dbscheme upgrade and downgrade scripts 2023-01-10 10:41:43 +01:00
Jeroen Ketema
1bab950023 C++: Introduce (_Complex) _Float16 type which is needed after frontend update 2023-01-10 10:41:43 +01:00
Jeroen Ketema
282ca1094e C++: Accept test changes after improving size of _Float128 in frontend 2023-01-10 10:41:43 +01:00
Jeroen Ketema
e215c4c94c C++: Accept test changes after frontend update
The location of a reference dereference has changed slightly.
2023-01-10 10:41:43 +01:00
Michael Nebel
16cd148961 Merge pull request #11711 from michaelnebel/externalflowcleanup
C#/Java: Delete deprecated ModelCsv classes and related predicates.
2023-01-10 10:22:50 +01:00
Michael Nebel
1729319ebe Merge pull request #11804 from michaelnebel/csharp/alignqueryids
C#: Align query IDs.
2023-01-10 10:14:07 +01:00
Michael Nebel
18a0abdb4c Merge pull request #11740 from michaelnebel/csharp/updatestats
C#: Update stats based on projects.
2023-01-10 10:09:53 +01:00
Ed Minnix
293a203756 Move JavascriptInterfaceMethod to WebView.qll 2023-01-09 15:10:23 -05:00
Rasmus Lerchedahl Petersen
2edbfbf8bc python: update test expectations
...now the bug is fixed
2023-01-09 20:35:20 +01:00
Mathias Vorreiter Pedersen
7f5344e025 Update swift/ql/lib/codeql/swift/elements/type/NumericOrCharType.qll
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2023-01-09 17:08:27 +00:00
Tony Torralba
8e0a018673 Consider Int8 and UInt8 as OsLogNonRedactedTypes 2023-01-09 18:05:18 +01:00
Tony Torralba
49a41c98ee Test that hashed passwords are 'safe' to log
This doesn't seem completely right, but the heuristic approach we have regarding sensitive expressions has to draw the line somewhere.
2023-01-09 18:01:07 +01:00
Tony Torralba
160d89fb4e Add qhelp examples 2023-01-09 18:01:07 +01:00
Tony Torralba
33029b0ed8 Fix sanitizer QLDoc 2023-01-09 18:01:07 +01:00
Tony Torralba
7e0869965c Uncomment tests 2023-01-09 18:01:07 +01:00
Tony Torralba
c1f19dd145 Add stub so that tests work on Linux 2023-01-09 18:01:07 +01:00
Tony Torralba
b203a9eb6e Add a sanitizer for OSLogPrivacy options
Add test cases to verify how the sanitizer behaves depending on the argument type and the privacy option being used.
2023-01-09 18:01:07 +01:00
Tony Torralba
aad56097ac Add Cleartext Loggin query for Swift.
With some caveats: see TODO comments and failing tests.
2023-01-09 18:01:07 +01:00
Rasmus Lerchedahl Petersen
c142495a8b python: simplify code 2023-01-09 17:51:45 +01:00
Rasmus Lerchedahl Petersen
5fe62e293a python: fix bug, add clarifying comment 2023-01-09 17:45:50 +01:00
erik-krogh
9f100ef2c6 add local flow when recognizing Object.assign calls for library-inputs 2023-01-09 17:44:11 +01:00
Tony Torralba
eb78661c1f Add missing SQL injection tests for the GRDB SQL class 2023-01-09 17:36:54 +01:00
erik-krogh
90f9e3f825 recognize an infinite repetition of a char-class like regex as a char-class like regex 2023-01-09 17:25:08 +01:00
Sarita Iyer
be06469a19 Merge pull request #11835 from github/saritai/pr/qlx
Docs: CodeQL pack compatibility
2023-01-09 10:15:08 -05:00
Ed Minnix
909b1d70d9 Rename files to say "Allow" instead of "Permit" 2023-01-09 10:11:03 -05:00
Ed Minnix
c723df3ca7 Fix alert message in expected file 2023-01-09 10:08:19 -05:00
erik-krogh
785c21f462 fix bad join-order in js/missing-this-qualifier 2023-01-09 16:06:26 +01:00
Ed Minnix
f626d4794a Change wording from "permit" to "allow" in id and name 2023-01-09 10:03:12 -05:00
Ed Minnix
972b4629c8 Fix typo in change note 2023-01-09 10:01:38 -05:00
Ed Minnix
64668883a4 Add good example to documentation 2023-01-09 09:59:38 -05:00
Ed Minnix
2ec73c50f9 Mention WebView in alert message 2023-01-09 09:55:09 -05:00
Arthur Baars
664fdc3b2a Merge pull request #11815 from aibaars/too-many-fields
Ruby: use record_parse_error_for_node to report extractor error
2023-01-09 15:40:19 +01:00
Mathias Vorreiter Pedersen
0f93e5c907 Merge pull request #11781 from MathiasVP/as-expr-for-arrays
C++: Map more expressions to `OperandNode`s
2023-01-09 14:38:22 +00:00
Erik Krogh Kristensen
5157d4df7b Merge pull request #11581 from erik-krogh/stdin
Rb: add stdin as source for unsafe-deserialization
2023-01-09 13:57:47 +01:00
Chris Smowton
e9bbb5d7fa Merge pull request #11730 from smowton/smowton/admin/improve-sql-unescaped-docs
Java: improve naming and description of SqlUnescaped.ql
2023-01-09 12:50:27 +00:00
yoff
c01ce955ba Merge pull request #11778 from yoff/shared/inline-tests
Shared: Inline test expectations
2023-01-09 13:21:18 +01:00
Chris Smowton
2e26fb1171 Merge pull request #11819 from smowton/smowton/admin/port-java-autobuilder-tests
Add Java autobuilder integration tests
2023-01-09 12:17:39 +00:00
Chris Smowton
efe23c1da7 Note that alerts should not be re-raised 2023-01-09 10:56:13 +00:00
Chris Smowton
994a46289f Add change note 2023-01-09 10:56:13 +00:00
Chris Smowton
ef27f9fe96 Replace one more mention of escaping 2023-01-09 10:56:13 +00:00
Chris Smowton
45c732a6f9 Java: improve naming and description of SqlUnescaped.ql
Since the main thing it's objecting to is concatenation not lack of escaping (in particular it doesn't look for escaping sanitizers), rename and re-describe it accordingly.
2023-01-09 10:56:13 +00:00
Mathias Vorreiter Pedersen
381301e552 Update swift/ql/lib/swift.qll
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2023-01-09 10:32:52 +00:00
Geoffrey White
9333e80def Swift: Add getVaList stub to the test. 2023-01-09 10:29:37 +00:00
Taus
06ea249997 Merge pull request #11820 from yoff/python/fix-downgrades
Python: fix downgrade script
2023-01-09 11:24:41 +01:00
Mathias Vorreiter Pedersen
6bb09ef289 Swift: Add integral type classes. 2023-01-09 09:43:09 +00:00
Mathias Vorreiter Pedersen
9be9636816 Merge pull request #11670 from atorralba/atorralba/swift/predicate-injection
Swift: Add predicate injection query
2023-01-09 08:54:13 +00:00
erik-krogh
d67e756f42 make the import of Gem private 2023-01-09 09:13:01 +01:00
Harry Maclean
5b117084db Merge pull request #11534 from hmac/array-inclusion-barrier-guard-constant
Ruby: Make array inclusion barrier more sensitive
2023-01-09 20:57:09 +13:00
Paolo Tranquilli
82d9edfabf Merge branch 'main' into redsun82/swift-open-redirection 2023-01-09 08:44:02 +01:00
Sarita Iyer
f15291a9de Change the order of sections 2023-01-06 15:00:43 -05:00
Sarita Iyer
d079c7a5ef Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2023-01-06 14:57:24 -05:00
Jami Cogswell
a3c7b2c3a2 Java: move java.lang.Math.min to the correct file 2023-01-06 14:35:09 -05:00
Geoffrey White
bb50a99b36 Swift: Additional test cases. 2023-01-06 18:48:46 +00:00
Geoffrey White
b5dd815249 Swift: Flow through optional binding. 2023-01-06 18:34:22 +00:00
Geoffrey White
c598d9b882 Swift: Generalize an SSA case for variables declared in Patterns. 2023-01-06 18:34:22 +00:00
Geoffrey White
8a9a69fa00 Swift: Add more dataflow tests for of optionals, patterns, enums. 2023-01-06 18:34:22 +00:00
Jeroen Ketema
a743fbcc95 Merge pull request #11799 from jketema/case-uncomment
C++: Uncomment cases in dbscheme
2023-01-06 19:26:53 +01:00
Sarita Iyer
d7bf2d9375 docs for codeql pack compatibility 2023-01-06 12:07:24 -05:00
Geoffrey White
04f87a26a9 Swift: Test layout change. 2023-01-06 16:52:54 +00:00
Sarita Iyer
a9867a266e fixed link 2023-01-06 11:50:07 -05:00
Sarita Iyer
d68cfc7d4f codeql pack compatibility docs 2023-01-06 11:17:02 -05:00
erik-krogh
538adb47a3 update expected output for DuplicateCharacterInSet 2023-01-06 15:41:57 +01:00
Chris Smowton
831255e9c0 Merge pull request #11832 from github/mbg/fix/go-version-warnings
Go: Handle output from `go version` more gracefully
2023-01-06 14:05:39 +00:00
Jeroen Ketema
c1bc097355 C++: Add upgrade/downgrade scripts for dbscheme update 2023-01-06 14:26:24 +01:00
Jeroen Ketema
cdb34bb1f9 C++: Update database stats file 2023-01-06 14:26:23 +01:00
Jeroen Ketema
b9b0c8091f C++: Uncomment cases in dbscheme
Note that the builtin types `__int{8,16,32,64}` are not uncommented,
as these are never and could have never been generated by the
extractor.
2023-01-06 14:26:23 +01:00
Geoffrey White
f3914ffe25 Merge pull request #11823 from geoffw0/heuristicalloc
C++: Use HeuristicAllocationExpr in more queries
2023-01-06 13:13:14 +00:00
Jami
f5e5f6dfd1 Merge pull request #11821 from jcogs33/jcogs33/fix-mad-typos
Java: fix typos in MaD row `name` columns for `MappingSqlQuery` and `MappingSqlQueryWithParameters`
2023-01-06 07:59:30 -05:00
Rasmus Lerchedahl Petersen
03bd6cb414 python: Allow optional result=OK
Also add a further test case
2023-01-06 13:33:12 +01:00
erik-krogh
10308f5875 track string-constants to regular expression uses 2023-01-06 13:17:31 +01:00
Nick Rolfe
4c5f149afd Merge pull request #11831 from github/post-release-prep/codeql-cli-2.12.0
Post-release preparation for codeql-cli-2.12.0
2023-01-06 12:15:17 +00:00
Michael B. Gale
1ef1d63c11 Add test for parseGoVersion 2023-01-06 11:20:51 +00:00
Michael B. Gale
9af9b32722 Find the last line of output from go version 2023-01-06 11:20:39 +00:00
Geoffrey White
bb451f3911 C++: Fix result duplication. 2023-01-06 11:05:47 +00:00
github-actions[bot]
cdb8f67601 Post-release preparation for codeql-cli-2.12.0 2023-01-06 10:36:34 +00:00
Rasmus Lerchedahl Petersen
8d9e94a00f swift: fix typo 2023-01-06 11:22:49 +01:00
erik-krogh
0a1769657d add change-note 2023-01-06 09:09:09 +01:00
erik-krogh
19d2b49562 drive-by: make Base64.decode64(..) into a flowsummary that is shared with all queries 2023-01-06 09:04:37 +01:00
erik-krogh
1a27441cfb drive-by: delete code-execution sinks from unsafe-deserialization, we risked duplicate alerts 2023-01-06 09:04:36 +01:00
erik-krogh
0e6028a7f3 add stdin as source for unsafe-deserialization 2023-01-06 09:04:36 +01:00
Rasmus Lerchedahl Petersen
d42bb119fe python: align annotations with Ruby
use `result=BAD` for expected alert
and `result=OK` on sinks where alerts are not wanted.
2023-01-05 21:41:28 +01:00
Rasmus Lerchedahl Petersen
ad95225272 python: improve code
according to alert and reviewer's suggestion
2023-01-05 20:42:29 +01:00
erik-krogh
f98ff65b11 use eval() instead of send() in test 2023-01-05 20:04:04 +01:00
Erik Krogh Kristensen
d9176541c6 Apply suggestions from code review
Co-authored-by: Alex Ford <alexrford@users.noreply.github.com>
2023-01-05 20:02:54 +01:00
Nick Rolfe
44213f0144 Merge pull request #11826 from github/nickrolfe/check-change-note
CI: fail if a changenote filename doesn't have the right format
2023-01-05 16:55:30 +00:00
Nick Rolfe
4e6baf83c8 Update .github/workflows/check-change-note.yml
Co-authored-by: Taus <tausbn@github.com>
2023-01-05 16:26:43 +00:00
Nick Rolfe
0beca9d96c CI: fail if a changenote filename doesn't have the right format 2023-01-05 16:01:07 +00:00
Jeroen Ketema
f370cd840c Merge pull request #11818 from jketema/downgrade-fix
C++: Fix the expression kind in two of the downgrade scripts
2023-01-05 16:33:16 +01:00
Geoffrey White
b3e82498fa C++: Change note. 2023-01-05 15:06:40 +00:00
Jami Cogswell
f03f687d61 Java: add change note 2023-01-05 09:08:04 -05:00
Rasmus Lerchedahl Petersen
bb26c31f84 Python: fix downgrade script
When new kinds are inserted, new indices exists that do not
correspond to any old indices.
These were previously mapped, now they are not.
2023-01-05 14:56:52 +01:00
Jami Cogswell
0640bd9d8b Java: fix typos in the MaD row name columns for MappingSqlQuery and MappingSqlQueryWithParameters 2023-01-05 08:32:22 -05:00
Rasmus Lerchedahl Petersen
8afb541718 cpp/swift: fix qldoc 2023-01-05 14:30:13 +01:00
yoff
a74062cd51 Update go/ql/test/TestUtilities/InlineExpectationsTest.qll
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2023-01-05 14:12:16 +01:00
Geoffrey White
3b31da8a62 C++: Update the experimental query as well. 2023-01-05 12:48:17 +00:00
Geoffrey White
46baf9d5e5 C++: Add test cases for an experimental query as well. 2023-01-05 12:48:16 +00:00
Geoffrey White
c160e0b2a4 C++: Add a warning on HeuristicAllocationExpr.getSizeBytes() and similar methods. 2023-01-05 12:47:52 +00:00
Geoffrey White
823c767aac C++: Undo changes to SizeCheck.ql, SizeCheck2.ql. 2023-01-05 12:34:12 +00:00
Chris Smowton
52297c0b23 Add Java autobuilder integration tests 2023-01-05 12:19:25 +00:00
Jonas Jensen
c8f35ea1ea Merge pull request #11810 from kaspersv/kaspersv/inline-late-pragma
Add inline_late pragma to QL language spec
2023-01-05 13:15:12 +01:00
Geoffrey White
2023abdc60 C++: Update the queries. 2023-01-05 11:33:58 +00:00
Geoffrey White
a9aa67177b C++: Add test cases for HeuristicAllocationExpr in queries. 2023-01-05 11:30:21 +00:00
Geoffrey White
10ca2dac19 C++: Remove unnecessary 'semmle' directory. 2023-01-05 11:30:15 +00:00
Jeroen Ketema
14283f01ac C++: Fix the expression kind in two of the downgrade scripts
A 0 value for the expression kind is not valid, as 0 does not occur in the
relevant case split. This should have been the value of `@errorexpr`, which
is 1.
2023-01-05 11:04:31 +01:00
Rasmus Lerchedahl Petersen
c3b3c05cf3 Revert "Merge pull request #37 from erik-krogh/shared/inline-tests"
This reverts commit 65fe9abcfe, reversing
changes made to 08e9d3391f.
2023-01-05 09:19:43 +01:00
Sarita Iyer
745d30252c Update CONTRIBUTING.MD 2023-01-04 16:49:27 -05:00
Sarita Iyer
a62a8d9960 Update CONTRIBUTING.MD 2023-01-04 16:47:34 -05:00
Sarita Iyer
d859e1e9a3 add contributing info 2023-01-04 16:43:17 -05:00
Rasmus Lerchedahl Petersen
2e46919e10 java: nicer code as suggested by review 2023-01-04 19:50:29 +01:00
Geoffrey White
e45750a8ca Merge branch 'main' into format 2023-01-04 18:00:59 +00:00
Arthur Baars
799e0c1bcc Ruby: use record_parse_error_for_node to report extractor error 2023-01-04 17:35:47 +01:00
yoff
65fe9abcfe Merge pull request #37 from erik-krogh/shared/inline-tests
inline Location into the shared implementation of InlineExpectationsTest
2023-01-04 17:08:23 +01:00
Kasper Svendsen
9ad572fa29 Add inline_late pragma to QL language spec 2023-01-04 11:28:08 +01:00
Harry Maclean
4d228bcddf Ruby: Recognise more string-valued variables
This increases the sensitivity of our barrier guards.
2023-01-04 11:45:10 +13:00
Harry Maclean
9944252c43 Ruby: Add test for barrier guards
This demonstrates that we are missing a guard when a case branch
compares against a string-valued variable rather than a string literal.
2023-01-04 11:45:10 +13:00
Harry Maclean
698a679c78 Ruby: add test 2023-01-04 11:45:10 +13:00
Harry Maclean
0fbb6bf608 Ruby: Make array inclusion barrier more sensitive 2023-01-04 11:45:09 +13:00
Jami Cogswell
abe501c1af Java: add change note 2023-01-03 17:15:50 -05:00
Jami Cogswell
5d92792e40 Java: update test case affected by Function.apply model 2023-01-03 16:14:08 -05:00
Jami Cogswell
feaae16f7c Java: adjust comments 2023-01-03 16:08:14 -05:00
Ed Minnix
0be8648a9d Add changenote 2023-01-03 15:55:53 -05:00
Ed Minnix
28f555c2b2 Add simple test case for @JavascriptInterface parameter flow 2023-01-03 15:31:40 -05:00
Ed Minnix
ab7ca1d642 Java: Add parameters of @JavascriptInterface methods as a remote flow sources 2023-01-03 15:31:40 -05:00
Ed Minnix
f9b8200009 Add stub for android.webkit.JavascriptInterface annoation 2023-01-03 15:31:40 -05:00
Edward Minnix III
69fd5e93bc Merge pull request #28 from egregius313/egregisu313/webview-setAllowContentAccess-single-query
Merge `setAllowContentAccess` queries into singular query
2023-01-03 15:27:09 -05:00
Ed Minnix
81df89f93e Use proper @id in changenote 2023-01-03 15:19:26 -05:00
Ed Minnix
28ad9d00fb Merge both setAllowContentAccess queries into one query
Previously, the query to detect whether or not access to `content://`
links was done using two queries.

Now they can be merged into one query
2023-01-03 15:17:07 -05:00
Jami Cogswell
29221ae426 Java: add summary model for System.getProperty, adjust comments 2023-01-03 15:11:21 -05:00
Jami Cogswell
21a018e5c5 Java: add summary model and test for File.getName 2023-01-03 13:12:24 -05:00
Geoffrey White
fc646a6d48 Swift: Update .expected following a toString change in main. 2023-01-03 16:25:14 +00:00
Geoffrey White
e05bb7fcee Merge branch 'main' into format 2023-01-03 15:14:55 +00:00
Michael Nebel
17cd182d72 C#: Update stats based on projects. 2023-01-03 15:44:47 +01:00
Michael Nebel
9d608a78a3 C#: Add change note on renamed query ids. 2023-01-03 15:18:22 +01:00
Michael Nebel
bfe5a0c438 C#: Rename query id's to be prefixed with cs instead of csharp. 2023-01-03 15:13:54 +01:00
erik-krogh
3811eae679 simplify the qhelp for unsafe-code-construction
The `send()` example is not flagged by any current query, so it was weird talking about it as "vulnerable".
2023-01-02 13:33:56 +01:00
erik-krogh
3815a5a096 fix qhelp syntax 2023-01-02 10:19:05 +01:00
Ed Minnix
35de551f6b Formatting 2022-12-31 17:19:49 -05:00
Ed Minnix
515fa21aad Change notes 2022-12-31 17:18:37 -05:00
Ed Minnix
df1a4d2ed1 Documentation fix: Add state1 and state2 to documentation 2022-12-31 15:25:37 -05:00
Ed Minnix
68392aa8d8 Fix test expectations 2022-12-31 15:25:25 -05:00
Ed Minnix
02f70f3536 Add @security-severity tag 2022-12-31 15:00:28 -05:00
Edward Minnix III
1d345c6101 Refactoring and simplification
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2022-12-31 15:00:28 -05:00
Ed Minnix
9ef319f659 Java: setAllowContentAccess query tests 2022-12-31 15:00:28 -05:00
Ed Minnix
5265cb4b03 Merge two dataflow configurations into one taint tracking 2022-12-31 15:00:28 -05:00
Ed Minnix
973f649e76 Break dataflow into two steps in order to capture flow from WebView to settings call 2022-12-31 15:00:28 -05:00
Ed Minnix
0e15dd9fa9 Query metadata 2022-12-31 15:00:28 -05:00
Edward Minnix III
778749184b Change id to use android/ instead of prepending android-
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2022-12-31 15:00:28 -05:00
Ed Minnix
da25c586e6 Dataflow query for detecting paths that disable content access
Since the default value is `true`, we need to determine whether or not
the `setAllowContentAccess` method is ever called using dataflow.
2022-12-31 15:00:28 -05:00
Ed Minnix
8a763015e6 Reduce precision rating to medium
This query won't always be a security problem, so it should have a lower
precision rating than `high`.
2022-12-31 15:00:28 -05:00
Ed Minnix
7cc53126f3 Java: WebView setAllowContentAccess query test cases 2022-12-31 15:00:28 -05:00
Ed Minnix
a023726c03 Java: add Android stubs to options file for CWE-200 tests 2022-12-31 15:00:28 -05:00
Ed Minnix
e4e13d38b7 Java: query for Android WebView setAllowContentAccess 2022-12-31 15:00:28 -05:00
Ed Minnix
e259ef5d1d Java: Add class for android.webkit.WebSettings.setAllowContentAccess 2022-12-31 15:00:28 -05:00
Harry Maclean
a6571a05ab Ruby: Include send example in qhelp 2022-12-28 11:34:55 +13:00
Harry Maclean
d3812f5906 Ruby: Add another code injection example to qhelp 2022-12-28 11:20:56 +13:00
Tony Torralba
07d99bd643 Add path injection sinks 2022-12-23 17:16:06 +01:00
Tony Torralba
4215a89bc8 Add cleartext storage database sinks 2022-12-23 17:15:59 +01:00
Tony Torralba
ac39aeb6b6 Add SQLi sinks 2022-12-23 17:03:31 +01:00
Jami Cogswell
939279af38 Java: add comments 2022-12-22 16:25:12 -05:00
Jami Cogswell
673d37cc3d Java: update Math.min test case 2022-12-22 14:36:06 -05:00
Jami Cogswell
a81c54b58c Java: updates to order alphabetically 2022-12-22 13:22:12 -05:00
Jami Cogswell
e6331dc2e6 Java: update test case affected by Long.parseLong summary model 2022-12-22 12:57:37 -05:00
Jami Cogswell
997219a280 Java: update test case affected by Class.isAssignableFrom neutral model 2022-12-22 12:54:02 -05:00
Jami Cogswell
6007827dd3 Java: update test cases 2022-12-22 12:29:57 -05:00
Mathias Vorreiter Pedersen
83d751b287 Merge pull request #11768 from MathiasVP/fix-implicit-reads-in-cleartext-sqlite-database
C++: Fix implicit reads on `cpp/cleartext-storage-database`
2022-12-22 13:47:10 +00:00
Mathias Vorreiter Pedersen
e86e3ec3ec Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-12-22 11:29:43 +00:00
Mathias Vorreiter Pedersen
e453c7a36e C++: Accept test changes. 2022-12-22 10:57:54 +00:00
Mathias Vorreiter Pedersen
05cd2518a4 C++: Map more expressions to operand nodes. 2022-12-22 10:57:11 +00:00
Tony Torralba
36ca97e4f6 Add exclusions to reduce FP
Predicate parameters that have a database type are excluded.

Also, uses of the exists variable in an agreggation or another quantifier are excluded.
2022-12-22 11:15:07 +01:00
erik-krogh
b3dd50bc36 inline Location into the shared implementation of InlineExpectationsTest 2022-12-22 11:09:43 +01:00
Rasmus Lerchedahl Petersen
08e9d3391f swift: use shared inline tests
- add util shared pack to swift
 - remove from identical-files
2022-12-22 10:20:07 +01:00
Rasmus Lerchedahl Petersen
b0d7998342 go: use shared inline tests
- remove from identical-files
2022-12-22 10:20:07 +01:00
Rasmus Lerchedahl Petersen
f28eb6bf31 ql4ql: use shared inline tests
- add util shared pack to ql
 - remove from identical-files
2022-12-22 10:20:07 +01:00
Rasmus Lerchedahl Petersen
0d6c643d77 ruby: use shared inline tests
- remove from identical-files
2022-12-22 10:20:07 +01:00
Rasmus Lerchedahl Petersen
4667068017 java: use shared inline tests
- remove from identical-files
2022-12-22 10:20:06 +01:00
Rasmus Lerchedahl Petersen
a9b232bff4 csharp: use shared inline tests
- remove from identical-files
2022-12-22 10:20:06 +01:00
Rasmus Lerchedahl Petersen
d97e185994 cpp: use shared inline tests
- remove from identical-files
2022-12-22 10:20:06 +01:00
Rasmus Lerchedahl Petersen
e8d3802ee5 Python: use shared inline tests
- remove from identical-files
2022-12-22 10:20:05 +01:00
Rasmus Lerchedahl Petersen
b767dcfd18 shared: Add shared inline expectation test library 2022-12-22 10:20:05 +01:00
Jami Cogswell
de5965525f Java: add initial test cases for summary models 2022-12-21 16:19:37 -05:00
Jami Cogswell
c251da799f Java: update TopJdkApis test 2022-12-21 13:19:09 -05:00
Jami Cogswell
16de30e07e Java: add java.util.stream models 2022-12-21 13:05:23 -05:00
Jami Cogswell
1db829e55c Java: add java.util models 2022-12-21 13:03:57 -05:00
Jami Cogswell
573de92441 Java: add java.util.function models 2022-12-21 12:59:58 -05:00
Jami Cogswell
a8c55ee4b7 Java: add java.util.concurrent models 2022-12-21 12:59:00 -05:00
Jami Cogswell
db0d24fdd1 Java: add java.util.concurrent.atomic models 2022-12-21 12:57:22 -05:00
Jami Cogswell
cfe075ef54 Java: add java.time models 2022-12-21 12:54:35 -05:00
Jami Cogswell
8e20aeb314 Java: add java.text models 2022-12-21 12:51:44 -05:00
Jami Cogswell
b9ce588076 Java: add java.sql models 2022-12-21 12:49:29 -05:00
Jami Cogswell
1544f49f91 Java: add java.math models 2022-12-21 12:47:32 -05:00
Jami Cogswell
ed534b06d5 Java: add java.lang models 2022-12-21 12:45:12 -05:00
Jami Cogswell
99ddd484be Java: add java.io models 2022-12-21 12:34:26 -05:00
Tony Torralba
7d0018c897 Update ql/ql/src/queries/style/OmittableExists.ql 2022-12-21 17:16:34 +01:00
Tony Torralba
ac0c42c5c6 Apply suggestions from code review
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2022-12-21 16:16:58 +01:00
Tony Torralba
227e099854 Apply code review suggestions
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2022-12-21 12:40:29 +01:00
Tony Torralba
aa1d49cb95 Add OmittableExists QL-for-QL query 2022-12-21 12:26:58 +01:00
Mathias Vorreiter Pedersen
273af3cbf1 C++: Fix 'allowImplicitRead' override in 'cpp/cleartext-storage-database'. 2022-12-21 09:43:00 +00:00
Paolo Tranquilli
454af0d721 Swift: fix locking of output swiftmodule trap 2022-12-20 15:34:18 +01:00
Paolo Tranquilli
a1161c6efe Swift: remove header patch which is not needed any more 2022-12-20 15:28:52 +01:00
Paolo Tranquilli
725861626c Merge branch 'main' into redsun82/swift-open-redirection 2022-12-20 15:28:30 +01:00
Tony Torralba
30aa9b230c Apply suggestions from code review
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
2022-12-20 14:14:05 +01:00
Jeroen Ketema
0addae81cd Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-12-20 11:34:41 +01:00
Jeroen Ketema
949b61c635 Merge pull request #11729 from MathiasVP/fix-cleartext-sqlite-database
C++: Prepare `cpp/cleartext-storage-database` for use-use flow
2022-12-19 14:01:34 +01:00
Jeroen Ketema
88a1eead03 Merge pull request #11724 from MathiasVP/clear-text-transmission-dont-track-indirection
C++: Use `asExpr` in `cpp/cleartext-transmission`
2022-12-19 11:31:06 +01:00
turbo
d1d4163b79 Exclude cpp/wrong-use-of-the-umask 2022-12-18 15:55:04 +01:00
turbo
b7c33734b1 Merge remote-tracking branch 'origin/turbo/experimental/combined' into turbo/experimental/combined 2022-12-18 15:44:53 +01:00
turbo
1e5426fca2 Create security-experimental suite helper and all language suite implementations 2022-12-18 15:44:08 +01:00
ihsinme
a2836dc72a Update test.cpp 2022-12-18 00:38:32 +03:00
ihsinme
945cdef18d Update DivideByZeroUsingReturnValue.expected 2022-12-18 00:35:28 +03:00
ihsinme
c790b0fed6 Update DivideByZeroUsingReturnValue.ql 2022-12-18 00:34:14 +03:00
Robert Marsh
df7a4ac093 Merge pull request #11722 from MathiasVP/make-buffer.qll-unique-again
C++: Use `unique` in `getBufferSize`
2022-12-16 15:00:18 -05:00
Mathias Vorreiter Pedersen
1d80e94bb4 C++: Prepare 'CleartextSqliteDatabase.ql' for use-use flow. 2022-12-16 17:10:10 +00:00
Mathias Vorreiter Pedersen
c09ed10d33 Merge pull request #11727 from MathiasVP/fix-crement-and-assign-op-dataflow-mappings
C++: Fix `DataFlow <-> Expr` mappings for `CrementOperation` and `AssignOperation`
2022-12-16 17:05:13 +00:00
Mathias Vorreiter Pedersen
33649ed7d3 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-12-16 17:02:06 +00:00
Mathias Vorreiter Pedersen
a7aa1a7d8b C++: Accept more test changes 2022-12-16 16:04:35 +00:00
Robert Marsh
eddc2f3038 Merge pull request #11694 from MathiasVP/iterator-use-use-flow-using-ir-ssa
C++: Iterator flow for IR-based use-use flow (second attempt)
2022-12-16 10:51:19 -05:00
Mathias Vorreiter Pedersen
45f69be94c C++: Accept test changes 2022-12-16 14:14:58 +00:00
Mathias Vorreiter Pedersen
df526552a6 C++: Fix mapping between dataflow nodes and '{Crement, Assign}Operations'. 2022-12-16 14:14:48 +00:00
Mathias Vorreiter Pedersen
2de2887ebb C++: Accept test changes 2022-12-16 13:27:08 +00:00
Mathias Vorreiter Pedersen
4ace171447 C++: Don't track indirection expressions in 'cpp/cleartext-transmission'. Instead, just track the direct expression. 2022-12-16 13:26:53 +00:00
Mathias Vorreiter Pedersen
81de93da2d C++: Accept test changes 2022-12-16 12:58:53 +00:00
Mathias Vorreiter Pedersen
c06f7259cf C++: Make the 'getBufferSize' a lot more like the pre-use-use flow implementation. 2022-12-16 12:58:45 +00:00
Geoffrey White
640f894b00 Merge branch 'main' into format 2022-12-16 11:42:03 +00:00
Tony Torralba
46ea067449 Add bidirectional import in ExternalFlow.qll 2022-12-16 09:59:48 +01:00
Sim4n6
4376870a51 An uploded file is considered a source 2022-12-15 23:39:02 +01:00
Geoffrey White
1f7d96a74a Merge branch 'main' into format 2022-12-15 15:17:54 +00:00
Michael Nebel
2034b00772 C#: Remove deprecated ModelCsv classes. 2022-12-15 15:22:52 +01:00
Michael Nebel
0f038ee93a Java: Remove deprecated ModelCsv classes. 2022-12-15 15:22:44 +01:00
Paolo Tranquilli
7f505d8715 Swift: do not filter frontend actions 2022-12-15 14:39:43 +01:00
Mathias Vorreiter Pedersen
a36afc6bff C++: Accept more test changes. 2022-12-15 13:29:05 +00:00
Paolo Tranquilli
208388e04d Swift: hard code libc.dylib path on macOS
Also, handle the corner case where loading libc fails.
2022-12-15 13:30:23 +01:00
Mathias Vorreiter Pedersen
73b93be313 C++: Prevent non-termination in 'getTypeImpl' when a iterator defines itself as 'value_type'. 2022-12-15 11:55:25 +00:00
Mathias Vorreiter Pedersen
526b913f7d C++: Fix join orders. 2022-12-15 11:55:25 +00:00
Mathias Vorreiter Pedersen
cb47bdd9fd C++: Accept test changes. 2022-12-15 11:55:25 +00:00
Mathias Vorreiter Pedersen
f94ca0e087 C++: Add implicit defs and uses for iterators' underlying containers. 2022-12-15 11:55:21 +00:00
Mathias Vorreiter Pedersen
78b7e12b87 C++: Make 'DefImpl' and 'useImpl' abstract. 2022-12-15 11:54:32 +00:00
Mathias Vorreiter Pedersen
5d417d7a69 C++: Implement an 'Indirection' subtype for iterators. 2022-12-15 11:54:32 +00:00
Mathias Vorreiter Pedersen
ef110e77ff C++: Remove an unnecessary predicate from the 'Indirection' class. 2022-12-15 11:54:32 +00: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
Tony Torralba
6837af97bc Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2022-12-15 12:35:54 +01:00
Tony Torralba
11c03fb8c9 Add 'good' test cases 2022-12-15 12:35:47 +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
Paolo Tranquilli
3084eda28a Swift: add swiftmodule hash map testing to frontend_invocations 2022-12-15 10:33:47 +01:00
Paolo Tranquilli
e42ae09e1c Swift: fix interaction between bash wrapper and open redirection on macOS 2022-12-15 09:50:31 +01:00
turbo
5fd5ebc26e Create security-experimental suite helper and all language suite implementations 2022-12-14 23:35:32 +01:00
Paolo Tranquilli
793de3196b Revert "Swift: accept test changes"
This reverts commit 26ae8f177b.
2022-12-14 18:34:12 +01:00
Paolo Tranquilli
14fd89d482 Swift: generalize output redirection code 2022-12-14 18:26:48 +01:00
Paolo Tranquilli
45c0c7fe6c Merge branch 'main' into redsun82/swift-open-redirection 2022-12-14 18:26:16 +01:00
Jeroen Ketema
31b4dda7bd Merge pull request #11687 from jketema/tainted-path-use-use
C++: Make `cpp/path-injection` work with use-use dataflow
2022-12-14 18:06:05 +01:00
turbo
b35a1d4206 Adjust docs referring to experimental queries to include details on new tagging system 2022-12-14 17:16:38 +01:00
turbo
4ec401a3f6 Tag all security queries in supported languages' experimental directories with an experimental tag 2022-12-14 17:15:50 +01:00
Mathias Vorreiter Pedersen
22b04af0fa Merge pull request #11658 from MathiasVP/uncertain-writes
C++: Flow through uncertain writes
2022-12-14 15:26:28 +00:00
Jeroen Ketema
bb256514c0 Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-12-14 15:52:20 +01:00
Jeroen Ketema
3b78860d8d Merge pull request #11692 from jketema/itemization
C++: Fix itemization in QLDoc
2022-12-14 15:19:12 +01:00
Jeroen Ketema
c18cfa7a7a C++: Fix itemization in QLDoc 2022-12-14 13:46:07 +01:00
Jeroen Ketema
4075f693bd C++: Make cpp/path-injection work with use-use dataflow 2022-12-14 13:38:55 +01:00
Mathias Vorreiter Pedersen
973aad5c17 Merge pull request #11677 from jketema/argv-flow-source
C++: Recognize indirect `argv` accesses as flow sources for use-use dataflow
2022-12-14 12:36:18 +00:00
Paolo Tranquilli
de2e92d5e1 Swift: remove / delimiters from regex extracted patterns 2022-12-14 09:18:36 +01:00
Paolo Tranquilli
fb5b6eab19 Swift: extract RegexLiteralExpr 2022-12-14 09:12:07 +01:00
erik-krogh
d95a4a7baf add a second example of how to use module_eval without constructing a code-string 2022-12-13 19:33:45 +01:00
erik-krogh
ccf520a5cd Merge branch 'main' into unsafeCodeConstruction 2022-12-13 18:31:49 +01:00
Jeroen Ketema
628f92a9fb C++: Fix QL-for-QL warnings 2022-12-13 16:24:55 +01:00
Jeroen Ketema
3be0b3e6c7 C++: Recognize indirect argv accesses as flow sources for use-use dataflow
This fixes the test regression on `cpp/command-line-injection`.
2022-12-13 16:18:17 +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
ALJI Mohamed
54109b8ea7 Add source wget.download 2022-12-13 15:34:01 +01:00
Mathias Vorreiter Pedersen
69155cb691 Merge pull request #11664 from jketema/alloca-in-loop-fix
C++: Fix `cpp/alloca-in-loop` regressions with use-use dataflow
2022-12-13 11:59:38 +00:00
Tony Torralba
85b3092b16 Add security-severity and fix alert message 2022-12-13 12:01:01 +01:00
Jeroen Ketema
b10ed976cc Update cpp/ql/src/Likely Bugs/Memory Management/AllocaInLoop.ql
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2022-12-13 10:57:34 +01:00
Tony Torralba
d72d096c86 Add predicate injection query 2022-12-13 10:27:29 +01:00
ALJI Mohamed
2f68b54b27 A simple download_file() call from maybe boto3 2022-12-12 19:46:34 +01:00
Jeroen Ketema
18dea55071 C++: Fix cpp/alloca-in-loop regressions with use-use dataflow 2022-12-12 19:15:50 +01:00
Mathias Vorreiter Pedersen
a161dddbbf C++: Accept test changes. These happen because these remote flow sources specify that the remote source is both 'isReturnValue' and 'isReturnValueDeref'. 2022-12-12 13:39:09 +00:00
Mathias Vorreiter Pedersen
8722fb2cf5 C++: Accept test changes. 2022-12-12 10:54:40 +00:00
Mathias Vorreiter Pedersen
ad522651ec C++: Flow through uncertain writes. 2022-12-12 10:54:26 +00:00
Mathias Vorreiter Pedersen
2999243e34 C++: Add failing IR dataflow testcase. 2022-12-12 10:42:59 +00:00
Jeroen Ketema
b2091e8632 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-12-12 11:40:36 +01:00
Jeroen Ketema
cb1dacfef1 C++: Fix QL-for-QL warnings 2022-12-12 11:23:29 +01:00
Paolo Tranquilli
250ac686a2 Merge branch 'main' into redsun82/swift-open-redirection 2022-12-12 08:46:23 +01:00
ALJI Mohamed
b19452467d read by chunks as additional step 2022-12-10 21:59:14 +01:00
Mathias Vorreiter Pedersen
9e7b73ab4a Merge pull request #11645 from MathiasVP/more-caching 2022-12-10 18:04:48 +00:00
Mathias Vorreiter Pedersen
9f9ffef697 C++: Make the Node IPA type private. 2022-12-10 14:51:21 +00:00
ALJI Mohamed
eff132512c Copying the response data to the archive 2022-12-10 08:15:42 +01:00
Mathias Vorreiter Pedersen
de70cbfee9 C++: Change caching for dataflow. 2022-12-09 23:30:47 +00:00
Mathias Vorreiter Pedersen
2ad61df9df Merge pull request #11640 from MathiasVP/local-expr-step-should-step
C++: Prevent an `Expr` from stepping to itself in IR dataflow
2022-12-09 17:31:19 +00:00
ALJI Mohamed
545aab0e07 tarball path provided using CLI argument (source) 2022-12-09 15:54:43 +01:00
Mathias Vorreiter Pedersen
52bf39bcf9 C++: Use a 'fastTC' instead of '*' to improve performance. 2022-12-09 14:21:09 +00:00
Mathias Vorreiter Pedersen
a3285653ae C++: Prevent an expression to stepping to itself. 2022-12-09 14:20:27 +00:00
Paolo Tranquilli
a93e361aca Merge branch 'main' into redsun82/swift-open-redirection 2022-12-09 12:19:38 +01:00
Mathias Vorreiter Pedersen
b9c9f65f0f Merge pull request #11633 from MathiasVP/accept-consistency-failures
C++: Accept dataflow consistency changes
2022-12-09 11:03:03 +00:00
Mathias Vorreiter Pedersen
1169c1b898 C++: Accept test changes caused by the new consitency check. 2022-12-09 09:20:29 +00:00
Paolo Tranquilli
7162692656 Swift: exit directly on actions not requiring extraction 2022-12-09 10:00:01 +01:00
Paolo Tranquilli
4a41bb4061 Merge branch 'main' into redsun82/swift-open-redirection 2022-12-09 09:59:21 +01:00
Paolo Tranquilli
26ae8f177b Swift: accept test changes
Downgrading the emit object action to a type check one has some
unexpected side effects, that seem however acceptable:
* experimental false static assertions do not make compilation fail in
  type check mode
* the implicit module loading of `SwiftOnoneSupport` is not happening.
  That module contains some "pre-specializations", it does not seem
  really relevant for analysis
2022-12-08 17:13:00 +01:00
Robert Marsh
f235b991db Merge pull request #11374 from MathiasVP/indirect-outnodes-are-post-update-nodes
C++: Field flow through reference-returning functions
2022-12-08 10:46:19 -05:00
Paolo Tranquilli
d35c5e90ee Swift: remove fishhook 2022-12-08 16:10:44 +01:00
Paolo Tranquilli
bf1b32f210 Swift: rework file redirection
The hash map mechanism that was already in use for reading swiftmodule
files on macOS is now in use also on Linux. The output replacing
mechanism has been also reworked so that:
* frontend module emission modes have the remapping done directly in
  the internal frontend options instead of painstakingly modifying input
  flags (this requires a patch on the swift headers though)
* object emission mode is silenced to be just a type checking pass,
  thus producing no output files
* all other passes but some debugging and version related ones become
  noops

The open file read redirection uses a global weak pointer instance to
maximize robustness in the face of possibly multi-threaded calls to open
happening while `main` is exiting. Possibly overkill, but better safe
than sorry.
2022-12-08 16:10:44 +01:00
Paolo Tranquilli
944adfe727 Swift: allow modifying frontend outputs 2022-12-08 16:10:25 +01:00
Paolo Tranquilli
219ed64b74 Swift: reorganize bazel third party dependencies 2022-12-08 16:10:25 +01:00
Mathias Vorreiter Pedersen
7c6918de98 Merge pull request #11543 from MathiasVP/refactor-isdef-isuse
C++: Refactor `isDef` and `isUse` in preparation for iterator flow
2022-12-08 14:31:36 +00:00
Mathias Vorreiter Pedersen
f814ce7f10 Merge branch 'mathiasvp/replace-ast-with-ir-use-usedataflow' into refactor-isdef-isuse 2022-12-08 13:25:20 +00:00
Mathias Vorreiter Pedersen
0a1097d735 C++: Accept test changes to 'sources-and-sinks.cpp'. 2022-12-08 13:17:35 +00:00
Mathias Vorreiter Pedersen
4fd6ac5657 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-12-08 13:10:18 +00:00
Geoffrey White
24ce1c27bc Swift: Autoformat. 2022-12-08 13:09:37 +00:00
Mathias Vorreiter Pedersen
36d0903733 C++: Simplify 'getSourceVariable'. 2022-12-08 12:29:15 +00:00
Geoffrey White
07ea006cee Swift: Add support for CSV modelled sinks as well. 2022-12-08 11:36:55 +00:00
Geoffrey White
dba344451f Swift: Add UncontrolledFormatStringExtensions.qll. 2022-12-08 11:32:50 +00:00
ALJI Mohamed
9336f4f1a2 Considering the use of contextlib.closing() method 2022-12-08 12:26:59 +01:00
Rasmus Wriedt Larsen
a826c4f48b Merge branch 'main' into call-graph-code 2022-12-08 11:39:30 +01:00
Mathias Vorreiter Pedersen
9f85175ee1 C++: Fix blowup in 'stripPointer'. 2022-12-07 22:35:37 +00:00
Mathias Vorreiter Pedersen
5ae3228928 C++: Fix TODO. 2022-12-07 22:34:10 +00:00
Mathias Vorreiter Pedersen
68f0997d87 C++: Generalize loads and stores. 2022-12-07 22:34:10 +00:00
Mathias Vorreiter Pedersen
589f7bdbcc C++: Introduce BaseSourceVariableInstruction. 2022-12-07 22:34:03 +00:00
ALJI Mohamed
2801b8495a A fix of the tag name 2022-12-06 14:50:47 +01:00
ALJI Mohamed
4896e62117 Use of more generic terms 2022-12-06 14:44:52 +01:00
Sim4n6
58570b4d2c Update python/ql/src/experimental/Security/CWE-022bis/UnsafeUnpack.ql
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2022-12-06 14:40:48 +01:00
Sim4n6
9a60202de6 Update python/ql/src/experimental/Security/CWE-022bis/UnsafeUnpack.qhelp
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2022-12-06 14:40:35 +01:00
Sim4n6
c22c0b5029 Update python/ql/src/experimental/Security/CWE-022bis/UnsafeUnpack.qhelp
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
2022-12-06 14:39:16 +01:00
Mathias Vorreiter Pedersen
e71fbb1def Merge pull request #11541 from MathiasVP/add-node0
C++: Introduce a pre-SSA `DataFlow::Node` class
2022-12-06 13:28:39 +00:00
ALJI Mohamed
a5849eb9b0 Improved the additional taint step using InstanceSource 2022-12-06 14:00:08 +01:00
ALJI Mohamed
054c06be65 Update UnsafeUnpack.ql 2022-12-06 02:51:07 +01:00
ALJI Mohamed
68fd75ca34 UnpackUnsafe query and tests 2022-12-05 17:20:22 +01:00
Mathias Vorreiter Pedersen
c563ed3635 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-12-05 10:27:55 +00:00
Geoffrey White
cf3345ee8f Swift: Revert security-severity on CWE-321, for now. 2022-12-02 12:01:43 +00:00
Mathias Vorreiter Pedersen
43adfe8893 C++: Fix QLDoc. 2022-12-02 11:30:46 +00:00
Geoffrey White
85a0a42da9 Swift: try again to satisfy ql-for-ql. 2022-12-02 10:15:11 +00:00
Mathias Vorreiter Pedersen
145dea0e9b C++: Introduce a node class that exists before computing SSA. 2022-12-02 10:04:52 +00:00
Geoffrey White
f7ebd1312e Swift: Corrections. 2022-12-01 20:13:56 +00:00
Geoffrey White
157a7829ca Swift: correct the example. 2022-12-01 18:35:10 +00:00
Geoffrey White
ad05cc3cb1 Swift: Separate out a FormatString library as well. 2022-12-01 18:09:46 +00:00
Geoffrey White
43596869e7 Swift: Move query logic to a .qll. 2022-12-01 18:09:45 +00:00
Geoffrey White
87fa159384 Swift: Add security-severity, and correct one for another query that apparently wasn't right. 2022-12-01 18:09:39 +00:00
Geoffrey White
58e9a0436e Swift: Add metadata. 2022-12-01 18:09:33 +00:00
Geoffrey White
2b61f26a64 Swift: Add doc. 2022-12-01 16:32:34 +00:00
Geoffrey White
32c4728f83 Swift: Add tests. 2022-12-01 16:32:33 +00:00
Geoffrey White
a2210959b5 Swift: Uncontrolled format string query (initial version). 2022-12-01 16:32:33 +00: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
Jeroen Ketema
2ef13d1df7 Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-11-29 10:43:01 +01:00
erik-krogh
fd7442868f fix copy-pate error in UnsafeCodeConstructionQuery.qll 2022-11-28 13:45:24 +01:00
erik-krogh
f75b853ae4 add change-note 2022-11-25 11:08:14 +01:00
erik-krogh
53f24a5281 fix QL-for-QL warning 2022-11-25 10:32:06 +01:00
erik-krogh
0817238177 drive-by: same change in unsafe-shell-command-construction 2022-11-25 10:32:06 +01:00
erik-krogh
378cc1aed2 add support for string-like-literals 2022-11-25 10:32:06 +01:00
erik-krogh
80c92dc3e6 add support for array pushes 2022-11-25 10:32:05 +01:00
erik-krogh
3461404bbb add basic support for arrays 2022-11-25 10:31:35 +01:00
erik-krogh
0f2a48f461 fix QL-for-QL warnings 2022-11-25 10:26:24 +01:00
erik-krogh
2033dd2dcc remove parameters named "code" as source 2022-11-25 10:25:31 +01:00
erik-krogh
e7c6571f52 remove the "send(..)" and similar from unsafe-code-construction 2022-11-25 10:25:31 +01:00
erik-krogh
f1668801d3 add a rb/unsafe-code-construction query
rebase
2022-11-25 10:25:30 +01:00
erik-krogh
5f6cb1684b move the code-injection tests into a subfolder 2022-11-24 17:23:25 +01:00
Jeroen Ketema
4c94ff7deb Merge pull request #11413 from jketema/default-taint-upper-bound-check-fix
C++: Fix upper bound detection in default taint flow
2022-11-24 15:36:59 +01:00
Jeroen Ketema
223eeb6921 C++: Fix upper bound detection in default taint flow 2022-11-24 14:38:36 +01:00
Rasmus Wriedt Larsen
d151e21f15 Python: Move ControlFlowNode.toString() to AST cached stage
This means points-to is no longer evaluated for sql injection 🎉

Thanks @asgerf 💪
2022-11-24 10:14:39 +01:00
Mathias Vorreiter Pedersen
d9fab8afd9 Merge pull request #11405 from jketema/611-use-use-fix
C++: Fix CWE-611 XXE query to work with use-use dataflow - take 2
2022-11-24 09:10:28 +00:00
Jeroen Ketema
6fa5fdfeb2 C++: Fix CWE-611 XXE query to work with use-use dataflow - take 2
This commit ensures stack allocated parsers are also handled.
2022-11-23 23:59:04 +01:00
Mathias Vorreiter Pedersen
ac2174db13 Merge pull request #11400 from jketema/611-use-use-fix
C++: Fix CWE-611 XXE query to work with use-use dataflow
2022-11-23 17:08:52 +00:00
Jeroen Ketema
30bdd25228 C++: Fix CWE-611 XXE query to work with use-use dataflow 2022-11-23 16:14:28 +01:00
Jeroen Ketema
9e4cab74ec Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-11-23 11:07:03 +01:00
Mathias Vorreiter Pedersen
349c5cd800 Merge pull request #11254 from MathiasVP/fix-ssa-flow
C++: Fix spurious reference flow
2022-11-23 09:52:28 +00:00
Rasmus Wriedt Larsen
69b43f147a Python: Fix ql4ql alerts
The rest will be ignored.
2022-11-22 16:24:47 +01:00
Mathias Vorreiter Pedersen
623372238d C++: Better support for flow-through. 2022-11-22 13:54:44 +00:00
Rasmus Wriedt Larsen
00ec3a23ba Python: Accept fix from module-resolution PR 2022-11-22 14:46:33 +01:00
Rasmus Wriedt Larsen
ee2f7401e8 Python: Add generator-flow/dataflow-consistency.ql 2022-11-22 14:46:33 +01:00
Rasmus Wriedt Larsen
8de5cfef43 Python: Update dataflow-consistency.expected
After merging in main
2022-11-22 14:46:33 +01:00
Rasmus Wriedt Larsen
c0ad870949 Python: Exclude synthetic generator functions from DataFlowCallable 2022-11-22 14:46:33 +01:00
Rasmus Wriedt Larsen
d86f98d60b Python: Accept changes for enclosing-callable test 2022-11-22 14:46:33 +01:00
Rasmus Wriedt Larsen
aa382ac042 Python: Add test for strange generator taint flow
I did check, and this was not a problem with the old call-graph on main!

I'm absolutely baffled!
2022-11-22 14:46:33 +01:00
Rasmus Wriedt Larsen
36e8b8bfb9 Python: Add call-graph to cached dataflow stage
I didn't do any performance investigation on this, since it just seems
so much like the right approach.
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
fc0545561e Python: Introduce points-to cached stage
With points-to not being used for the call-graph any longer, it's time
to split them.
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
bd46b7deaa Python: Cache a few call-graph predicates
We DON'T want to recompute these ones for sure!
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
6646e98d20 Python: Fix results outside DB for StackTraceExposure 2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
972cfa5cf6 Python: Accept bad StackTraceExposure.expected
This is only Python 2 though
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
a301c93ebf Python: Fix results outside DB for CleartextLogging 2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
0a41d8d2c1 Python: Accept bad CleartextLogging.expected 2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
39ce50fadc Python: Fix problems with sinks in pathlib
This must mean that we did not have this flow with the old call-graph,
which means the new call-graph is doing a better job (yay).
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
edcaff26af Python: Add path-injection test using pathlib
Since it has the same problem of showing sinks inside the extracted
stdlib
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
9d29a0a044 Python: Accept changes to .expected from more pathlib flow
But we don't want to keep this, this commit is just to show why we need a fix :)
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
df4d09b3f9 Python: Don't rely on all DataFlowCall being resolved
I've been living dangerously with that assumption :|
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
478f5ffe96 Python: Limit self argument for PotentialLibraryCall
Using the object from `MethodCallNode` meant that in the code below,
`lib` from the import expression would be considered a self argument

(this showed up in dataflow-consistency query results, that were not
comitted... sorry)

```
from lib import func
func()
```
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
c4122275dc Python: Bring back support for flow-summaries
Also needed to fix up `TestUtil/UnresolvedCalls.qll` after a bad merge
conflict resolution. Since all calls are now DataFlowCall, and not JUST
the ones that can be resolved, we need to put in the restriction that
the callable can also be resolved.
2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
e5fdeae6fc Python: Add return (func_ref, ...) test 2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
fb0cc184d9 Python: Add test of multi func def based on runtime decision 2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
276a825cd0 Python: Allow same function name in call-graph tests 2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
8a56b48357 Python: Support super().__new__(cls) 2022-11-22 14:46:32 +01:00
Rasmus Wriedt Larsen
2b76964f7f Python: Expand tests of __new__ a bit more 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
a4e6433942 Python: add support for type(self)() 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
d43a48c265 Python: Add type(self)() tests 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
16483f7d40 Python: Add funky call-graph regression
I don't even know how to phrase this :D
2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
1e96ced3ab Python: Ignore functions with @property decorator for now 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
cba93ded77 Python: Add test for @property problem 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
b33f02f9dc Python: Fix self-passing problems
This also fixes performance problems for pandas-dev/pandas
2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
722c69edcc Python: Add test showing self type-tracking problems 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
5e5bab5a7c Python: Don't pass synthetic class instance to __new__ on class calls 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
9949824810 Python: Expand implicit classmethods 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
6fefd54533 Python: Consider __new__ a classmethod 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
f040ad8dac Python: Add test of __new__ handling 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
57c7dc8ea9 Python: Allow cls passing to classmethod 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
0cf13e9976 Python: Expand argument highlighting test 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
8e0bb62516 Python: Remove pragma[inline] from parameterMatch
It's gotten complex enough that it doesn't by definition seem necessary
to inline it. (in the range of ~2200 results for django and pandas)
2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
4416037dc6 Python: Ignore SPURIOUS call-graph edges in points-to vs. type-tracker results 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
6351defe0d Python: Add call-graph tests with isinstance 2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
5fc127cb2c Python: Make UnresolvedCalls.qll handle class calls without __init__
This commit used to make sense to have here in the ordering of commits,
but due to various rebases it no longer changes any test output..

it's still a good change though, so I'll keep it.
2022-11-22 14:46:31 +01:00
Rasmus Wriedt Larsen
98a849405f Python: Add support for late *args arguments 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
035d083515 Python: Support flow to *args param from positional arg 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
db921ac036 Python: Add basic support for *args 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
b6314dd19d Python: Add *args tests 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
c687df4ddc Python: Support flow to keyword param from **kwargs arg
When resolving merge conflict after flow-summaries was merged, this is
the original commit where I introduced ParameterNodeImpl, so this is the
commit where differences in that implementation was committed...

I removed TParameterNode, since I could not see we we gain anything from
having it.
2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
215a03d948 Python: Support flow to **kwargs param from keyword arg 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
503ad544e9 Python: Remove impossible flow for **kwargs params 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
eb600f07b7 Python: Use config for dataflow-consistency.ql
And ignore post-update nodes for `**kwargs` arguments
2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
5722d231bd Python: Add basic support for **kwargs
For now this is JUST from `**kwargs` in arguments, to `**kwargs`
parameters, and this part is based on field-flow

Note that dataflow-library complains about missing post update nodes for
these. This needs to be ignored, since post update nodes for `**kwargs`
arguments doesn't make sense, it's not possible to alter the dictionary
inside the method.
2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
9b2663034d Python: Change test .ql to also show bad argument flow 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
5a976cfb14 Python: Add more **kwargs arg passing tests 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
e7a337991a Python: Accept fix from extractor change
namely the variable access mentioned in
https://github.com/github/codeql/pull/10171
2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
7014be2047 Python: Reduce size of attrReadTracker
On pallets/flask, this reduced the number of tuples from
100866 results => 33060 results
2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
61410191e7 Python: Fix bug in argumentRoutingTest.ql
Since `DataFlowPrivate::DataFlowCall` only exists for calls resolved to
a function, we didn't have any results before... but allowing any call
helps things!
2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
a5c3e850f1 Python: Handle __call__ 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
b5e8bf7882 Python: Add note about trying DataFlowDispatchPointsTo for InlineCallGraphTest
Since I was very confused about no results for __call__, I tried to see
whether I had cheated by making the comparison too unfair. But it didn't
seem to be the case.
2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
f3ac81a013 Python: Expand tests for special method calls 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
f2e92bf963 Python: Port py/meta/call-graph 2022-11-22 14:46:30 +01:00
Rasmus Wriedt Larsen
7c1320ed4b Python: Adjust ExternalAPI qhelp files 2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
af9be6ad7e Python: Suppress more spurious alerts from ExternalAPI queries 2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
70cc986d5f Python: Suppress None.json.dumps from ExternalAPI queries 2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
0bdc808a7a Python: Add ExternalAPI test None.json.dumps 2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
7648462f98 Python: Fix ExternalAPIs queries
The output might end up being slightly more noisy since we don't
collapse positional and keyword arguments when the external target
function is included in the database, but this aligns with our long-term
goal of not doing that anymore, so I think it's fine.
2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
2e2cee06c3 Python: Adjust InsecureRandomnessCustomizations.qll 2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
ed70e118a9 Python: Make test/Filter query more robust
Since if you had tornado installed, we would follow imports and have
results from those files as well :|
2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
9c275c177a Python: Implement call-graph with type-trackers
This commit is a squash of 80 other commits. While developing, things
changed majorly 2-3 times, and it just wasn't feasible to go back and
write a really nice commit history.

My apologies for this HUGE commit.

Also, later on this is where I solved merge conflicts after flow-summaries
PR was merged.

For your amusement, I've included the original commit messages below.

Python: Add proper argument/parameter positions

Python: Handle normal function calls

Python: Reduce dataflow-consistency warnings

Previously there was a lot of failures for `uniqueEnclosingCallable` and
`argHasPostUpdate`

Removing the override of `getEnclosingCallable` in ParameterNode is
probably the most controversial... although from my point of view it's a
change for the better, since we're able to provide data-flow
ParameterNodes for more of the AST parameter nodes.

Python: Adjust `dataflow/calls` test

Python: Implement `isParameterOf`/`argumentOf`/`OutNode`

This makes the tests under `dataflow/basic` work as well 👍

(initially I had these as separate commits, but it felt like it was too much noise)

Python: Accept fix for `dataflow/consistency`

Python: Changes to `coverage/argumentRoutingTest.ql`

Notice we gain a few new resolved arguments.

We loose out on stuff due to:

1. not handling `*` or `**` in either arguments/parameters (yet)
2. not handling special calls (yet)

Python: Small fix for `TestUtil/RoutingTest.qll`

Since the helper predicates do not depend on this, moved outside class.

Python: Accept changes to `dataflow/coverage/NormalDataflowTest.ql`

Most of this is due to:

- not handling any kinds of methods yet
- not handling `*` or `**`

Python: Small investigation of `test_deep_callgraph`

Python: Accept changes to `coverage/localFlow.ql`

I don't fully understand why the .expected file changed.

Since we still have the desired flow, I'm not going to worry too much
about it.

with this commit, the `dataflow/coverage` tests passes 👍

Python: Minor doc update

Python: Add staticmethod/classmethod to `dataflow/calls`

Python: Handle method calls on class instances

without trying to deal with any class inheritance, or
staticmethod/classmethod at all.

Notice that with this change, we only have a DataFlowCall for the calls
that we can actually resolve. I'm not 100% sure if we need to add a
`UnresolvedCall` subclass of `DataFlowCall` for MaD in the future, but
it should be easy to do.

I'm still unsure about the value of `classesCallGraph`, but have just
accepted the changes.

Python: Handle direct method calls `C.foo(C, arg0)`

Python: Handle `@staticmethod`

Python: Handle class method calls... but the code is shit

WIP todo

Rewrite method calls to be better

also fixed a problem with `self` being an argument to the `x.staticmethod()` call :|

Python: Add subclass tests

Python: Split `class_advanced` test

Python: Rewrite call-graph tests to be inline expectation (1/2)

This adds inline expectations, next commit will remove old annotations
code... but I thought it would be easier to review like this.

Minor fixup

Python: Add simple subclass support

Python: more precise subclass lookup

Still not 100% precise.. but it's better

New ambiguous

Python: Add test for `self.m()` and `cls.m()` calls

Python: Handle `self.m()` and `cls.m()` calls

Python: Add tests for `__init__` and `__new__`

Python: Handle class calls

Python: Fix `self` argument passing for class calls

Now field-flow tests also pass 💪 (although the crosstalk
fieldflow test changes were due to this specific commit)

I also copied much of the setup for pre/post update nodes from Ruby,
specifically having the abstract `PostUpdateNodeImpl` in DataFlowPrivate
seemed like a nice change.

Same for the setup with `TNode` definition having the specification
directly in the body, instead of a `NeedsSyntheticPostUpdateNode` class.

Python: Add new crosstalk test WIP

Maybe needs a bit of refactoring, and to see how it all behaves with points-to

Python: Add `super()` call-graph tests

Python: Refactor MethodCall char-pred

In anticipation of supporting `super(MyClass, self).foo()`, where the
`self` argument doesn't come from an AttrNode, but from the second
argument to super.

Without `pragma[inline]` the optimizer found a terrible join-order --
this won't guarantee a good join-order for the future, but for now it
was just so simple and could let me move on with life.

Python: Add basic `super()` support

I debated a little (with myself) whether I should really do
`superTracker`, but I thought "why not" and just rolled with it. I did
not confirm whether it was actually needed anywhere, that is if anyone
does `ref = super; ref().foo()` -- although I certainly doubt it's very
wide-spread.

Python: InlineCallGraphTest: Allow non-unique callable name in different files

Python: more MRO tests

Python: Add MRO approximation for `super()`

Although it's not 100% accurate, it seems to be on level with the one in
points-to.

Python: Remove some spurious targets for direct calls

removal of TODO from refactoring

remove TODOs class call support

Python: Add contrived subclass call example

Python: Remove more spurious call targets

NOTE: I initially forgot to use
`findFunctionAccordingToMroKnownStartingClass` instead of
`findFunctionAccordingToMro` for __init__ and __new__, and since I did
make that mistake myself, I wanted to add something to the test to
highlight this fact, and make it viewable by PR reviewer... this will be
fixed in the next commit.

Python: Proper fix for spurious __init__ targets

Python: Add call-graph example of class decorator

Python: Support decorated classes in new call-graph

Python: Add call-graph tests for `type(obj).meth()`

Python: support `type(obj).meth()`

Python: Add test for callable defined in function

Python: Add test for callable as argument

Current'y we don't find these with type-tracking, which is super
mysterious. I did check that we have proper flow from the arguments to
the parameters.

Python: Found problem for callable as argument :| MAJOR WIP

WIP commit

IT WORKS AGAIN (but terrible performance)

remove pragma[inline]

remove oops

Fix performance problem

I tried to optimize it even further, but I didn't end up achieving anything :|

Fix call-graph comparison

add comparison version with easy lookup

incomplete missing call-graph tests

unhandled tests

trying to replicate missing call-edge due to missing imports ... but it's hard

also seems to be problems with the inline-expectation-value that I used, seems like it has both missing/unexpected results with same value

Python: Add import-problem test

Python: Add shadowing problem

some cleanup of rewrite fix

a little more cleanup

Add consistency queries to call-graph tests

Python: Add post-update nodes for `self` in implicit `super()` uses

But we do need to discuss whether this is the right approach :O

Fix for field-flow tests

This came from more precise argument passing

Fixed results in type-tracking

Comes from better argument passing with super() and handling of
functions with decorators

fix of inline call graph tests

Fixup call annotation test

Many minor cleanups/fixes

NewNormalCall -> NormalCall

Python: Major restructuring + qldoc writing

Python: Accept changes from pre/post update node .toString changes

Python: Reduce `super` complexity !! WIP !!

Python: Only pass self-reference if in same enclosing-callable

Python: Add call-graph test with nested class

This was inspired by the ImpliesDataflow test that showed missing flow
for q_super, but at least for the call-graph, I'm not able to reproduce
this missing result :|

Python: Restrict `super()` to function defined directly on class

Python: Accept fixes to ImpliesDataflow

Python: Expand field-flow crosstalk tests
2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
aa78a43407 Python: Enable type-tracking in call-graph test 2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
c85ccb2003 Python: Add call-graph compare meta-queries
Also changed the definition of a relevant call-target, so it's only what
is in the actual source code, which is what we want in the future! (so
what we're designing type-tracking to handle)

I also changed terminology from `callee` to `target`. It felt more
natural this way in my opinion.
2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
a98554b6ed Python: Accept tmp changes to flow summaries
After solving merge conflict
2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
716576b1d6 Python: Minimal type-tracking call-graph
That does absolutely nothing so far, but compiles
2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
6f5007b810 Python: Rename -> DataFlowDispatch
So diff can make more sense when introducing blank state for type-tracking based call-graph
2022-11-22 14:46:29 +01:00
Rasmus Wriedt Larsen
f327a3f62a Python: Remove strange-pointsto-interaction-investigation
These tests are not relevant anymore 💪
2022-11-22 14:46:29 +01:00
erik-krogh
2ad28ab4db add library inputs as a source to poly-redos 2022-11-22 13:05:34 +01:00
Jeroen Ketema
cfb8f282d1 Merge pull request #11369 from jketema/fun-typo
C++: Fix typo flagged up by QL-for-QL
2022-11-22 12:34:54 +01:00
Jeroen Ketema
6a68e7936f C++: Fix typo flagged up by QL-for-QL 2022-11-22 11:53:11 +01:00
Mathias Vorreiter Pedersen
98285393fe Merge pull request #11357 from MathiasVP/ignore-more-instructions
C++: Ignore more instructions in dataflow
2022-11-22 10:47:51 +00:00
Jeroen Ketema
4731f9222c Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-11-22 10:53:24 +01:00
Mathias Vorreiter Pedersen
a2ce51fdf7 C++: Accept test changes. 2022-11-22 09:50:45 +00:00
ihsinme
5ceab40841 Update DivideByZeroUsingReturnValue.ql 2022-11-22 10:11:18 +03:00
Mathias Vorreiter Pedersen
320b5ca01a C++: Ignore more instructions for dataflow. 2022-11-21 21:39:19 +00:00
Mathias Vorreiter Pedersen
fc3d6a1847 Merge branch 'replace-ast-with-ir-use-usedataflow' into fix-ssa-flow 2022-11-21 20:57:24 +00:00
Mathias Vorreiter Pedersen
7658df9ebd Merge pull request #11355 from MathiasVP/fewer-read-steps
C++: Reduce `readStep` fan-in
2022-11-21 20:35:34 +00:00
Mathias Vorreiter Pedersen
23d6eb67c3 C++: Fix comment. 2022-11-21 19:26:04 +00:00
Mathias Vorreiter Pedersen
d1274e2769 C++: Accept more test changes. 2022-11-21 18:33:14 +00:00
Mathias Vorreiter Pedersen
231e2a8df3 C++: Reduce fan-in for 'readStep'. 2022-11-21 17:07:29 +00:00
Mathias Vorreiter Pedersen
24542ec84a Merge branch 'main' into replace-ast-with-ir-use-usedataflow 2022-11-21 15:02:28 +00:00
Mathias Vorreiter Pedersen
d361053e10 Update cpp/ql/test/library-tests/dataflow/dataflow-tests/test.cpp
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2022-11-21 10:37:03 +00:00
Mathias Vorreiter Pedersen
1e00e15c7b Update cpp/ql/test/library-tests/dataflow/dataflow-tests/test.cpp
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2022-11-21 10:36:57 +00:00
Jeroen Ketema
ffbe1e065a Merge pull request #11314 from MathiasVP/fix-flow-out-of-const-member-functions
C++: Fix flow out of const member functions
2022-11-21 10:36:59 +01:00
Mathias Vorreiter Pedersen
7251f2fd3d Merge pull request #11330 from MathiasVP/fix-performance-of-upcast-array-pointer-arith 2022-11-21 09:09:00 +00:00
Mathias Vorreiter Pedersen
bfba95f9f7 C++: Fix performance of 'cpp/upcast-array-pointer-arithmetic'. 2022-11-18 14:50:18 +00:00
Mathias Vorreiter Pedersen
3c49447165 Merge pull request #11325 from MathiasVP/fix-join-in-cast-array-pointer-query
C++: Fix join order in `cpp/upcast-array-pointer-arithmetic`
2022-11-18 13:41:57 +00:00
Mathias Vorreiter Pedersen
1e14af6e64 C++: Fix join in 'cpp/upcast-array-pointer-arithmetic'. 2022-11-18 10:19:55 +00:00
Mathias Vorreiter Pedersen
b9bcff40c5 Merge branch 'replace-ast-with-ir-use-usedataflow' into fix-flow-out-of-const-member-functions 2022-11-17 10:41:12 +00:00
Mathias Vorreiter Pedersen
f1b85d7ebf Merge pull request #11315 from MathiasVP/accept-test-changes
C++: Accept test changes on the use-use flow branch
2022-11-17 10:40:33 +00:00
Mathias Vorreiter Pedersen
aa385a293d C++: Accept test changes. 2022-11-16 23:00:00 +00:00
Mathias Vorreiter Pedersen
b12955e220 C++: Fix flow out of const member functions. 2022-11-16 22:46:21 +00:00
Mathias Vorreiter Pedersen
29f4b26280 Merge branch 'replace-ast-with-ir-use-usedataflow' into fix-ssa-flow 2022-11-16 16:09:35 +00:00
Robert Marsh
70a9e49039 Merge pull request #11218 from MathiasVP/merge-some-indirect-and-instruction-nodes
C++: Remove some `IndirectOperand` and `IndirectInstruction` nodes
2022-11-16 10:09:40 -05:00
Mathias Vorreiter Pedersen
a9173727cf Merge branch 'replace-ast-with-ir-use-usedataflow' into fix-ssa-flow 2022-11-16 14:22:54 +00:00
Mathias Vorreiter Pedersen
4f2c2e6d5e C++: Accept test changes. 2022-11-16 14:05:54 +00:00
Mathias Vorreiter Pedersen
3b1b8cc720 C++: Fix SSA for array writes. 2022-11-16 14:05:54 +00:00
Mathias Vorreiter Pedersen
3e5c66e932 C++: Accept test changes. 2022-11-16 14:05:48 +00:00
Mathias Vorreiter Pedersen
235a06903e C++: Fix 'asParameter' to handle references. 2022-11-16 14:05:42 +00:00
Mathias Vorreiter Pedersen
2cebd5c51d C++: Accept test changes. 2022-11-16 13:56:24 +00:00
Mathias Vorreiter Pedersen
b8fab9ae79 C++: Respond to review comments. 2022-11-15 16:07:07 +00:00
Mathias Vorreiter Pedersen
1f43a1a924 Merge branch 'replace-ast-with-ir-use-usedataflow' into merge-some-indirect-and-instruction-nodes 2022-11-15 16:00:52 +00:00
Jeroen Ketema
a270f318e9 Merge pull request #11271 from jketema/ast-config-for-smart-ptrs
C++: Reintroduce the AST testing configuration for the smart pointer test too
2022-11-15 14:48:03 +01:00
Jeroen Ketema
2acda03518 C++: Reintroduce the AST testing configuration for the smart pointer test too 2022-11-15 13:49:03 +01:00
Mathias Vorreiter Pedersen
3d94286785 Merge pull request #11257 from MathiasVP/reduce-path-duplication
C++: Reduce path duplication
2022-11-15 11:01:11 +00:00
Mathias Vorreiter Pedersen
16565401c7 C++: Reduce path duplication. 2022-11-14 15:29:57 +00:00
Mathias Vorreiter Pedersen
7408931565 C++: Disable 'reference -> dereference' dataflow. 2022-11-14 14:05:31 +00:00
Jeroen Ketema
2b37ebd7ed Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-11-11 17:24:34 +01:00
Mathias Vorreiter Pedersen
0c7f57e0c4 C++: Accept test changes. 2022-11-11 11:09:38 +00:00
Mathias Vorreiter Pedersen
f534768715 C++: Fix join orders. 2022-11-11 11:09:38 +00:00
Mathias Vorreiter Pedersen
e0a6c16228 C++: Add missing QLDoc. 2022-11-11 11:09:38 +00:00
Mathias Vorreiter Pedersen
1a1f078684 C++: Also pick the operand as the 'ExprNode' when the expression is the qualifier of a call (and not just when it's an argument of a call). 2022-11-11 11:07:08 +00:00
Mathias Vorreiter Pedersen
c999704d1e C++: Now that we sometimes target an operand where we'd target an instruction before we should pick the operand as the 'sink' in the call-target resolution recursion. 2022-11-11 11:07:08 +00:00
Mathias Vorreiter Pedersen
a51ac7b4e7 C++: Remove some unnecessary IPA values from 'IndirectInstruction' and 'IndirectOperand' when the semantically identical value already exists in the IR. 2022-11-11 11:07:08 +00:00
ihsinme
0fb1dedbb2 Update DivideByZeroUsingReturnValue.ql 2022-11-11 11:38:48 +03:00
Jeroen Ketema
d8e96ef12a Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-11-10 12:09:43 +01:00
Jeroen Ketema
d0a00254ad Merge pull request #11184 from jketema/reintro-ast-annotation
C++: Re-introduce the `ast` annotations in the taint tests and related test infrastructure
2022-11-10 12:00:16 +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
Jeroen Ketema
0e33f4da6b C++: Re-introduce most of the ast annotation test infrastructure 2022-11-09 14:37:01 +01:00
Jeroen Ketema
bd301768ea C++: Re-introduce the ast annotations in the taint tests 2022-11-09 14:30:56 +01:00
Jeroen Ketema
0d27d63984 Merge remote-tracking branch 'upstream/main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-11-09 14:28:47 +01:00
Jeroen Ketema
4c308d998e Merge pull request #11179 from jketema/old-taint-fix
C++: Fix imports and module names in old dataflow/taint tracking library
2022-11-09 14:07:23 +01:00
Jeroen Ketema
af6a87e54d C++: Add missing QLDoc comments 2022-11-09 13:08:53 +01:00
Jeroen Ketema
d7804f5473 C++: Fix DataFlow2 import 2022-11-09 12:53:05 +01:00
Jeroen Ketema
ceb6706c73 C++: Fix formatting 2022-11-09 12:52:44 +01:00
Jeroen Ketema
4ab5066ed2 C++: Fix imports and module names in old dataflow/taint tracking library 2022-11-09 11:52:39 +01: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
Mathias Vorreiter Pedersen
f19b381e3e C++: Add use-use flow through global variables. 2022-11-08 17:10:37 +00:00
Jeroen Ketema
74f9b322a8 Merge branch 'main' into update-from-main 2022-11-08 17:01:02 +01: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
Mathias Vorreiter Pedersen
b305e15e11 Merge pull request #11147 from jketema/fix-dataflow-dataflow-tests
C++: Fix the use-use dataflow configuration in `dataflow/dataflow-tests`
2022-11-07 16:54:18 +00:00
Jeroen Ketema
89c5e3df1f C++: Fix the dataflow configuration in dataflow/dataflow-tests 2022-11-07 16:43:55 +01:00
Jeroen Ketema
5732c3bca0 Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-11-07 15:03:26 +01:00
Mathias Vorreiter Pedersen
bd549e527c Merge pull request #11128 from jketema/dont-use-old
C++: Do not use the old dataflow library in `additional-flow-to-parameter`
2022-11-04 15:59:52 +00:00
Jeroen Ketema
fc2013334f C++: Do not use the old dataflow library in additional-flow-to-parameter
Either both queries here should use the old library or neither should. The
expectation is that the expected results between the queries differ depending
on the additional flow step in one of them.
2022-11-04 15:46:36 +01:00
Mathias Vorreiter Pedersen
b95163cfe4 Merge pull request #11112 from MathiasVP/local-expr-flow
C++: Improve `Buffer.qll` performance
2022-11-04 10:32:27 +00:00
Mathias Vorreiter Pedersen
2617e6d7c6 C++: Inline a predicate that was only used once. 2022-11-04 09:35:34 +00:00
Mathias Vorreiter Pedersen
84af725ef1 Fix QLDoc. 2022-11-03 20:33:41 +00:00
Mathias Vorreiter Pedersen
b42e81c32d C++: Speed up 'Buffer.qll'. 2022-11-03 20:31:55 +00:00
Mathias Vorreiter Pedersen
ae01201c43 Merge pull request #11109 from jketema/fix-field-dataflow-tests
C++: Fix the IR dataflow configuration for the field flow tests
2022-11-03 19:19:30 +00:00
Mathias Vorreiter Pedersen
1d1161771a Merge pull request #11108 from jketema/indirect-arg-out-as-partial-def
C++: Turn `IndirectArgumentOutNode` into a `PartialDefinitionNode`
2022-11-03 17:57:12 +00:00
Jeroen Ketema
96425a1787 C++: Fix the IR dataflow configuration for the field flow tests 2022-11-03 18:06:37 +01:00
Jeroen Ketema
c87b516130 C++: Turn IndirectArgumentOutNode into a PartialDefinitionNode 2022-11-03 17:58:35 +01:00
Mathias Vorreiter Pedersen
f4915073c8 Merge pull request #11097 from MathiasVP/accept-test-change
C++: Accept test change
2022-11-03 11:24:57 +00:00
Mathias Vorreiter Pedersen
5d5c64a58b C++: Accept test change. 2022-11-03 10:27:07 +00:00
Mathias Vorreiter Pedersen
18802a2883 Merge pull request #11042 from MathiasVP/simplify-buffer.qll
C++: Simplify `buffer.qll` repair
2022-11-03 09:18:39 +00:00
Rasmus Lerchedahl Petersen
0a7cfad048 python: inline query tests for command injection
note how the test file is partially annotated
and those annotations can now be expressed

In this particular test file, absolute line numbers
might have been better than relative ones.
We might remove line numbers altogether,
but should check more querries to see how it looks.
2022-11-02 16:21:59 +01:00
Rasmus Lerchedahl Petersen
f486c44b00 python: library for inline query tests
similar to the consistency queires used in js
but based on the inline expectations framework
2022-11-02 16:18:36 +01:00
Mathias Vorreiter Pedersen
30f15473db C++: Use 'max' instead of 'unique.' 2022-11-01 16:55:45 +00:00
Jeroen Ketema
80ef3b39ff Merge branch 'main' into mathiasvp/replace-ast-with-ir-use-usedataflow 2022-10-31 18:26:34 +01:00
Mathias Vorreiter Pedersen
1b50168d08 C++: Add an initial pruning stage to prevent this
large TC in 'localFlowToExpr':
```
Evaluated relational algebra for predicate Buffer#61e3d199::localFlowStepToExpr#2#ff@0a49913i with tuple counts:
    4713946   ~0%    {2} r1 = SCAN DataFlowUtil#47741e1f::simpleLocalFlowStep#2#ff OUTPUT In.1, In.0

  40897385  ~46%    {2} r2 = JOIN boundedFastTC:Buffer#61e3d199::localFlowToExprStep#2#ff_10#higher_order_body:DataFlowUtil#47741e1f::simpleLocalFlowStep#2#ff_0#higher_order_body WITH DataFlowUtil#47741e1f::simpleLocalFlowStep#2#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1

  45611331  ~43%    {2} r3 = r1 UNION r2
    3376553  ~14%    {2} r4 = JOIN r3 WITH DataFlowUtil#47741e1f::ExprNode::getExpr#0#dispred#ff ON FIRST 1 OUTPUT Lhs.1, Rhs.1
                    return r4
```

After this commit the tuple counts looks like:
```
Evaluated relational algebra for predicate Buffer#61e3d199::localFlowStepToExpr#2#ff@8cc38x5k on iteration 2 running pipeline standard with tuple counts:
         51367   ~3%    {2} r1 = JOIN Buffer#61e3d199::getBufferSize0#1#f#prev_delta WITH DataFlowUtil#47741e1f::ExprNode::getExpr#0#dispred#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.0

        124933  ~18%    {2} r2 = JOIN r1 WITH #Buffer#61e3d199::localFlowToExprStep#2Plus#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1

        176300  ~17%    {2} r3 = r1 UNION r2
        184685  ~22%    {2} r4 = JOIN r3 WITH DataFlowUtil#47741e1f::simpleLocalFlowStep#2#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1
         56646  ~47%    {2} r5 = JOIN r4 WITH DataFlowUtil#47741e1f::ExprNode::getExpr#0#dispred#ff ON FIRST 1 OUTPUT Lhs.1, Rhs.1
         44635  ~16%    {2} r6 = r5 AND NOT Buffer#61e3d199::localFlowStepToExpr#2#ff#prev(Lhs.0, Lhs.1)
                        return r6
```
2022-10-30 14:20:15 +01:00
Mathias Vorreiter Pedersen
aa8214addf C++: Simplify 'Buffer.qll' by avoiding 'asIndirectExpr'. This removes the flow from 'x' to 'x++', which makes the whole library a lot simpler. 2022-10-30 12:58:53 +01:00
Mathias Vorreiter Pedersen
18d3801c92 Merge pull request #11033 from MathiasVP/exclude-void-calls
C++: Don't create `DataFlow::Node`s for `void`-typed instructions
2022-10-28 20:46:33 +02:00
Mathias Vorreiter Pedersen
f3be58e2ba C++: Accept more test changes. 2022-10-28 14:53:24 +02:00
Mathias Vorreiter Pedersen
20b188ff42 Merge pull request #11020 from rdmarsh2/rdmarsh2/repair-365-days-per-year
C++: repair Adding365DaysPerYear.ql
2022-10-28 14:35:05 +02:00
Mathias Vorreiter Pedersen
f6ff9c9c66 Update cpp/ql/src/Likely Bugs/Leap Year/LeapYear.qll
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2022-10-28 14:32:08 +02:00
Mathias Vorreiter Pedersen
9888de8acb Merge branch 'replace-ast-with-ir-use-usedataflow' into rdmarsh2/repair-365-days-per-year 2022-10-28 13:48:12 +02:00
Mathias Vorreiter Pedersen
42e8ec32d7 Merge pull request #11030 from MathiasVP/fix-ql-for-ql-errors
C++: Fix QL-for-QL in #10817
2022-10-28 13:39:50 +02:00
Mathias Vorreiter Pedersen
3261612a8c C++: Exclude void-typed instructions from 'DataFlow::Node'. These nodes can never contain any data so we don't need dataflow nodes for them. 2022-10-28 13:00:23 +02:00
Mathias Vorreiter Pedersen
2098489bb0 C++: Make QL-for-QL happy. 2022-10-28 12:35:52 +02:00
Jeroen Ketema
fafc0b5575 Merge pull request #10995 from MathiasVP/fix-as-expr
C++: Fix `asExpr` and `asIndirectExpr` in IR dataflow
2022-10-28 11:23:13 +02:00
Mathias Vorreiter Pedersen
172261495f Merge branch 'replace-ast-with-ir-use-usedataflow' into fix-as-expr 2022-10-28 10:32:31 +02:00
Robert Marsh
a334dc9b2b C++: repair Adding365DaysPerYear.ql 2022-10-27 15:06:48 -04:00
Robert Marsh
b7e42e805b Merge pull request #10994 from rdmarsh2/rdmarsh2/return-cstr-repair
C++: repair the ReturnCstr query
2022-10-27 14:25:22 -04:00
Robert Marsh
24cb36a1e2 C++: constrain indirect out node to constructors 2022-10-27 11:48:17 -04:00
Mathias Vorreiter Pedersen
20bd30060f C++: Fix 'StackPointerFlowsToUse' import. 2022-10-27 16:34:04 +02:00
Mathias Vorreiter Pedersen
b4c8a52117 C++: Accept more test changes. 2022-10-27 14:44:43 +02:00
Mathias Vorreiter Pedersen
2fc7e6159e C++: Accept test changes. 2022-10-27 12:12:34 +02:00
Mathias Vorreiter Pedersen
e2a0d62adf C++: Fix 'asIndirectExpr' when the underlying instruction is a 'VariableAddressInstruction'. 2022-10-27 12:12:34 +02:00
Robert Marsh
25a1148e04 C++: autoformat 2022-10-26 14:11:37 -04:00
Robert Marsh
8e2d34f0b6 C++: Accept dataflow test changes 2022-10-26 14:10:23 -04:00
Mathias Vorreiter Pedersen
e43422a090 Merge pull request #10975 from rdmarsh2/rdmarsh2/inconsistent-loop-direction-repair
C++: repair InconsistentLoopDirection
2022-10-26 18:17:53 +02:00
Mathias Vorreiter Pedersen
562f052eb0 C++: Accept test changes. 2022-10-26 17:06:38 +02:00
Mathias Vorreiter Pedersen
bc9cd63ef0 C++: Add an 'IndirectExprNode(Base)' class similar to 'ExprNode(Base)' to structure conversions between indirect daaflow nodes and expressions. 2022-10-26 17:05:01 +02:00
Robert Marsh
de89b4c69f C++: repair the ReturnCstr query 2022-10-26 11:02:23 -04:00
Robert Marsh
fc9f239a3b C++: make ConstructorCall df nodes the qualifier
This makes the dataflow node for a ConstructorCall be the outnode of the
qualifier, which is the resulting constructed object. This should make
`asExpr` on a ConstructorCall do the "right thing" rather than selecting
the void-typed CallInstruction.
2022-10-26 11:01:53 -04:00
Robert Marsh
adeb69e396 C++: autoformat 2022-10-26 10:49:06 -04:00
Mathias Vorreiter Pedersen
4bcba16748 Merge pull request #10833 from MathiasVP/repair-badly-bounded-write-2
C++: Prepare `Buffer.qll` for IR-based use-use dataflow
2022-10-26 16:38:33 +02:00
Mathias Vorreiter Pedersen
2ba94f7c89 Merge pull request #10838 from MathiasVP/repair-cleartext-transmission-2
C++: Prepare `cpp/cleartext-transmission` for IR-based use-use dataflow
2022-10-26 13:43:56 +02:00
Robert Marsh
8a125d1ae5 C++: repair InconsistentLoopDirection 2022-10-25 13:34:08 -04:00
Jeroen Ketema
3befa1cd96 Merge pull request #10965 from MathiasVP/fix-gettypeimpl-in-ir-dataflow
C++: Fix `getType` in IR dataflow
2022-10-25 15:02:45 +02:00
Mathias Vorreiter Pedersen
557b94cd83 Merge pull request #10966 from jketema/spelling-comments
C++: Spelling fixes and documentation clarification
2022-10-25 14:34:49 +02:00
Mathias Vorreiter Pedersen
1bd48f8d02 Merge branch 'replace-ast-with-ir-use-usedataflow' into repair-cleartext-transmission-2 2022-10-25 14:27:33 +02:00
Mathias Vorreiter Pedersen
c8f81bc6b8 Merge branch 'replace-ast-with-ir-use-usedataflow' into repair-badly-bounded-write-2 2022-10-25 14:24:38 +02:00
Mathias Vorreiter Pedersen
39b268194a C++: Accept test changes. 2022-10-25 14:10:51 +02:00
Jeroen Ketema
2ad3119fab C++: Clarify getType based on the QLDoc of Instruction::getResultType() 2022-10-25 13:34:49 +02:00
Jeroen Ketema
21acefb0b4 C++: Fix some spelling mistakes that were earlier fixed in "experimental" 2022-10-25 13:32:29 +02:00
Mathias Vorreiter Pedersen
23b07e5589 Merge branch 'replace-ast-with-ir-use-usedataflow' into fix-gettypeimpl-in-ir-dataflow 2022-10-25 12:52:33 +02:00
Mathias Vorreiter Pedersen
b85d3bc829 Merge branch 'main' into replace-ast-with-ir-use-usedataflow 2022-10-25 12:51:30 +02:00
Mathias Vorreiter Pedersen
a4d434ee05 C++: Fix 'getType' for indirect dataflow nodes in IR dataflow. 2022-10-25 12:24:11 +02:00
Mathias Vorreiter Pedersen
75de0f5c65 C++: Respond to review comments. 2022-10-24 15:13:50 +02:00
Mathias Vorreiter Pedersen
a7d6f4ff19 C++: Fix pointer/pointee conflation and handle flow through '++' when tracking indirect flow. 2022-10-24 14:23:43 +02:00
Raul Garcia
cd51b4991d Initial CHeckin - CNG basic case 2022-10-18 11:48:13 -07:00
Robert Marsh
500004dbe0 Merge pull request #10841 from MathiasVP/repair-command-line-injection-2
C++: Prepare `cpp/command-line-injection` for IR-based use-use dataflow
2022-10-17 13:42:32 -04:00
Robert Marsh
ccea372fd0 Merge pull request #10842 from MathiasVP/repair-non-constant-format-2
C++: Prepare `cpp/non-constant-format` for IR-based use-use dataflow
2022-10-17 13:39:56 -04:00
Robert Marsh
2f0c7729ff Merge pull request #10818 from github/mathiasvp/fix-join-in-ssa-internals
C++: Fix join in `SsaInternals`
2022-10-17 13:36:32 -04:00
Robert Marsh
5cd6dafe27 Merge pull request #10839 from MathiasVP/repair-flow-sources-2
C++: Prepare `FlowSources.qll` for IR-based use-use dataflow
2022-10-14 13:46:28 -04:00
Mathias Vorreiter Pedersen
e7b0536896 C++: Repair 'cpp/non-constant-format' in preparation for IR-based use-use dataflow. 2022-10-14 15:26:25 +02:00
Mathias Vorreiter Pedersen
b1f93b07c9 C++: Repair the 'cpp/command-line-injection' query in preparation for IR-based use-use dataflow. 2022-10-14 15:11:41 +02:00
Mathias Vorreiter Pedersen
00a25dbe45 C++: Accept test changes. 2022-10-14 15:01:31 +02:00
Mathias Vorreiter Pedersen
01a81a9c56 C++: Repair the 'FlowSources' library in preparation for IR-based use-use dataflow. 2022-10-14 14:52:29 +02:00
Mathias Vorreiter Pedersen
7ad781e91c C++: Repair the 'cpp/cleartext-transmission' query in preparation for IR-based use-use dataflow. 2022-10-14 14:37:59 +02:00
Mathias Vorreiter Pedersen
49f39d7602 C++: Accept test changes. 2022-10-14 12:35:46 +02:00
Mathias Vorreiter Pedersen
3ec60f11bb C++: Repair 'Buffer.qll'. 2022-10-14 12:25:17 +02:00
Mathias Vorreiter Pedersen
134cc6291c C++: Fix join in SsaInternals. 2022-10-14 10:29:56 +02:00
Mathias Vorreiter Pedersen
d62ae96763 C++: Fix ql-for-ql alerts. 2022-10-14 10:14:53 +02:00
Mathias Vorreiter Pedersen
1c51ad8d26 C++: Update 'identical-files'. 2022-10-14 10:14:53 +02:00
Mathias Vorreiter Pedersen
4c5953fce0 C++: Accept query-test changes. 2022-10-14 10:14:52 +02:00
Mathias Vorreiter Pedersen
373c849b18 C++: Accept library-test changes 2022-10-14 10:14:52 +02:00
Mathias Vorreiter Pedersen
41cbef81ec C++: Replace AST dataflow with IR dataflow. 2022-10-14 10:14:52 +02:00
ihsinme
3954da5938 Update DivideByZeroUsingReturnValue.ql 2022-10-11 13:11:45 +03:00
ihsinme
01b357e749 Update DivideByZeroUsingReturnValue.ql 2022-10-10 12:33:11 +03:00
ihsinme
392c948487 Update DivideByZeroUsingReturnValue.ql 2022-10-05 09:27:20 +03:00
ihsinme
50105c1f6d create new branchihsinme-patch-111 in fork 2022-09-15 06:35:42 +00: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
ihsinme
65c9a7b278 Update BufferAccessWithIncorrectLengthValue.ql 2022-06-26 13:49:44 +03:00
ihsinme
c1f0940b6a Update cpp/ql/src/experimental/Security/CWE/CWE-805/BufferAccessWithIncorrectLengthValue.ql
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2022-06-23 12:50:59 +03:00
ihsinme
5609d5200b Update cpp/ql/src/experimental/Security/CWE/CWE-805/BufferAccessWithIncorrectLengthValue.ql
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2022-05-30 20:41:39 +03:00
ihsinme
9499961a9c Update BufferAccessWithIncorrectLengthValue.ql 2022-05-30 12:43:28 +03:00
ihsinme
d489c12014 Update BufferAccessWithIncorrectLengthValue.ql 2022-05-30 12:26:26 +03:00
ihsinme
475e36e6fc Update BufferAccessWithIncorrectLengthValue.ql 2022-05-29 09:58:16 +03:00
ihsinme
df1ea5b679 Update BufferAccessWithIncorrectLengthValue.qhelp 2022-05-29 09:56:29 +03:00
ihsinme
5a9061e45b create new branchihsinme-patch-102 in fork 2022-05-21 14:19:34 +00:00
7573 changed files with 856130 additions and 401842 deletions

21
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,21 @@
# .git-blame-ignore-revs
# Auto-formatted Java
730eae952139209fe9fdf598541d608f4c0c0c84
# Auto-formatted C#
5ad7ed49dd3de03ec6dcfcb6848758a6a987e11c
# Auto-formatted C/C++
ef97e539ec1971494d4bba5cafe82e00bc8217ac
# Auto-formatted Python
21d5fa836b3a7d020ba45e8b8168b145a9772131
# Auto-formatted JavaScript
8d97fe9ed327a9546ff2eaf515cf0f5214deddd9
# Auto-formatted Ruby
a5d229903d2f12d45f2c2c38822f1d0e7504ae7f
# Auto-formatted Go
08c658e66bf867090033ea096e244a93d46c0aa7
# Auto-formatted Swift
711d7057f79fb7d72fc3b35e010bd018f9009169
# Auto-formatted shared ql packs
3640b6d3a8ce9edf8e1d3ed106fe8526cf255bc0
# Auto-formatted taint tracking files
159d8e978c51959b380838c080d891b66e763b19

View File

@@ -9,7 +9,7 @@ inputs:
outputs:
cache-dir:
description: "The directory where the cache was stored"
value: ${{ steps.fill-compilation-dir.outputs.compdir }}
value: ${{ steps.output-compilation-dir.outputs.compdir }}
runs:
using: composite
@@ -27,7 +27,9 @@ runs:
if: ${{ github.event_name == 'pull_request' }}
uses: actions/cache/restore@v3
with:
path: '**/.cache'
path: |
**/.cache
~/.codeql/compile-cache
key: codeql-compile-${{ inputs.key }}-pr-${{ github.sha }}
restore-keys: |
codeql-compile-${{ inputs.key }}-${{ github.base_ref }}-${{ env.merge_base }}
@@ -37,18 +39,111 @@ runs:
if: ${{ github.event_name != 'pull_request' }}
uses: actions/cache@v3
with:
path: '**/.cache'
path: |
**/.cache
~/.codeql/compile-cache
key: codeql-compile-${{ inputs.key }}-${{ github.ref_name }}-${{ github.sha }} # just fill on main
restore-keys: | # restore the latest cache if the exact cache is unavailable, to speed up compilation.
codeql-compile-${{ inputs.key }}-${{ github.ref_name }}-
codeql-compile-${{ inputs.key }}-main-
- name: Fill compilation cache directory
id: fill-compilation-dir
- name: Output-compilationdir
id: output-compilation-dir
shell: bash
run: |
# Move all the existing cache into another folder, so we only preserve the cache for the current queries.
node $GITHUB_WORKSPACE/.github/actions/cache-query-compilation/move-caches.js ${COMBINED_CACHE_DIR}
echo "compdir=${COMBINED_CACHE_DIR}" >> $GITHUB_OUTPUT
env:
COMBINED_CACHE_DIR: ${{ runner.temp }}/compilation-dir
- name: Fill compilation cache directory
id: fill-compilation-dir
uses: actions/github-script@v6
env:
COMBINED_CACHE_DIR: ${{ runner.temp }}/compilation-dir
with:
script: |
// # Move all the existing cache into another folder, so we only preserve the cache for the current queries.
// mkdir -p ${COMBINED_CACHE_DIR}
// rm -f **/.cache/{lock,size} # -f to avoid errors if the cache is empty.
// # copy the contents of the .cache folders into the combined cache folder.
// cp -r **/.cache/* ${COMBINED_CACHE_DIR}/ || : # ignore missing files
// # clean up the .cache folders
// rm -rf **/.cache/*
const fs = require("fs");
const path = require("path");
const os = require("os");
// the first argv is the cache folder to create.
const COMBINED_CACHE_DIR = process.env.COMBINED_CACHE_DIR;
function* walkCaches(dir) {
const files = fs.readdirSync(dir, { withFileTypes: true });
for (const file of files) {
if (file.isDirectory()) {
const filePath = path.join(dir, file.name);
yield* walkCaches(filePath);
if (file.name === ".cache") {
yield filePath;
}
}
}
}
async function copyDir(src, dest) {
for await (const file of await fs.promises.readdir(src, { withFileTypes: true })) {
const srcPath = path.join(src, file.name);
const destPath = path.join(dest, file.name);
if (file.isDirectory()) {
if (!fs.existsSync(destPath)) {
fs.mkdirSync(destPath);
}
await copyDir(srcPath, destPath);
} else {
await fs.promises.copyFile(srcPath, destPath);
}
}
}
async function main() {
const cacheDirs = [...walkCaches(".")];
for (const dir of cacheDirs) {
console.log(`Found .cache dir at ${dir}`);
}
const globalCacheDir = path.join(os.homedir(), ".codeql", "compile-cache");
if (fs.existsSync(globalCacheDir)) {
console.log("Found global home dir: " + globalCacheDir);
cacheDirs.push(globalCacheDir);
}
if (cacheDirs.length === 0) {
console.log("No cache dirs found");
return;
}
// mkdir -p ${COMBINED_CACHE_DIR}
fs.mkdirSync(COMBINED_CACHE_DIR, { recursive: true });
// rm -f **/.cache/{lock,size} # -f to avoid errors if the cache is empty.
await Promise.all(
cacheDirs.map((cacheDir) =>
(async function () {
await fs.promises.rm(path.join(cacheDir, "lock"), { force: true });
await fs.promises.rm(path.join(cacheDir, "size"), { force: true });
})()
)
);
// # copy the contents of the .cache folders into the combined cache folder.
// cp -r **/.cache/* ${COMBINED_CACHE_DIR}/ || : # ignore missing files
await Promise.all(
cacheDirs.map((cacheDir) => copyDir(cacheDir, COMBINED_CACHE_DIR))
);
// # clean up the .cache folders
// rm -rf **/.cache/*
await Promise.all(
cacheDirs.map((cacheDir) => fs.promises.rm(cacheDir, { recursive: true }))
);
}
main();

View File

@@ -1,75 +0,0 @@
// # Move all the existing cache into another folder, so we only preserve the cache for the current queries.
// mkdir -p ${COMBINED_CACHE_DIR}
// rm -f **/.cache/{lock,size} # -f to avoid errors if the cache is empty.
// # copy the contents of the .cache folders into the combined cache folder.
// cp -r **/.cache/* ${COMBINED_CACHE_DIR}/ || : # ignore missing files
// # clean up the .cache folders
// rm -rf **/.cache/*
const fs = require("fs");
const path = require("path");
// the first argv is the cache folder to create.
const COMBINED_CACHE_DIR = process.argv[2];
function* walkCaches(dir) {
const files = fs.readdirSync(dir, { withFileTypes: true });
for (const file of files) {
if (file.isDirectory()) {
const filePath = path.join(dir, file.name);
yield* walkCaches(filePath);
if (file.name === ".cache") {
yield filePath;
}
}
}
}
async function copyDir(src, dest) {
for await (const file of await fs.promises.readdir(src, { withFileTypes: true })) {
const srcPath = path.join(src, file.name);
const destPath = path.join(dest, file.name);
if (file.isDirectory()) {
if (!fs.existsSync(destPath)) {
fs.mkdirSync(destPath);
}
await copyDir(srcPath, destPath);
} else {
await fs.promises.copyFile(srcPath, destPath);
}
}
}
async function main() {
const cacheDirs = [...walkCaches(".")];
for (const dir of cacheDirs) {
console.log(`Found .cache dir at ${dir}`);
}
// mkdir -p ${COMBINED_CACHE_DIR}
fs.mkdirSync(COMBINED_CACHE_DIR, { recursive: true });
// rm -f **/.cache/{lock,size} # -f to avoid errors if the cache is empty.
await Promise.all(
cacheDirs.map((cacheDir) =>
(async function () {
await fs.promises.rm(path.join(cacheDir, "lock"), { force: true });
await fs.promises.rm(path.join(cacheDir, "size"), { force: true });
})()
)
);
// # copy the contents of the .cache folders into the combined cache folder.
// cp -r **/.cache/* ${COMBINED_CACHE_DIR}/ || : # ignore missing files
await Promise.all(
cacheDirs.map((cacheDir) => copyDir(cacheDir, COMBINED_CACHE_DIR))
);
// # clean up the .cache folders
// rm -rf **/.cache/*
await Promise.all(
cacheDirs.map((cacheDir) => fs.promises.rm(cacheDir, { recursive: true }))
);
}
main();

View File

@@ -19,4 +19,6 @@ runs:
gh extension install github/gh-codeql
gh codeql set-channel "$CHANNEL"
gh codeql version
printf "CODEQL_FETCHED_CODEQL_PATH=" >> "${GITHUB_ENV}"
gh codeql version --format=json | jq -r .unpackedLocation >> "${GITHUB_ENV}"
gh codeql version --format=json | jq -r .unpackedLocation >> "${GITHUB_PATH}"

View File

@@ -1,26 +0,0 @@
name: Find Latest CodeQL Bundle
description: Finds the URL of the latest released version of the CodeQL bundle.
outputs:
url:
description: The download URL of the latest CodeQL bundle release
value: ${{ steps.find-latest.outputs.url }}
runs:
using: composite
steps:
- name: Find Latest Release
id: find-latest
shell: pwsh
run: |
$Latest = gh release list --repo github/codeql-action --exclude-drafts --limit 1000 |
ForEach-Object { $C = $_ -split "`t"; return @{ type = $C[1]; tag = $C[2]; } } |
Where-Object { $_.type -eq 'Latest' }
$Tag = $Latest.tag
if ($Tag -eq '') {
throw 'Failed to find latest bundle release.'
}
Write-Output "Latest bundle tag is '${Tag}'."
"url=https://github.com/github/codeql-action/releases/download/${Tag}/codeql-bundle-linux64.tar.gz" >> $env:GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ github.token }}

32
.github/actions/os-version/action.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: OS Version
description: Get OS version.
outputs:
version:
description: "OS version"
value: ${{ steps.version.outputs.version }}
runs:
using: composite
steps:
- if: runner.os == 'Linux'
shell: bash
run: |
. /etc/os-release
echo "VERSION=${NAME} ${VERSION}" >> $GITHUB_ENV
- if: runner.os == 'Windows'
shell: powershell
run: |
$objects = systeminfo.exe /FO CSV | ConvertFrom-Csv
"VERSION=$($objects.'OS Name') $($objects.'OS Version')" >> $env:GITHUB_ENV
- if: runner.os == 'macOS'
shell: bash
run: |
echo "VERSION=$(sw_vers -productName) $(sw_vers -productVersion)" >> $GITHUB_ENV
- name: Emit OS version
id: version
shell: bash
run: |
echo "$VERSION"
echo "version=${VERSION}" >> $GITHUB_OUTPUT

View File

@@ -1,19 +1,12 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "ruby/node-types"
directory: "ruby"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "ruby/generator"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "ruby/extractor"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "ruby/autobuilder"
directory: "ql"
schedule:
interval: "daily"

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/**"
@@ -26,3 +27,9 @@ jobs:
run: |
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' |
grep true -c
- name: Fail if the change note filename doesn't match the expected format. The file name must be of the form 'YYYY-MM-DD.md' or 'YYYY-MM-DD-{title}.md', where '{title}' is arbitrary text.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))] | all(test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$"))' |
grep true -c

View File

@@ -26,9 +26,8 @@ jobs:
shell: bash
run: |
EXIT_CODE=0
# TODO: remove the swift exception from the regex when we fix generated QLdoc
# TODO: remove the shared exception from the regex when coverage of qlpacks without dbschemes is supported
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(swift|shared))[a-z]*/ql/lib' || true; } | sort -u)"
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(shared))[a-z]*/ql/lib' || true; } | sort -u)"
for pack_dir in ${changed_lib_packs}; do
lang="${pack_dir%/ql/lib}"
codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-current.txt" --dir="${pack_dir}"

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.'

View File

@@ -28,9 +28,9 @@ jobs:
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.202
dotnet-version: 7.0.102
- name: Checkout repository
uses: actions/checkout@v3

View File

@@ -24,14 +24,14 @@ jobs:
with:
key: all-queries
- name: check formatting
run: find */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 codeql query format --check-only
run: find */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
- name: compile queries - check-only
# run with --check-only if running in a PR (github.sha != main)
if : ${{ github.event_name == 'pull_request' }}
shell: bash
run: codeql query compile -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
- name: compile queries - full
# do full compile if running on main - this populates the cache
if : ${{ github.event_name != 'pull_request' }}
shell: bash
run: codeql query compile -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"

View File

@@ -77,10 +77,10 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.202
dotnet-version: 7.0.102
- name: Extractor unit tests
run: |
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/csharp/extractor/Semmle.Util.Tests"
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/csharp/extractor/Semmle.Extraction.Tests"
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests"
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/cpp/autobuilder/Semmle.Autobuild.Cpp.Tests"
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/csharp/extractor/Semmle.Util.Tests"
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/csharp/extractor/Semmle.Extraction.Tests"
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests"
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/cpp/autobuilder/Semmle.Autobuild.Cpp.Tests"

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

@@ -12,10 +12,10 @@ jobs:
name: Test MacOS
runs-on: macos-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.0
id: go
- name: Check out code
@@ -47,10 +47,10 @@ jobs:
name: Test Windows
runs-on: windows-latest-xl
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.0
id: go
- name: Check out code

View File

@@ -20,10 +20,10 @@ jobs:
name: Test Linux (Ubuntu)
runs-on: ubuntu-latest-xl
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.0
id: go
- name: Check out code

View File

@@ -11,7 +11,7 @@ on:
branches:
- main
paths:
- "java/ql/src/utils/model-generator/**/*.*"
- "java/ql/src/utils/modelgenerator/**/*.*"
- ".github/workflows/mad_modelDiff.yml"
permissions:
@@ -40,12 +40,12 @@ jobs:
- name: Download database
env:
SLUG: ${{ matrix.slug }}
GH_TOKEN: ${{ github.token }}
run: |
set -x
mkdir lib-dbs
SHORTNAME=${SLUG//[^a-zA-Z0-9_]/}
projectId=`curl -s https://lgtm.com/api/v1.0/projects/g/${SLUG} | jq .id`
curl -L "https://lgtm.com/api/v1.0/snapshots/$projectId/java" -o "$SHORTNAME.zip"
gh api -H "Accept: application/zip" "/repos/${SLUG}/code-scanning/codeql/databases/java" > "$SHORTNAME.zip"
unzip -q -d "${SHORTNAME}-db" "${SHORTNAME}.zip"
mkdir "lib-dbs/$SHORTNAME/"
mv "${SHORTNAME}-db/"$(ls -1 "${SHORTNAME}"-db)/* "lib-dbs/${SHORTNAME}/"
@@ -61,7 +61,7 @@ jobs:
DATABASE=$2
cd codeql-$QL_VARIANT
SHORTNAME=`basename $DATABASE`
python java/ql/src/utils/model-generator/GenerateFlowModel.py --with-summaries --with-sinks $DATABASE ${SHORTNAME}.temp.model.yml
python java/ql/src/utils/modelgenerator/GenerateFlowModel.py --with-summaries --with-sinks $DATABASE ${SHORTNAME}.temp.model.yml
mv java/ql/lib/ext/generated/${SHORTNAME}.temp.model.yml $MODELS/${SHORTNAME}Generated_${QL_VARIANT}.model.yml
cd ..
}
@@ -100,4 +100,6 @@ jobs:
with:
name: diffs
path: tmp-models/*.html
# An html file is only produced if the generated models differ.
if-no-files-found: ignore
retention-days: 20

View File

@@ -50,7 +50,7 @@ jobs:
SLUG: ${{ matrix.slug }}
run: |
SHORTNAME=${SLUG//[^a-zA-Z0-9_]/}
java/ql/src/utils/model-generator/RegenerateModels.py "${SLUG}" dbs/${SHORTNAME}
java/ql/src/utils/modelgenerator/RegenerateModels.py "${SLUG}" dbs/${SHORTNAME}
- name: Stage changes
run: |
find java -name "*.model.yml" -print0 | xargs -0 git add

View File

@@ -5,13 +5,6 @@ on:
branches: [main]
pull_request:
branches: [main]
paths:
- "ql/**"
- "**.qll"
- "**.ql"
- "**.dbscheme"
- "**/qlpack.yml"
- ".github/workflows/ql-for-ql-build.yml"
env:
CARGO_TERM_COLOR: always
@@ -22,142 +15,60 @@ jobs:
steps:
### Build the queries ###
- uses: actions/checkout@v3
- name: Find latest bundle
id: find-latest-bundle
uses: ./.github/actions/find-latest-bundle
with:
fetch-depth: 0
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@77a8d2d10c0b403a8b4aadbd223dc489ecd22683
uses: github/codeql-action/init@v2
with:
languages: javascript # does not matter
tools: ${{ steps.find-latest-bundle.outputs.url }}
- name: Get CodeQL version
id: get-codeql-version
run: |
echo "version=$("${CODEQL}" --version | head -n 1 | rev | cut -d " " -f 1 | rev)" >> $GITHUB_OUTPUT
shell: bash
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Cache entire pack
id: cache-pack
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/pack
key: ${{ runner.os }}-pack-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}--${{ hashFiles('.github/workflows/ql-for-ql-build.yml') }}
- name: Cache queries
if: steps.cache-pack.outputs.cache-hit != 'true'
id: cache-queries
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/queries
key: queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}--${{ hashFiles('.github/workflows/ql-for-ql-build.yml') }}
- name: Build query pack
if: steps.cache-queries.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
run: |
cd ql/ql/src
"${CODEQL}" pack create -j 16
mv .codeql/pack/codeql/ql/0.0.0 ${{ runner.temp }}/queries
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Move cache queries to pack
if: steps.cache-pack.outputs.cache-hit != 'true'
run: |
cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- uses: ./.github/actions/os-version
id: os_version
### Build the extractor ###
- name: Cache entire extractor
if: steps.cache-pack.outputs.cache-hit != 'true'
id: cache-extractor
uses: actions/cache@v3
with:
path: |
ql/target/release/ql-autobuilder
ql/target/release/ql-autobuilder.exe
ql/target/release/ql-extractor
ql/target/release/ql-extractor.exe
key: ${{ runner.os }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
ql/extractor-pack/
ql/target/release/buramu
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
- name: Cache cargo
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
if: steps.cache-extractor.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
ql/target
key: ${{ runner.os }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
- name: Check formatting
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
run: cd ql; cargo fmt --all -- --check
- name: Build
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
run: cd ql; cargo build --verbose
- name: Run tests
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
run: cd ql; cargo test --verbose
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
- name: Release build
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
run: cd ql; cargo build --release
- name: Generate dbscheme
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
run: ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
### Package the queries and extractor ###
- name: Package pack
if: steps.cache-pack.outputs.cache-hit != 'true'
run: |
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats ${PACK}/
mkdir -p ${PACK}/tools/linux64
cp ql/target/release/ql-autobuilder ${PACK}/tools/linux64/autobuilder
cp ql/target/release/ql-extractor ${PACK}/tools/linux64/extractor
chmod +x ${PACK}/tools/linux64/autobuilder
chmod +x ${PACK}/tools/linux64/extractor
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cd ql; ./scripts/create-extractor-pack.sh
env:
PACK: ${{ runner.temp }}/pack
### Run the analysis ###
- name: Hack codeql-action options
GH_TOKEN: ${{ github.token }}
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: run-ql-for-ql
- name: Make database and analyze
run: |
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .resolve.languages=["--search-path", $pack] | .database.init=["--search-path", $pack]')
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
env:
PACK: ${{ runner.temp }}/pack
- name: Create CodeQL config file
run: |
echo "paths-ignore:" >> ${CONF}
echo " - ql/ql/test" >> ${CONF}
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
echo "disable-default-queries: true" >> ${CONF}
echo "queries:" >> ${CONF}
echo " - uses: ./ql/ql/src/codeql-suites/ql-code-scanning.qls" >> ${CONF}
echo "Config file: "
cat ${CONF}
env:
CONF: ./ql-for-ql-config.yml
- name: Initialize CodeQL
uses: github/codeql-action/init@77a8d2d10c0b403a8b4aadbd223dc489ecd22683
./ql/target/release/buramu | tee deprecated.blame # Add a blame file for the extractor to parse.
${CODEQL} database create -l=ql --search-path ql/extractor-pack ${DB}
${CODEQL} database analyze -j0 --format=sarif-latest --output=ql-for-ql.sarif ${DB} ql/ql/src/codeql-suites/ql-code-scanning.qls --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
DB: ${{ runner.temp }}/DB
LGTM_INDEX_FILTERS: |
exclude:ql/ql/test
exclude:*/ql/lib/upgrades/
exclude:java/ql/integration-tests
- name: Upload sarif to code-scanning
uses: github/codeql-action/upload-sarif@v2
with:
languages: ql
db-location: ${{ runner.temp }}/db
config-file: ./ql-for-ql-config.yml
tools: ${{ steps.find-latest-bundle.outputs.url }}
- name: Move pack cache
run: |
cp -r ${PACK}/.cache ql/ql/src/.cache
env:
PACK: ${{ runner.temp }}/pack
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@77a8d2d10c0b403a8b4aadbd223dc489ecd22683
with:
category: "ql-for-ql"
- name: Copy sarif file to CWD
run: cp ../results/ql.sarif ./ql-for-ql.sarif
- name: Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
run: |
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
sarif_file: ql-for-ql.sarif
category: ql-for-ql
- name: Sarif as artifact
uses: actions/upload-artifact@v3
with:
@@ -172,4 +83,4 @@ jobs:
with:
name: ql-for-ql-langs
path: split-sarif
retention-days: 1
retention-days: 1

View File

@@ -25,16 +25,18 @@ jobs:
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@77a8d2d10c0b403a8b4aadbd223dc489ecd22683
uses: github/codeql-action/init@v2
with:
languages: javascript # does not matter
- uses: ./.github/actions/os-version
id: os_version
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
ql/target
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
- name: Build Extractor
run: cd ql; env "PATH=$PATH:`dirname ${CODEQL}`" ./scripts/create-extractor-pack.sh
env:

View File

@@ -6,11 +6,13 @@ on:
paths:
- "ql/**"
- codeql-workspace.yml
- .github/workflows/ql-for-ql-tests.yml
pull_request:
branches: [main]
paths:
- "ql/**"
- codeql-workspace.yml
- .github/workflows/ql-for-ql-tests.yml
env:
CARGO_TERM_COLOR: always
@@ -22,28 +24,86 @@ jobs:
- uses: actions/checkout@v3
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@77a8d2d10c0b403a8b4aadbd223dc489ecd22683
uses: github/codeql-action/init@v2
with:
languages: javascript # does not matter
- uses: ./.github/actions/os-version
id: os_version
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
ql/target
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('ql/rust-toolchain.toml', 'ql/**/Cargo.lock') }}
- name: Check formatting
run: cd ql; cargo fmt --all -- --check
- name: Build extractor
run: |
cd ql;
codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }});
env "PATH=$PATH:$codeqlpath" ./scripts/create-extractor-pack.sh
- name: Cache compilation cache
id: query-cache
uses: ./.github/actions/cache-query-compilation
with:
key: ql-for-ql-tests
- name: Run QL tests
run: |
"${CODEQL}" test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}/ql/extractor-pack" --consistency-queries ql/ql/consistency-queries ql/ql/test
"${CODEQL}" test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}/ql/extractor-pack" --consistency-queries ql/ql/consistency-queries --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" ql/ql/test
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Check QL formatting
other-os:
strategy:
matrix:
os: [macos-latest, windows-latest]
needs: [qltest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install GNU tar
if: runner.os == 'macOS'
run: |
find ql/ql/src "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 "${CODEQL}" query format --check-only
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@v2
with:
languages: javascript # does not matter
- uses: ./.github/actions/os-version
id: os_version
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
ql/target
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('ql/rust-toolchain.toml', 'ql/**/Cargo.lock') }}
- name: Build extractor
if: runner.os != 'Windows'
run: |
cd ql;
codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }});
env "PATH=$PATH:$codeqlpath" ./scripts/create-extractor-pack.sh
- name: Build extractor (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd ql;
$Env:PATH += ";$(dirname ${{ steps.find-codeql.outputs.codeql-path }})"
pwsh ./scripts/create-extractor-pack.ps1
- name: Run a single QL tests - Unix
if: runner.os != 'Windows'
run: |
"${CODEQL}" test run --check-databases --search-path "${{ github.workspace }}/ql/extractor-pack" ql/ql/test/queries/style/DeadCode/DeadCode.qlref
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Run a single QL tests - Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$Env:PATH += ";$(dirname ${{ steps.find-codeql.outputs.codeql-path }})"
codeql test run --check-databases --search-path "${{ github.workspace }}/ql/extractor-pack" ql/ql/test/queries/style/DeadCode/DeadCode.qlref

View File

@@ -48,17 +48,22 @@ 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
uses: actions/cache@v3
id: cache-extractor
with:
path: |
ruby/target/release/ruby-autobuilder
ruby/target/release/ruby-autobuilder.exe
ruby/target/release/ruby-extractor
ruby/target/release/ruby-extractor.exe
ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
key: ${{ runner.os }}-ruby-extractor-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/**/Cargo.lock') }}--${{ hashFiles('ruby/**/*.rs') }}
ruby/extractor/target/release/autobuilder
ruby/extractor/target/release/autobuilder.exe
ruby/extractor/target/release/extractor
ruby/extractor/target/release/extractor.exe
ruby/extractor/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-extractor-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/extractor/Cargo.lock') }}--${{ hashFiles('ruby/extractor/**/*.rs') }}
- uses: actions/cache@v3
if: steps.cache-extractor.outputs.cache-hit != 'true'
with:
@@ -66,22 +71,32 @@ jobs:
~/.cargo/registry
~/.cargo/git
ruby/target
key: ${{ runner.os }}-ruby-rust-cargo-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/**/Cargo.lock') }}
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-rust-cargo-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/extractor/**/Cargo.lock') }}
- name: Check formatting
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cargo fmt --all -- --check
run: cd extractor && cargo fmt --all -- --check
- name: Build
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cargo build --verbose
run: cd extractor && cargo build --verbose
- name: Run tests
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cargo test --verbose
- name: Release build
if: steps.cache-extractor.outputs.cache-hit != 'true'
run: cargo build --release
run: cd extractor && cargo test --verbose
# 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'}}
run: target/release/ruby-generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
run: extractor/target/release/generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
- uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
@@ -96,10 +111,10 @@ jobs:
with:
name: extractor-${{ matrix.os }}
path: |
ruby/target/release/ruby-autobuilder
ruby/target/release/ruby-autobuilder.exe
ruby/target/release/ruby-extractor
ruby/target/release/ruby-extractor.exe
ruby/extractor/target/release/autobuilder
ruby/extractor/target/release/autobuilder.exe
ruby/extractor/target/release/extractor
ruby/extractor/target/release/extractor.exe
retention-days: 1
compile-queries:
runs-on: ubuntu-latest-xl
@@ -114,21 +129,22 @@ jobs:
key: ruby-build
- name: Build Query Pack
run: |
rm -rf target/packs
codeql pack create ../misc/suite-helpers --output target/packs
codeql pack create ../shared/regex --output target/packs
codeql pack create ../shared/ssa --output target/packs
codeql pack create ../shared/tutorial --output target/packs
codeql pack create ql/lib --output target/packs
codeql pack create -j0 ql/src --output target/packs --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
PACK_FOLDER=$(readlink -f target/packs/codeql/ruby-queries/*)
PACKS=${{ runner.temp }}/query-packs
rm -rf $PACKS
codeql pack create ../misc/suite-helpers --output "$PACKS"
codeql pack create ../shared/regex --output "$PACKS"
codeql pack create ../shared/ssa --output "$PACKS"
codeql pack create ../shared/tutorial --output "$PACKS"
codeql pack create ql/lib --output "$PACKS"
codeql pack create -j0 ql/src --output "$PACKS" --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
PACK_FOLDER=$(readlink -f "$PACKS"/codeql/ruby-queries/*)
codeql generate query-help --format=sarifv2.1.0 --output="${PACK_FOLDER}/rules.sarif" ql/src
(cd ql/src; find queries \( -name '*.qhelp' -o -name '*.rb' -o -name '*.erb' \) -exec bash -c 'mkdir -p "'"${PACK_FOLDER}"'/$(dirname "{}")"' \; -exec cp "{}" "${PACK_FOLDER}/{}" \;)
- uses: actions/upload-artifact@v3
with:
name: codeql-ruby-queries
path: |
ruby/target/packs/*
${{ runner.temp }}/query-packs/*
retention-days: 1
package:
@@ -156,12 +172,12 @@ jobs:
mkdir -p ruby
cp -r codeql-extractor.yml tools ql/lib/ruby.dbscheme.stats ruby/
mkdir -p ruby/tools/{linux64,osx64,win64}
cp linux64/ruby-autobuilder ruby/tools/linux64/autobuilder
cp osx64/ruby-autobuilder ruby/tools/osx64/autobuilder
cp win64/ruby-autobuilder.exe ruby/tools/win64/autobuilder.exe
cp linux64/ruby-extractor ruby/tools/linux64/extractor
cp osx64/ruby-extractor ruby/tools/osx64/extractor
cp win64/ruby-extractor.exe ruby/tools/win64/extractor.exe
cp linux64/autobuilder ruby/tools/linux64/autobuilder
cp osx64/autobuilder ruby/tools/osx64/autobuilder
cp win64/autobuilder.exe ruby/tools/win64/autobuilder.exe
cp linux64/extractor ruby/tools/linux64/extractor
cp osx64/extractor ruby/tools/osx64/extractor
cp win64/extractor.exe ruby/tools/win64/extractor.exe
chmod +x ruby/tools/{linux64,osx64}/{autobuilder,extractor}
zip -rq codeql-ruby.zip ruby
- uses: actions/upload-artifact@v3
@@ -203,11 +219,6 @@ jobs:
- name: Fetch CodeQL
uses: ./.github/actions/fetch-codeql
- uses: actions/checkout@v3
with:
repository: Shopify/example-ruby-app
ref: 67a0decc5eb550f3a9228eda53925c3afd40dfe9
- name: Download Ruby bundle
uses: actions/download-artifact@v3
with:
@@ -216,27 +227,67 @@ jobs:
- name: Unzip Ruby bundle
shell: bash
run: unzip -q -d "${{ runner.temp }}/ruby-bundle" "${{ runner.temp }}/codeql-ruby-bundle.zip"
- name: Prepare test files
shell: bash
run: |
echo "import codeql.ruby.AST select count(File f)" > "test.ql"
echo "| 4 |" > "test.expected"
echo 'name: sample-tests
version: 0.0.0
dependencies:
codeql/ruby-all: "*"
extractor: ruby
tests: .
' > qlpack.yml
- name: Run QL test
shell: bash
run: |
codeql test run --search-path "${{ runner.temp }}/ruby-bundle" --additional-packs "${{ runner.temp }}/ruby-bundle" .
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 . ../database
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
# 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

@@ -5,6 +5,7 @@ on:
paths:
- "swift/**"
- "misc/bazel/**"
- "misc/codegen/**"
- "*.bazel*"
- .github/workflows/swift.yml
- .github/actions/**
@@ -19,6 +20,7 @@ on:
paths:
- "swift/**"
- "misc/bazel/**"
- "misc/codegen/**"
- "*.bazel*"
- .github/workflows/swift.yml
- .github/actions/**

View File

@@ -19,7 +19,7 @@ repos:
rev: v1.6.0
hooks:
- id: autopep8
files: ^swift/.*\.py
files: ^misc/codegen/.*\.py
- repo: local
hooks:
@@ -53,5 +53,5 @@ repos:
name: Run Swift code generation unit tests
files: ^swift/codegen/.*\.py$
language: system
entry: bazel test //swift/codegen/test
entry: bazel test //misc/codegen/test
pass_filenames: false

View File

@@ -6,6 +6,7 @@
/python/ @github/codeql-python
/ruby/ @github/codeql-ruby
/swift/ @github/codeql-swift
/misc/codegen/ @github/codeql-swift
/java/kotlin-extractor/ @github/codeql-kotlin
/java/kotlin-explorer/ @github/codeql-kotlin

View File

@@ -25,6 +25,7 @@ If you have an idea for a query that you would like to share with other CodeQL u
Each language-specific directory contains further subdirectories that group queries based on their `@tags` or purpose.
- Experimental queries and libraries are stored in the `experimental` subdirectory within each language-specific directory in the [CodeQL repository](https://github.com/github/codeql). For example, experimental Java queries and libraries are stored in `java/ql/src/experimental` and any corresponding tests in `java/ql/test/experimental`.
- Experimental queries need to include `experimental` in their `@tags`
- The structure of an `experimental` subdirectory mirrors the structure of its parent directory.
- Select or create an appropriate directory in `experimental` based on the existing directory structure of `experimental` or its parent directory.

View File

@@ -10,6 +10,8 @@ There is [extensive documentation](https://codeql.github.com/docs/) on getting s
We welcome contributions to our standard library and standard checks. Do you have an idea for a new check, or how to improve an existing query? Then please go ahead and open a pull request! Before you do, though, please take the time to read our [contributing guidelines](CONTRIBUTING.md). You can also consult our [style guides](https://github.com/github/codeql/tree/main/docs) to learn how to format your code for consistency and clarity, how to write query metadata, and how to write query help documentation for your query.
For information on contributing to CodeQL documentation, see the "[contributing guide](docs/codeql/CONTRIBUTING.md)" for docs.
## License
The code in this repository is licensed under the [MIT License](LICENSE) by [GitHub](https://github.com).

View File

@@ -1,65 +1,86 @@
{
"DataFlow Java/C++/C#/Go/Python/Ruby/Swift": [
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlow.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlow.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlow.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlow.qll",
"go/ql/lib/semmle/go/dataflow/internal/DataFlow.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlow.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlow.qll",
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlow.qll"
],
"DataFlowImpl Java/C++/C#/Go/Python/Ruby/Swift": [
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll",
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"
],
"DataFlow Java/C++/C#/Go/Python/Ruby/Swift Legacy Configuration": [
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl1.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl1.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl1.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll",
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl.qll",
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl1.qll",
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImplForStringsNewReplacer.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl1.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplForRegExp.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl1.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForRegExp.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForHttpClientLibraries.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForPathname.qll",
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl1.qll"
],
"DataFlow Java/C++/C#/Go/Python/Ruby/Swift Common": [
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll",
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImplCommon.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll",
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll"
],
"TaintTracking::Configuration Java/C++/C#/Go/Python/Ruby/Swift": [
"TaintTracking Java/C++/C#/Go/Python/Ruby/Swift": [
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTracking.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTracking.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking1/TaintTracking.qll",
"go/ql/lib/semmle/go/dataflow/internal/tainttracking1/TaintTracking.qll",
"java/ql/lib/semmle/code/java/dataflow/internal/tainttracking1/TaintTracking.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking1/TaintTracking.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttracking1/TaintTracking.qll",
"swift/ql/lib/codeql/swift/dataflow/internal/tainttracking1/TaintTracking.qll"
],
"TaintTracking Legacy Configuration Java/C++/C#/Go/Python/Ruby/Swift": [
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
@@ -81,7 +102,6 @@
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll",
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll",
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll",
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll",
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll",
@@ -103,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"
@@ -259,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",
@@ -402,16 +431,6 @@
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/ControlFlowReachability.qll",
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/ControlFlowReachability.qll"
],
"Inline Test Expectations": [
"cpp/ql/test/TestUtilities/InlineExpectationsTest.qll",
"csharp/ql/test/TestUtilities/InlineExpectationsTest.qll",
"java/ql/test/TestUtilities/InlineExpectationsTest.qll",
"python/ql/test/TestUtilities/InlineExpectationsTest.qll",
"ruby/ql/test/TestUtilities/InlineExpectationsTest.qll",
"ql/ql/test/TestUtilities/InlineExpectationsTest.qll",
"go/ql/test/TestUtilities/InlineExpectationsTest.qll",
"swift/ql/test/TestUtilities/InlineExpectationsTest.qll"
],
"C++ ExternalAPIs": [
"cpp/ql/src/Security/CWE/CWE-020/ExternalAPIs.qll",
"cpp/ql/src/Security/CWE/CWE-020/ir/ExternalAPIs.qll"
@@ -581,4 +600,4 @@
"python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll",
"java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll"
]
}
}

View File

@@ -1,5 +1,6 @@
using Xunit;
using Semmle.Autobuild.Shared;
using Semmle.Util;
using System.Collections.Generic;
using System;
using System.Linq;
@@ -75,6 +76,15 @@ namespace Semmle.Autobuild.Cpp.Tests
throw new ArgumentException("Missing RunProcess " + pattern);
}
int IBuildActions.RunProcess(string cmd, string args, string? workingDirectory, IDictionary<string, string>? env, BuildOutputHandler onOutput, BuildOutputHandler onError)
{
var ret = (this as IBuildActions).RunProcess(cmd, args, workingDirectory, env, out var stdout);
stdout.ForEach(line => onOutput(line));
return ret;
}
public IList<string> DirectoryDeleteIn = new List<string>();
void IBuildActions.DirectoryDelete(string dir, bool recursive)
@@ -131,6 +141,14 @@ namespace Semmle.Autobuild.Cpp.Tests
bool IBuildActions.IsWindows() => IsWindows;
public bool IsMacOs { get; set; }
bool IBuildActions.IsMacOs() => IsMacOs;
public bool IsArm { get; set; }
bool IBuildActions.IsArm() => IsArm;
string IBuildActions.PathCombine(params string[] parts)
{
return string.Join(IsWindows ? '\\' : '/', parts.Where(p => !string.IsNullOrWhiteSpace(p)));
@@ -176,6 +194,15 @@ namespace Semmle.Autobuild.Cpp.Tests
if (!DownloadFiles.Contains((address, fileName)))
throw new ArgumentException($"Missing DownloadFile, {address}, {fileName}");
}
public IDiagnosticsWriter CreateDiagnosticsWriter(string filename) => new TestDiagnosticWriter();
}
internal class TestDiagnosticWriter : IDiagnosticsWriter
{
public IList<DiagnosticMessage> Diagnostics { get; } = new List<DiagnosticMessage>();
public void AddEntry(DiagnosticMessage message) => this.Diagnostics.Add(message);
}
/// <summary>
@@ -235,6 +262,7 @@ namespace Semmle.Autobuild.Cpp.Tests
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_TRAP_DIR"] = "";
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_SOURCE_ARCHIVE_DIR"] = "";
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_ROOT"] = $@"C:\codeql\{codeqlUpperLanguage.ToLowerInvariant()}";
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_DIAGNOSTIC_DIR"] = "";
Actions.GetEnvironmentVariable["CODEQL_JAVA_HOME"] = @"C:\codeql\tools\java";
Actions.GetEnvironmentVariable["CODEQL_PLATFORM"] = "win64";
Actions.GetEnvironmentVariable["SEMMLE_DIST"] = @"C:\odasa";

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>

View File

@@ -1,4 +1,5 @@
using Semmle.Autobuild.Shared;
using Semmle.Util;
namespace Semmle.Autobuild.Cpp
{
@@ -21,7 +22,7 @@ namespace Semmle.Autobuild.Cpp
public class CppAutobuilder : Autobuilder<CppAutobuildOptions>
{
public CppAutobuilder(IBuildActions actions, CppAutobuildOptions options) : base(actions, options) { }
public CppAutobuilder(IBuildActions actions, CppAutobuildOptions options) : base(actions, options, new DiagnosticClassifier()) { }
public override BuildScript GetBuildScript()
{

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>Semmle.Autobuild.Cpp</AssemblyName>
<RootNamespace>Semmle.Autobuild.Cpp</RootNamespace>
<ApplicationIcon />

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

@@ -13,5 +13,5 @@ predicate isExprWithNewBuiltin(Expr expr) {
from Expr expr, int kind, int kind_new, Location location
where
exprs(expr, kind, location) and
if isExprWithNewBuiltin(expr) then kind_new = 0 else kind_new = kind
if isExprWithNewBuiltin(expr) then kind_new = 1 else kind_new = kind
select expr, kind_new, location

View File

@@ -9,5 +9,5 @@ class Location extends @location_expr {
from Expr expr, int kind, int kind_new, Location location
where
exprs(expr, kind, location) and
if expr instanceof @blockassignexpr then kind_new = 0 else kind_new = kind
if expr instanceof @blockassignexpr then kind_new = 1 else kind_new = kind
select expr, kind_new, location

View File

@@ -0,0 +1,11 @@
class BuiltinType extends @builtintype {
string toString() { none() }
}
from BuiltinType type, string name, int kind, int kind_new, int size, int sign, int alignment
where
builtintypes(type, name, kind, size, sign, alignment) and
if type instanceof @float16 or type instanceof @complex_float16
then kind_new = 2
else kind_new = kind
select type, name, kind_new, size, sign, alignment

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,3 @@
description: Introduce (_Complex) _Float16 type
compatibility: backwards
builtintypes.rel: run builtintypes.qlo

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,2 @@
description: Uncomment case splits in dbscheme
compatibility: full

View File

@@ -1,3 +1,92 @@
## 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
* The `semmle.code.cpp.commons.Buffer` and `semmle.code.cpp.commons.NullTermination` libraries no longer expose `semmle.code.cpp.dataflow.DataFlow`. Please import `semmle.code.cpp.dataflow.DataFlow` directly.
### Deprecated APIs
* The `WriteConfig` taint tracking configuration has been deprecated. Please use `WriteFlow`.
### New Features
* Added support for merging two `PathGraph`s via disjoint union to allow results from multiple data flow computations in a single `path-problem` query.
### Major Analysis Improvements
* A new C/C++ dataflow library (`semmle.code.cpp.dataflow.new.DataFlow`) has been added.
The new library behaves much more like the dataflow library of other CodeQL supported
languages by following use-use dataflow paths instead of def-use dataflow paths.
The new library also better supports dataflow through indirections, and new predicates
such as `Node::asIndirectExpr` have been added to facilitate working with indirections.
The `semmle.code.cpp.ir.dataflow.DataFlow` library is now identical to the new
`semmle.code.cpp.dataflow.new.DataFlow` library.
* The main data flow and taint tracking APIs have been changed. The old APIs
remain in place for now and translate to the new through a
backwards-compatible wrapper. If multiple configurations are in scope
simultaneously, then this may affect results slightly. The new API is quite
similar to the old, but makes use of a configuration module instead of a
configuration class.
### Minor Analysis Improvements
* Deleted the deprecated `hasGeneratedCopyConstructor` and `hasGeneratedCopyAssignmentOperator` predicates from the `Folder` class.
* Deleted the deprecated `getPath` and `getFolder` predicates from the `XmlFile` class.
* Deleted the deprecated `getMustlockFunction`, `getTrylockFunction`, `getLockFunction`, and `getUnlockFunction` predicates from the `MutexType` class.
* Deleted the deprecated `getPosInBasicBlock` predicate from the `SubBasicBlock` class.
* Deleted the deprecated `getExpr` predicate from the `PointerDereferenceExpr` class.
* Deleted the deprecated `getUseInstruction` and `getDefinitionInstruction` predicates from the `Operand` class.
* Deleted the deprecated `isInParameter`, `isInParameterPointer`, and `isInQualifier` predicates from the `FunctionInput` class.
* Deleted the deprecated `isOutParameterPointer`, `isOutQualifier`, `isOutReturnValue`, and `isOutReturnPointer` predicate from the `FunctionOutput` class.
* Deleted the deprecated 3-argument `isGuardPhi` predicate from the `RangeSsaDefinition` class.
## 0.5.4
No user-facing changes.
## 0.5.3
No user-facing changes.
## 0.5.2
No user-facing changes.
## 0.5.1
No user-facing changes.
## 0.5.0
### Breaking Changes

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,42 @@
## 0.6.0
### Breaking Changes
* The `semmle.code.cpp.commons.Buffer` and `semmle.code.cpp.commons.NullTermination` libraries no longer expose `semmle.code.cpp.dataflow.DataFlow`. Please import `semmle.code.cpp.dataflow.DataFlow` directly.
### Deprecated APIs
* The `WriteConfig` taint tracking configuration has been deprecated. Please use `WriteFlow`.
### New Features
* Added support for merging two `PathGraph`s via disjoint union to allow results from multiple data flow computations in a single `path-problem` query.
### Major Analysis Improvements
* A new C/C++ dataflow library (`semmle.code.cpp.dataflow.new.DataFlow`) has been added.
The new library behaves much more like the dataflow library of other CodeQL supported
languages by following use-use dataflow paths instead of def-use dataflow paths.
The new library also better supports dataflow through indirections, and new predicates
such as `Node::asIndirectExpr` have been added to facilitate working with indirections.
The `semmle.code.cpp.ir.dataflow.DataFlow` library is now identical to the new
`semmle.code.cpp.dataflow.new.DataFlow` library.
* The main data flow and taint tracking APIs have been changed. The old APIs
remain in place for now and translate to the new through a
backwards-compatible wrapper. If multiple configurations are in scope
simultaneously, then this may affect results slightly. The new API is quite
similar to the old, but makes use of a configuration module instead of a
configuration class.
### Minor Analysis Improvements
* Deleted the deprecated `hasGeneratedCopyConstructor` and `hasGeneratedCopyAssignmentOperator` predicates from the `Folder` class.
* Deleted the deprecated `getPath` and `getFolder` predicates from the `XmlFile` class.
* Deleted the deprecated `getMustlockFunction`, `getTrylockFunction`, `getLockFunction`, and `getUnlockFunction` predicates from the `MutexType` class.
* Deleted the deprecated `getPosInBasicBlock` predicate from the `SubBasicBlock` class.
* Deleted the deprecated `getExpr` predicate from the `PointerDereferenceExpr` class.
* Deleted the deprecated `getUseInstruction` and `getDefinitionInstruction` predicates from the `Operand` class.
* Deleted the deprecated `isInParameter`, `isInParameterPointer`, and `isInQualifier` predicates from the `FunctionInput` class.
* Deleted the deprecated `isOutParameterPointer`, `isOutQualifier`, `isOutReturnValue`, and `isOutReturnPointer` predicate from the `FunctionOutput` class.
* Deleted the deprecated 3-argument `isGuardPhi` predicate from the `RangeSsaDefinition` class.

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.5.0
lastReleaseVersion: 0.7.0

View File

@@ -123,6 +123,13 @@ private predicate constructorCallTypeMention(ConstructorCall cc, TypeMention tm)
)
}
/** Holds if `loc` has the container `container` and is on the line starting at `startLine`. */
pragma[nomagic]
private predicate hasContainerAndStartLine(Location loc, Container container, int startLine) {
loc.getStartLine() = startLine and
loc.getContainer() = container
}
/**
* Gets an element, of kind `kind`, that element `e` uses, if any.
* Attention: This predicate yields multiple definitions for a single location.
@@ -159,9 +166,9 @@ Top definitionOf(Top e, string kind) {
// Multiple type mentions can be generated when a typedef is used, and
// in such cases we want to exclude all but the originating typedef.
not exists(Type secondary |
exists(TypeMention tm, File f, int startline, int startcol |
exists(File f, int startline, int startcol |
typeMentionStartLoc(e, result, f, startline, startcol) and
typeMentionStartLoc(tm, secondary, f, startline, startcol) and
typeMentionStartLoc(_, secondary, f, startline, startcol) and
(
result = secondary.(TypedefType).getBaseType() or
result = secondary.(TypedefType).getBaseType().(SpecifiedType).getBaseType()
@@ -184,11 +191,9 @@ Top definitionOf(Top e, string kind) {
kind = "I" and
result = e.(Include).getIncludedFile() and
// exclude `#include` directives containing macros
not exists(MacroInvocation mi, Location l1, Location l2 |
l1 = e.(Include).getLocation() and
l2 = mi.getLocation() and
l1.getContainer() = l2.getContainer() and
l1.getStartLine() = l2.getStartLine()
not exists(MacroInvocation mi, Container container, int startLine |
hasContainerAndStartLine(e.(Include).getLocation(), container, startLine) and
hasContainerAndStartLine(mi.getLocation(), container, startLine)
// (an #include directive must be always on it's own line)
)
) and

View File

@@ -1,17 +1,146 @@
import experimental.semmle.code.cpp.ir.dataflow.DataFlow
import experimental.semmle.code.cpp.ir.dataflow.DataFlow2
import semmle.code.cpp.ir.dataflow.DataFlow
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,26 +0,0 @@
/**
* Provides a library for local (intra-procedural) and global (inter-procedural)
* data flow analysis: deciding whether data can flow from a _source_ to a
* _sink_. This library differs from the one in `semmle.code.cpp.dataflow` in that
* this library uses the IR (Intermediate Representation) library, which provides
* a more precise semantic representation of the program, whereas the other dataflow
* library uses the more syntax-oriented ASTs. This library should provide more accurate
* results than the AST-based library in most scenarios.
*
* Unless configured otherwise, _flow_ means that the exact value of
* the source may reach the sink. We do not track flow across pointer
* dereferences or array indexing.
*
* To use global (interprocedural) data flow, extend the class
* `DataFlow::Configuration` as documented on that class. To use local
* (intraprocedural) data flow between expressions, call
* `DataFlow::localExprFlow`. For more general cases of local data flow, call
* `DataFlow::localFlow` or `DataFlow::localFlowStep` with arguments of type
* `DataFlow::Node`.
*/
import cpp
module DataFlow {
import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowImpl
}

View File

@@ -1,16 +0,0 @@
/**
* Provides a `DataFlow2` module, which is a copy of the `DataFlow` module. Use
* this class when data-flow configurations must depend on each other. Two
* classes extending `DataFlow::Configuration` should never depend on each
* other, but one of them should instead depend on a
* `DataFlow2::Configuration`, a `DataFlow3::Configuration`, or a
* `DataFlow4::Configuration`.
*
* See `semmle.code.cpp.ir.dataflow.DataFlow` for the full documentation.
*/
import cpp
module DataFlow2 {
import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowImpl2
}

View File

@@ -1,16 +0,0 @@
/**
* Provides a `DataFlow3` module, which is a copy of the `DataFlow` module. Use
* this class when data-flow configurations must depend on each other. Two
* classes extending `DataFlow::Configuration` should never depend on each
* other, but one of them should instead depend on a
* `DataFlow2::Configuration`, a `DataFlow3::Configuration`, or a
* `DataFlow4::Configuration`.
*
* See `semmle.code.cpp.ir.dataflow.DataFlow` for the full documentation.
*/
import cpp
module DataFlow3 {
import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowImpl3
}

View File

@@ -1,16 +0,0 @@
/**
* Provides a `DataFlow4` module, which is a copy of the `DataFlow` module. Use
* this class when data-flow configurations must depend on each other. Two
* classes extending `DataFlow::Configuration` should never depend on each
* other, but one of them should instead depend on a
* `DataFlow2::Configuration`, a `DataFlow3::Configuration`, or a
* `DataFlow4::Configuration`.
*
* See `semmle.code.cpp.ir.dataflow.DataFlow` for the full documentation.
*/
import cpp
module DataFlow4 {
import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowImpl4
}

View File

@@ -1,23 +0,0 @@
/**
* Provides a predicate for non-contextual virtual dispatch and function
* pointer resolution.
*/
import cpp
private import semmle.code.cpp.ir.ValueNumbering
private import internal.DataFlowDispatch
private import semmle.code.cpp.ir.IR
/**
* Resolve potential target function(s) for `call`.
*
* If `call` is a call through a function pointer (`ExprCall`) or its target is
* a virtual member function, simple data flow analysis is performed in order
* to identify the possible target(s).
*/
Function resolveCall(Call call) {
exists(CallInstruction callInstruction |
callInstruction.getAst() = call and
result = viableCallable(callInstruction)
)
}

View File

@@ -1,23 +0,0 @@
/**
* Provides classes for performing local (intra-procedural) and
* global (inter-procedural) taint-tracking analyses.
*
* We define _taint propagation_ informally to mean that a substantial part of
* the information from the source is preserved at the sink. For example, taint
* propagates from `x` to `x + 100`, but it does not propagate from `x` to `x >
* 100` since we consider a single bit of information to be too little.
*
* To use global (interprocedural) taint tracking, extend the class
* `TaintTracking::Configuration` as documented on that class. To use local
* (intraprocedural) taint tracking between expressions, call
* `TaintTracking::localExprTaint`. For more general cases of local taint
* tracking, call `TaintTracking::localTaint` or
* `TaintTracking::localTaintStep` with arguments of type `DataFlow::Node`.
*/
import semmle.code.cpp.ir.dataflow.DataFlow
import semmle.code.cpp.ir.dataflow.DataFlow2
module TaintTracking {
import experimental.semmle.code.cpp.ir.dataflow.internal.tainttracking1.TaintTrackingImpl
}

View File

@@ -1,15 +0,0 @@
/**
* Provides a `TaintTracking2` module, which is a copy of the `TaintTracking`
* module. Use this class when data-flow configurations or taint-tracking
* configurations must depend on each other. Two classes extending
* `DataFlow::Configuration` should never depend on each other, but one of them
* should instead depend on a `DataFlow2::Configuration`, a
* `DataFlow3::Configuration`, or a `DataFlow4::Configuration`. The
* `TaintTracking::Configuration` class extends `DataFlow::Configuration`, and
* `TaintTracking2::Configuration` extends `DataFlow2::Configuration`.
*
* See `semmle.code.cpp.ir.dataflow.TaintTracking` for the full documentation.
*/
module TaintTracking2 {
import experimental.semmle.code.cpp.ir.dataflow.internal.tainttracking2.TaintTrackingImpl
}

View File

@@ -1,15 +0,0 @@
/**
* Provides a `TaintTracking3` module, which is a copy of the `TaintTracking`
* module. Use this class when data-flow configurations or taint-tracking
* configurations must depend on each other. Two classes extending
* `DataFlow::Configuration` should never depend on each other, but one of them
* should instead depend on a `DataFlow2::Configuration`, a
* `DataFlow3::Configuration`, or a `DataFlow4::Configuration`. The
* `TaintTracking::Configuration` class extends `DataFlow::Configuration`, and
* `TaintTracking2::Configuration` extends `DataFlow2::Configuration`.
*
* See `semmle.code.cpp.ir.dataflow.TaintTracking` for the full documentation.
*/
module TaintTracking3 {
import experimental.semmle.code.cpp.ir.dataflow.internal.tainttracking3.TaintTrackingImpl
}

View File

@@ -1,273 +0,0 @@
private import cpp
private import semmle.code.cpp.ir.IR
private import experimental.semmle.code.cpp.ir.dataflow.DataFlow
private import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate
private import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private import DataFlowImplCommon as DataFlowImplCommon
/**
* Gets a function that might be called by `call`.
*/
cached
Function viableCallable(CallInstruction call) {
DataFlowImplCommon::forceCachingInSameStage() and
result = call.getStaticCallTarget()
or
// If the target of the call does not have a body in the snapshot, it might
// be because the target is just a header declaration, and the real target
// will be determined at run time when the caller and callee are linked
// together by the operating system's dynamic linker. In case a _unique_
// function with the right signature is present in the database, we return
// that as a potential callee.
exists(string qualifiedName, int nparams |
callSignatureWithoutBody(qualifiedName, nparams, call) and
functionSignatureWithBody(qualifiedName, nparams, result) and
strictcount(Function other | functionSignatureWithBody(qualifiedName, nparams, other)) = 1
)
or
// Virtual dispatch
result = call.(VirtualDispatch::DataSensitiveCall).resolve()
}
/**
* Provides virtual dispatch support compatible with the original
* implementation of `semmle.code.cpp.security.TaintTracking`.
*/
private module VirtualDispatch {
/** A call that may dispatch differently depending on the qualifier value. */
abstract class DataSensitiveCall extends DataFlowCall {
/**
* Gets the node whose value determines the target of this call. This node
* could be the qualifier of a virtual dispatch or the function-pointer
* expression in a call to a function pointer. What they have in common is
* that we need to find out which data flows there, and then it's up to the
* `resolve` predicate to stitch that information together and resolve the
* call.
*/
abstract DataFlow::Node getDispatchValue();
/** Gets a candidate target for this call. */
abstract Function resolve();
/**
* Whether `src` can flow to this call.
*
* Searches backwards from `getDispatchValue()` to `src`. The `allowFromArg`
* parameter is true when the search is allowed to continue backwards into
* a parameter; non-recursive callers should pass `_` for `allowFromArg`.
*/
predicate flowsFrom(DataFlow::Node src, boolean allowFromArg) {
src = this.getDispatchValue() and allowFromArg = true
or
exists(DataFlow::Node other, boolean allowOtherFromArg |
this.flowsFrom(other, allowOtherFromArg)
|
// Call argument
exists(DataFlowCall call, Position i |
other
.(DataFlow::ParameterNode)
.isParameterOf(pragma[only_bind_into](call).getStaticCallTarget(), i) and
src.(ArgumentNode).argumentOf(call, pragma[only_bind_into](pragma[only_bind_out](i)))
) and
allowOtherFromArg = true and
allowFromArg = true
or
// Call return
exists(DataFlowCall call, ReturnKind returnKind |
other = getAnOutNode(call, returnKind) and
returnNodeWithKindAndEnclosingCallable(src, returnKind, call.getStaticCallTarget())
) and
allowFromArg = false
or
// Local flow
DataFlow::localFlowStep(src, other) and
allowFromArg = allowOtherFromArg
or
// Flow from global variable to load.
exists(LoadInstruction load, GlobalOrNamespaceVariable var |
var = src.asVariable() and
other.asInstruction() = load and
addressOfGlobal(load.getSourceAddress(), var) and
// The `allowFromArg` concept doesn't play a role when `src` is a
// global variable, so we just set it to a single arbitrary value for
// performance.
allowFromArg = true
)
or
// Flow from store to global variable.
exists(StoreInstruction store, GlobalOrNamespaceVariable var |
var = other.asVariable() and
store = src.asInstruction() and
storeIntoGlobal(store, var) and
// Setting `allowFromArg` to `true` like in the base case means we
// treat a store to a global variable like the dispatch itself: flow
// may come from anywhere.
allowFromArg = true
)
)
}
}
pragma[noinline]
private predicate storeIntoGlobal(StoreInstruction store, GlobalOrNamespaceVariable var) {
addressOfGlobal(store.getDestinationAddress(), var)
}
/** Holds if `addressInstr` is an instruction that produces the address of `var`. */
private predicate addressOfGlobal(Instruction addressInstr, GlobalOrNamespaceVariable var) {
// Access directly to the global variable
addressInstr.(VariableAddressInstruction).getAstVariable() = var
or
// Access to a field on a global union
exists(FieldAddressInstruction fa |
fa = addressInstr and
fa.getObjectAddress().(VariableAddressInstruction).getAstVariable() = var and
fa.getField().getDeclaringType() instanceof Union
)
}
/**
* A ReturnNode with its ReturnKind and its enclosing callable.
*
* Used to fix a join ordering issue in flowsFrom.
*/
pragma[noinline]
private predicate returnNodeWithKindAndEnclosingCallable(
ReturnNode node, ReturnKind kind, DataFlowCallable callable
) {
node.getKind() = kind and
node.getEnclosingCallable() = callable
}
/** Call through a function pointer. */
private class DataSensitiveExprCall extends DataSensitiveCall {
DataSensitiveExprCall() { not exists(this.getStaticCallTarget()) }
override DataFlow::Node getDispatchValue() { result.asInstruction() = this.getCallTarget() }
override Function resolve() {
exists(FunctionInstruction fi |
this.flowsFrom(DataFlow::instructionNode(fi), _) and
result = fi.getFunctionSymbol()
) and
(
this.getNumberOfArguments() <= result.getEffectiveNumberOfParameters() and
this.getNumberOfArguments() >= result.getEffectiveNumberOfParameters()
or
result.isVarargs()
)
}
}
/** Call to a virtual function. */
private class DataSensitiveOverriddenFunctionCall extends DataSensitiveCall {
DataSensitiveOverriddenFunctionCall() {
exists(this.getStaticCallTarget().(VirtualFunction).getAnOverridingFunction())
}
override DataFlow::Node getDispatchValue() { result.asInstruction() = this.getThisArgument() }
override MemberFunction resolve() {
exists(Class overridingClass |
this.overrideMayAffectCall(overridingClass, result) and
this.hasFlowFromCastFrom(overridingClass)
)
}
/**
* Holds if `this` is a virtual function call whose static target is
* overridden by `overridingFunction` in `overridingClass`.
*/
pragma[noinline]
private predicate overrideMayAffectCall(Class overridingClass, MemberFunction overridingFunction) {
overridingFunction.getAnOverriddenFunction+() = this.getStaticCallTarget().(VirtualFunction) and
overridingFunction.getDeclaringType() = overridingClass
}
/**
* Holds if the qualifier of `this` has flow from an upcast from
* `derivedClass`.
*/
pragma[noinline]
private predicate hasFlowFromCastFrom(Class derivedClass) {
exists(ConvertToBaseInstruction toBase |
this.flowsFrom(DataFlow::instructionNode(toBase), _) and
derivedClass = toBase.getDerivedClass()
)
}
}
}
/**
* Holds if `f` is a function with a body that has name `qualifiedName` and
* `nparams` parameter count. See `functionSignature`.
*/
private predicate functionSignatureWithBody(string qualifiedName, int nparams, Function f) {
functionSignature(f, qualifiedName, nparams) and
exists(f.getBlock())
}
/**
* Holds if the target of `call` is a function _with no definition_ that has
* name `qualifiedName` and `nparams` parameter count. See `functionSignature`.
*/
pragma[noinline]
private predicate callSignatureWithoutBody(string qualifiedName, int nparams, CallInstruction call) {
exists(Function target |
target = call.getStaticCallTarget() and
not exists(target.getBlock()) and
functionSignature(target, qualifiedName, nparams)
)
}
/**
* Holds if `f` has name `qualifiedName` and `nparams` parameter count. This is
* an approximation of its signature for the purpose of matching functions that
* might be the same across link targets.
*/
private predicate functionSignature(Function f, string qualifiedName, int nparams) {
qualifiedName = f.getQualifiedName() and
nparams = f.getNumberOfParameters() and
not f.isStatic()
}
/**
* Holds if the set of viable implementations that can be called by `call`
* might be improved by knowing the call context.
*/
predicate mayBenefitFromCallContext(CallInstruction call, Function f) {
mayBenefitFromCallContext(call, f, _)
}
/**
* Holds if `call` is a call through a function pointer, and the pointer
* value is given as the `arg`'th argument to `f`.
*/
private predicate mayBenefitFromCallContext(
VirtualDispatch::DataSensitiveCall call, Function f, int arg
) {
f = pragma[only_bind_out](call).getEnclosingCallable() and
exists(InitializeParameterInstruction init |
not exists(call.getStaticCallTarget()) and
init.getEnclosingFunction() = f and
call.flowsFrom(DataFlow::instructionNode(init), _) and
init.getParameter().getIndex() = arg
)
}
/**
* Gets a viable dispatch target of `call` in the context `ctx`. This is
* restricted to those `call`s for which a context might make a difference.
*/
Function viableImplInCallContext(CallInstruction call, CallInstruction ctx) {
result = viableCallable(call) and
exists(int i, Function f |
mayBenefitFromCallContext(pragma[only_bind_into](call), f, i) and
f = ctx.getStaticCallTarget() and
result = ctx.getArgument(i).getUnconvertedResultExpression().(FunctionAccess).getTarget()
)
}
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
pragma[inline]
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }

View File

@@ -1,268 +0,0 @@
/**
* Provides consistency queries for checking invariants in the language-specific
* data-flow classes and predicates.
*/
private import DataFlowImplSpecific::Private
private import DataFlowImplSpecific::Public
private import tainttracking1.TaintTrackingParameter::Private
private import tainttracking1.TaintTrackingParameter::Public
module Consistency {
private newtype TConsistencyConfiguration = MkConsistencyConfiguration()
/** A class for configuring the consistency queries. */
class ConsistencyConfiguration extends TConsistencyConfiguration {
string toString() { none() }
/** Holds if `n` should be excluded from the consistency test `uniqueEnclosingCallable`. */
predicate uniqueEnclosingCallableExclude(Node n) { none() }
/** Holds if `n` should be excluded from the consistency test `uniqueNodeLocation`. */
predicate uniqueNodeLocationExclude(Node n) { none() }
/** Holds if `n` should be excluded from the consistency test `missingLocation`. */
predicate missingLocationExclude(Node n) { none() }
/** Holds if `n` should be excluded from the consistency test `postWithInFlow`. */
predicate postWithInFlowExclude(Node n) { none() }
/** Holds if `n` should be excluded from the consistency test `argHasPostUpdate`. */
predicate argHasPostUpdateExclude(ArgumentNode n) { none() }
/** Holds if `n` should be excluded from the consistency test `reverseRead`. */
predicate reverseReadExclude(Node n) { none() }
/** Holds if `n` should be excluded from the consistency test `postHasUniquePre`. */
predicate postHasUniquePreExclude(PostUpdateNode n) { none() }
/** Holds if `n` should be excluded from the consistency test `uniquePostUpdate`. */
predicate uniquePostUpdateExclude(Node n) { none() }
/** Holds if `(call, ctx)` should be excluded from the consistency test `viableImplInCallContextTooLargeExclude`. */
predicate viableImplInCallContextTooLargeExclude(
DataFlowCall call, DataFlowCall ctx, DataFlowCallable callable
) {
none()
}
}
private class RelevantNode extends Node {
RelevantNode() {
this instanceof ArgumentNode or
this instanceof ParameterNode or
this instanceof ReturnNode or
this = getAnOutNode(_, _) or
simpleLocalFlowStep(this, _) or
simpleLocalFlowStep(_, this) or
jumpStep(this, _) or
jumpStep(_, this) or
storeStep(this, _, _) or
storeStep(_, _, this) or
readStep(this, _, _) or
readStep(_, _, this) or
defaultAdditionalTaintStep(this, _) or
defaultAdditionalTaintStep(_, this)
}
}
query predicate uniqueEnclosingCallable(Node n, string msg) {
exists(int c |
n instanceof RelevantNode and
c = count(nodeGetEnclosingCallable(n)) and
c != 1 and
not any(ConsistencyConfiguration conf).uniqueEnclosingCallableExclude(n) and
msg = "Node should have one enclosing callable but has " + c + "."
)
}
query predicate uniqueType(Node n, string msg) {
exists(int c |
n instanceof RelevantNode and
c = count(getNodeType(n)) and
c != 1 and
msg = "Node should have one type but has " + c + "."
)
}
query predicate uniqueNodeLocation(Node n, string msg) {
exists(int c |
c =
count(string filepath, int startline, int startcolumn, int endline, int endcolumn |
n.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
) and
c != 1 and
not any(ConsistencyConfiguration conf).uniqueNodeLocationExclude(n) and
msg = "Node should have one location but has " + c + "."
)
}
query predicate missingLocation(string msg) {
exists(int c |
c =
strictcount(Node n |
not exists(string filepath, int startline, int startcolumn, int endline, int endcolumn |
n.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
) and
not any(ConsistencyConfiguration conf).missingLocationExclude(n)
) and
msg = "Nodes without location: " + c
)
}
query predicate uniqueNodeToString(Node n, string msg) {
exists(int c |
c = count(n.toString()) and
c != 1 and
msg = "Node should have one toString but has " + c + "."
)
}
query predicate missingToString(string msg) {
exists(int c |
c = strictcount(Node n | not exists(n.toString())) and
msg = "Nodes without toString: " + c
)
}
query predicate parameterCallable(ParameterNode p, string msg) {
exists(DataFlowCallable c | isParameterNode(p, c, _) and c != nodeGetEnclosingCallable(p)) and
msg = "Callable mismatch for parameter."
}
query predicate localFlowIsLocal(Node n1, Node n2, string msg) {
simpleLocalFlowStep(n1, n2) and
nodeGetEnclosingCallable(n1) != nodeGetEnclosingCallable(n2) and
msg = "Local flow step does not preserve enclosing callable."
}
query predicate readStepIsLocal(Node n1, Node n2, string msg) {
readStep(n1, _, n2) and
nodeGetEnclosingCallable(n1) != nodeGetEnclosingCallable(n2) and
msg = "Read step does not preserve enclosing callable."
}
query predicate storeStepIsLocal(Node n1, Node n2, string msg) {
storeStep(n1, _, n2) and
nodeGetEnclosingCallable(n1) != nodeGetEnclosingCallable(n2) and
msg = "Store step does not preserve enclosing callable."
}
private DataFlowType typeRepr() { result = getNodeType(_) }
query predicate compatibleTypesReflexive(DataFlowType t, string msg) {
t = typeRepr() and
not compatibleTypes(t, t) and
msg = "Type compatibility predicate is not reflexive."
}
query predicate unreachableNodeCCtx(Node n, DataFlowCall call, string msg) {
isUnreachableInCall(n, call) and
exists(DataFlowCallable c |
c = nodeGetEnclosingCallable(n) and
not viableCallable(call) = c
) and
msg = "Call context for isUnreachableInCall is inconsistent with call graph."
}
query predicate localCallNodes(DataFlowCall call, Node n, string msg) {
(
n = getAnOutNode(call, _) and
msg = "OutNode and call does not share enclosing callable."
or
n.(ArgumentNode).argumentOf(call, _) and
msg = "ArgumentNode and call does not share enclosing callable."
) and
nodeGetEnclosingCallable(n) != call.getEnclosingCallable()
}
// This predicate helps the compiler forget that in some languages
// it is impossible for a result of `getPreUpdateNode` to be an
// instance of `PostUpdateNode`.
private Node getPre(PostUpdateNode n) {
result = n.getPreUpdateNode()
or
none()
}
query predicate postIsNotPre(PostUpdateNode n, string msg) {
getPre(n) = n and
msg = "PostUpdateNode should not equal its pre-update node."
}
query predicate postHasUniquePre(PostUpdateNode n, string msg) {
not any(ConsistencyConfiguration conf).postHasUniquePreExclude(n) and
exists(int c |
c = count(n.getPreUpdateNode()) and
c != 1 and
msg = "PostUpdateNode should have one pre-update node but has " + c + "."
)
}
query predicate uniquePostUpdate(Node n, string msg) {
not any(ConsistencyConfiguration conf).uniquePostUpdateExclude(n) and
1 < strictcount(PostUpdateNode post | post.getPreUpdateNode() = n) and
msg = "Node has multiple PostUpdateNodes."
}
query predicate postIsInSameCallable(PostUpdateNode n, string msg) {
nodeGetEnclosingCallable(n) != nodeGetEnclosingCallable(n.getPreUpdateNode()) and
msg = "PostUpdateNode does not share callable with its pre-update node."
}
private predicate hasPost(Node n) { exists(PostUpdateNode post | post.getPreUpdateNode() = n) }
query predicate reverseRead(Node n, string msg) {
exists(Node n2 | readStep(n, _, n2) and hasPost(n2) and not hasPost(n)) and
not any(ConsistencyConfiguration conf).reverseReadExclude(n) and
msg = "Origin of readStep is missing a PostUpdateNode."
}
query predicate argHasPostUpdate(ArgumentNode n, string msg) {
not hasPost(n) and
not any(ConsistencyConfiguration c).argHasPostUpdateExclude(n) and
msg = "ArgumentNode is missing PostUpdateNode."
}
// This predicate helps the compiler forget that in some languages
// it is impossible for a `PostUpdateNode` to be the target of
// `simpleLocalFlowStep`.
private predicate isPostUpdateNode(Node n) { n instanceof PostUpdateNode or none() }
query predicate postWithInFlow(Node n, string msg) {
isPostUpdateNode(n) and
not clearsContent(n, _) and
simpleLocalFlowStep(_, n) and
not any(ConsistencyConfiguration c).postWithInFlowExclude(n) and
msg = "PostUpdateNode should not be the target of local flow."
}
query predicate viableImplInCallContextTooLarge(
DataFlowCall call, DataFlowCall ctx, DataFlowCallable callable
) {
callable = viableImplInCallContext(call, ctx) and
not callable = viableCallable(call) and
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
}
query predicate uniqueParameterNodeAtPosition(
DataFlowCallable c, ParameterPosition pos, Node p, string msg
) {
isParameterNode(p, c, pos) and
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
msg = "Parameters with overlapping positions."
}
query predicate uniqueParameterNodePosition(
DataFlowCallable c, ParameterPosition pos, Node p, string msg
) {
isParameterNode(p, c, pos) and
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
msg = "Parameter node with multiple positions."
}
query predicate uniqueContentApprox(Content c, string msg) {
not exists(unique(ContentApprox approx | approx = getContentApprox(c))) and
msg = "Non-unique content approximation."
}
}

View File

@@ -1,11 +0,0 @@
/**
* Provides IR-specific definitions for use in the data flow library.
*/
module Private {
import DataFlowPrivate
import DataFlowDispatch
}
module Public {
import DataFlowUtil
}

View File

@@ -1,567 +0,0 @@
private import cpp as Cpp
private import DataFlowUtil
private import semmle.code.cpp.ir.IR
private import DataFlowDispatch
private import DataFlowImplConsistency
private import semmle.code.cpp.ir.internal.IRCppLanguage
private import SsaInternals as Ssa
/** Gets the callable in which this node occurs. */
DataFlowCallable nodeGetEnclosingCallable(Node n) { result = n.getEnclosingCallable() }
/** Holds if `p` is a `ParameterNode` of `c` with position `pos`. */
predicate isParameterNode(ParameterNode p, DataFlowCallable c, ParameterPosition pos) {
p.isParameterOf(c, pos)
}
/** Holds if `arg` is an `ArgumentNode` of `c` with position `pos`. */
predicate isArgumentNode(ArgumentNode arg, DataFlowCall c, ArgumentPosition pos) {
arg.argumentOf(c, pos)
}
/**
* A data flow node that occurs as the argument of a call and is passed as-is
* to the callable. Instance arguments (`this` pointer) and read side effects
* on parameters are also included.
*/
abstract class ArgumentNode extends Node {
/**
* Holds if this argument occurs at the given position in the given call.
* The instance argument is considered to have index `-1`.
*/
abstract predicate argumentOf(DataFlowCall call, ArgumentPosition pos);
/** Gets the call in which this node is an argument. */
DataFlowCall getCall() { this.argumentOf(result, _) }
}
/**
* A data flow node that occurs as the argument to a call, or an
* implicit `this` pointer argument.
*/
private class PrimaryArgumentNode extends ArgumentNode, OperandNode {
override ArgumentOperand op;
PrimaryArgumentNode() { exists(CallInstruction call | op = call.getAnArgumentOperand()) }
override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
op = call.getArgumentOperand(pos.(DirectPosition).getIndex())
}
override string toStringImpl() { result = argumentOperandToString(op) }
}
private string argumentOperandToString(ArgumentOperand op) {
exists(Expr unconverted |
unconverted = op.getDef().getUnconvertedResultExpression() and
result = unconverted.toString()
)
or
// Certain instructions don't map to an unconverted result expression. For these cases
// we fall back to a simpler naming scheme. This can happen in IR-generated constructors.
not exists(op.getDef().getUnconvertedResultExpression()) and
(
result = "Argument " + op.(PositionalArgumentOperand).getIndex()
or
op instanceof ThisArgumentOperand and result = "Argument this"
)
}
private class SideEffectArgumentNode extends ArgumentNode, SideEffectOperandNode {
override predicate argumentOf(DataFlowCall dfCall, ArgumentPosition pos) {
this.getCallInstruction() = dfCall and
pos.(IndirectionPosition).getArgumentIndex() = this.getArgumentIndex() and
pos.(IndirectionPosition).getIndirectionIndex() = super.getIndirectionIndex()
}
override string toStringImpl() {
result = argumentOperandToString(this.getAddressOperand()) + " indirection"
}
}
/** A parameter position represented by an integer. */
class ParameterPosition = Position;
/** An argument position represented by an integer. */
class ArgumentPosition = Position;
class Position extends TPosition {
abstract string toString();
}
class DirectPosition extends Position, TDirectPosition {
int index;
DirectPosition() { this = TDirectPosition(index) }
override string toString() { if index = -1 then result = "this" else result = index.toString() }
int getIndex() { result = index }
}
class IndirectionPosition extends Position, TIndirectionPosition {
int argumentIndex;
int indirectionIndex;
IndirectionPosition() { this = TIndirectionPosition(argumentIndex, indirectionIndex) }
override string toString() {
if argumentIndex = -1
then if indirectionIndex > 0 then result = "this indirection" else result = "this"
else
if indirectionIndex > 0
then result = argumentIndex.toString() + " indirection"
else result = argumentIndex.toString()
}
int getArgumentIndex() { result = argumentIndex }
int getIndirectionIndex() { result = indirectionIndex }
}
newtype TPosition =
TDirectPosition(int index) { exists(any(CallInstruction c).getArgument(index)) } or
TIndirectionPosition(int argumentIndex, int indirectionIndex) {
hasOperandAndIndex(_, any(CallInstruction call).getArgumentOperand(argumentIndex),
indirectionIndex)
}
private newtype TReturnKind =
TNormalReturnKind(int index) {
exists(IndirectReturnNode return |
return.getAddressOperand() = any(ReturnValueInstruction r).getReturnAddressOperand() and
index = return.getIndirectionIndex() - 1 // We subtract one because the return loads the value.
)
} or
TIndirectReturnKind(int argumentIndex, int indirectionIndex) {
exists(IndirectReturnNode return, ReturnIndirectionInstruction returnInd |
returnInd.hasIndex(argumentIndex) and
return.getAddressOperand() = returnInd.getSourceAddressOperand() and
indirectionIndex = return.getIndirectionIndex()
)
}
/**
* A return kind. A return kind describes how a value can be returned
* from a callable. For C++, this is simply a function return.
*/
class ReturnKind extends TReturnKind {
/** Gets a textual representation of this return kind. */
abstract string toString();
}
private class NormalReturnKind extends ReturnKind, TNormalReturnKind {
int index;
NormalReturnKind() { this = TNormalReturnKind(index) }
override string toString() { result = "indirect return" }
}
private class IndirectReturnKind extends ReturnKind, TIndirectReturnKind {
int argumentIndex;
int indirectionIndex;
IndirectReturnKind() { this = TIndirectReturnKind(argumentIndex, indirectionIndex) }
override string toString() { result = "indirect outparam[" + argumentIndex.toString() + "]" }
}
/** A data flow node that occurs as the result of a `ReturnStmt`. */
class ReturnNode extends Node instanceof IndirectReturnNode {
/** Gets the kind of this returned value. */
abstract ReturnKind getKind();
}
/**
* This predicate represents an annoying hack that we have to do. We use the
* `ReturnIndirectionInstruction` to determine which variables need flow back
* out of a function. However, the IR will unconditionally create those for a
* variable passed to a function even though the variable was never updated by
* the function. And if a function has too many `ReturnNode`s the dataflow
* library lowers its precision for that function by disabling field flow.
*
* So we those eliminate `ReturnNode`s that would have otherwise been created
* by this unconditional `ReturnIndirectionInstruction` by requiring that there
* must exist an SSA definition of the IR variable in the function.
*/
private predicate hasNonInitializeParameterDef(IRVariable v) {
exists(Ssa::Def def |
not def.getDefiningInstruction() instanceof InitializeParameterInstruction and
v = def.getSourceVariable().getBaseVariable().(Ssa::BaseIRVariable).getIRVariable()
)
}
class ReturnIndirectionNode extends IndirectReturnNode, ReturnNode {
override ReturnKind getKind() {
exists(int argumentIndex, ReturnIndirectionInstruction returnInd |
returnInd.hasIndex(argumentIndex) and
this.getAddressOperand() = returnInd.getSourceAddressOperand() and
result = TIndirectReturnKind(argumentIndex, this.getIndirectionIndex()) and
hasNonInitializeParameterDef(returnInd.getIRVariable())
)
or
this.getAddressOperand() = any(ReturnValueInstruction r).getReturnAddressOperand() and
result = TNormalReturnKind(this.getIndirectionIndex() - 1)
}
}
private Operand fullyConvertedCallStep(Operand op) {
not exists(getANonConversionUse(op)) and
exists(Instruction instr |
conversionFlow(op, instr, _) and
result = getAUse(instr)
)
}
/**
* Gets the instruction that uses this operand, if the instruction is not
* ignored for dataflow purposes.
*/
private Instruction getUse(Operand op) {
result = op.getUse() and
not Ssa::ignoreOperand(op)
}
/** Gets a use of the instruction `instr` that is not ignored for dataflow purposes. */
Operand getAUse(Instruction instr) {
result = instr.getAUse() and
not Ssa::ignoreOperand(result)
}
/**
* Gets a use of `operand` that is:
* - not ignored for dataflow purposes, and
* - not a conversion-like instruction.
*/
private Instruction getANonConversionUse(Operand operand) {
result = getUse(operand) and
not conversionFlow(_, result, _)
}
/**
* Gets the operand that represents the first use of the value of `call` following
* a sequence of conversion-like instructions.
*/
predicate operandForfullyConvertedCall(Operand operand, CallInstruction call) {
exists(getANonConversionUse(operand)) and
(
operand = getAUse(call)
or
operand = fullyConvertedCallStep*(getAUse(call))
)
}
/**
* Gets the instruction that represents the first use of the value of `call` following
* a sequence of conversion-like instructions.
*
* This predicate only holds if there is no suitable operand (i.e., no operand of a non-
* conversion instruction) to use to represent the value of `call` after conversions.
*/
predicate instructionForfullyConvertedCall(Instruction instr, CallInstruction call) {
not operandForfullyConvertedCall(_, call) and
(
// If there is no use of the call then we pick the call instruction
not exists(getAUse(call)) and
instr = call
or
// Otherwise, flow to the first non-conversion use.
exists(Operand operand | operand = fullyConvertedCallStep*(getAUse(call)) |
instr = getANonConversionUse(operand)
)
)
}
/** Holds if `node` represents the output node for `call`. */
private predicate simpleOutNode(Node node, CallInstruction call) {
operandForfullyConvertedCall(node.asOperand(), call)
or
instructionForfullyConvertedCall(node.asInstruction(), call)
}
/** A data flow node that represents the output of a call. */
class OutNode extends Node {
OutNode() {
// Return values not hidden behind indirections
simpleOutNode(this, _)
or
// Return values hidden behind indirections
this instanceof IndirectReturnOutNode
or
// Modified arguments hidden behind indirections
this instanceof IndirectArgumentOutNode
}
/** Gets the underlying call. */
abstract DataFlowCall getCall();
abstract ReturnKind getReturnKind();
}
private class DirectCallOutNode extends OutNode {
CallInstruction call;
DirectCallOutNode() { simpleOutNode(this, call) }
override DataFlowCall getCall() { result = call }
override ReturnKind getReturnKind() { result = TNormalReturnKind(0) }
}
private class IndirectCallOutNode extends OutNode, IndirectReturnOutNode {
override DataFlowCall getCall() { result = this.getCallInstruction() }
override ReturnKind getReturnKind() { result = TNormalReturnKind(this.getIndirectionIndex()) }
}
private class SideEffectOutNode extends OutNode, IndirectArgumentOutNode {
override DataFlowCall getCall() { result = this.getCallInstruction() }
override ReturnKind getReturnKind() {
result = TIndirectReturnKind(this.getArgumentIndex(), this.getIndirectionIndex())
}
}
/**
* Gets a node that can read the value returned from `call` with return kind
* `kind`.
*/
OutNode getAnOutNode(DataFlowCall call, ReturnKind kind) {
result.getCall() = call and
result.getReturnKind() = kind
}
/**
* Holds if data can flow from `node1` to `node2` in a way that loses the
* calling context. For example, this would happen with flow through a
* global or static variable.
*/
predicate jumpStep(Node n1, Node n2) {
exists(Cpp::GlobalOrNamespaceVariable v |
v =
n1.asInstruction()
.(StoreInstruction)
.getResultAddress()
.(VariableAddressInstruction)
.getAstVariable() and
v = n2.asVariable()
or
v =
n2.asInstruction()
.(LoadInstruction)
.getSourceAddress()
.(VariableAddressInstruction)
.getAstVariable() and
v = n1.asVariable()
)
}
/**
* Holds if data can flow from `node1` to `node2` via an assignment to `f`.
* Thus, `node2` references an object with a field `f` that contains the
* value of `node1`.
*/
predicate storeStep(Node node1, Content c, PostFieldUpdateNode node2) {
exists(int indirectionIndex1, int numberOfLoads, StoreInstruction store |
nodeHasInstruction(node1, store, pragma[only_bind_into](indirectionIndex1)) and
node2.getIndirectionIndex() = 1 and
numberOfLoadsFromOperand(node2.getFieldAddress(), store.getDestinationAddressOperand(),
numberOfLoads)
|
exists(FieldContent fc | fc = c |
fc.getField() = node2.getUpdatedField() and
fc.getIndirectionIndex() = 1 + indirectionIndex1 + numberOfLoads
)
or
exists(UnionContent uc | uc = c |
uc.getAField() = node2.getUpdatedField() and
uc.getIndirectionIndex() = 1 + indirectionIndex1 + numberOfLoads
)
)
}
/**
* Holds if `operandFrom` flows to `operandTo` using a sequence of conversion-like
* operations and exactly `n` `LoadInstruction` operations.
*/
private predicate numberOfLoadsFromOperandRec(Operand operandFrom, Operand operandTo, int ind) {
exists(LoadInstruction load | load.getSourceAddressOperand() = operandFrom |
operandTo = operandFrom and ind = 0
or
numberOfLoadsFromOperand(load.getAUse(), operandTo, ind - 1)
)
or
exists(Operand op, Instruction instr |
instr = op.getDef() and
conversionFlow(operandFrom, instr, _) and
numberOfLoadsFromOperand(op, operandTo, ind)
)
}
/**
* Holds if `operandFrom` flows to `operandTo` using a sequence of conversion-like
* operations and exactly `n` `LoadInstruction` operations.
*/
private predicate numberOfLoadsFromOperand(Operand operandFrom, Operand operandTo, int n) {
numberOfLoadsFromOperandRec(operandFrom, operandTo, n)
or
not any(LoadInstruction load).getSourceAddressOperand() = operandFrom and
not conversionFlow(operandFrom, _, _) and
operandFrom = operandTo and
n = 0
}
// Needed to join on both an operand and an index at the same time.
pragma[noinline]
predicate nodeHasOperand(Node node, Operand operand, int indirectionIndex) {
node.asOperand() = operand and indirectionIndex = 0
or
hasOperandAndIndex(node, operand, indirectionIndex)
}
// Needed to join on both an instruction and an index at the same time.
pragma[noinline]
predicate nodeHasInstruction(Node node, Instruction instr, int indirectionIndex) {
node.asInstruction() = instr and indirectionIndex = 0
or
hasInstructionAndIndex(node, instr, indirectionIndex)
}
/**
* Holds if data can flow from `node1` to `node2` via a read of `f`.
* Thus, `node1` references an object with a field `f` whose value ends up in
* `node2`.
*/
predicate readStep(Node node1, Content c, Node node2) {
exists(FieldAddress fa1, Operand operand, int numberOfLoads, int indirectionIndex2 |
nodeHasOperand(node2, operand, indirectionIndex2) and
nodeHasOperand(node1, fa1.getObjectAddressOperand(), _) and
numberOfLoadsFromOperand(fa1, operand, numberOfLoads)
|
exists(FieldContent fc | fc = c |
fc.getField() = fa1.getField() and
fc.getIndirectionIndex() = indirectionIndex2 + numberOfLoads
)
or
exists(UnionContent uc | uc = c |
uc.getAField() = fa1.getField() and
uc.getIndirectionIndex() = indirectionIndex2 + numberOfLoads
)
)
}
/**
* Holds if values stored inside content `c` are cleared at node `n`.
*/
predicate clearsContent(Node n, Content c) {
none() // stub implementation
}
/**
* Holds if the value that is being tracked is expected to be stored inside content `c`
* at node `n`.
*/
predicate expectsContent(Node n, ContentSet c) { none() }
/** Gets the type of `n` used for type pruning. */
DataFlowType getNodeType(Node n) {
suppressUnusedNode(n) and
result instanceof VoidType // stub implementation
}
/** Gets a string representation of a type returned by `getNodeType`. */
string ppReprType(DataFlowType t) { none() } // stub implementation
/**
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
* a node of type `t1` to a node of type `t2`.
*/
pragma[inline]
predicate compatibleTypes(DataFlowType t1, DataFlowType t2) {
any() // stub implementation
}
private predicate suppressUnusedNode(Node n) { any() }
//////////////////////////////////////////////////////////////////////////////
// Java QL library compatibility wrappers
//////////////////////////////////////////////////////////////////////////////
/** A node that performs a type cast. */
class CastNode extends Node {
CastNode() { none() } // stub implementation
}
/**
* A function that may contain code or a variable that may contain itself. When
* flow crosses from one _enclosing callable_ to another, the interprocedural
* data-flow library discards call contexts and inserts a node in the big-step
* relation used for human-readable path explanations.
*/
class DataFlowCallable = Cpp::Declaration;
class DataFlowExpr = Expr;
class DataFlowType = Type;
/** A function call relevant for data flow. */
class DataFlowCall extends CallInstruction {
Function getEnclosingCallable() { result = this.getEnclosingFunction() }
}
predicate isUnreachableInCall(Node n, DataFlowCall call) { none() } // stub implementation
int accessPathLimit() { result = 5 }
/**
* Holds if access paths with `c` at their head always should be tracked at high
* precision. This disables adaptive access path precision for such access paths.
*/
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 not n instanceof ArgumentNode }
class LambdaCallKind = Unit;
/** Holds if `creation` is an expression that creates a lambda of kind `kind` for `c`. */
predicate lambdaCreation(Node creation, LambdaCallKind kind, DataFlowCallable c) { none() }
/** Holds if `call` is a lambda call of kind `kind` where `receiver` is the lambda expression. */
predicate lambdaCall(DataFlowCall call, LambdaCallKind kind, Node receiver) { none() }
/** Extra data-flow steps needed for lambda flow analysis. */
predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preservesValue) { none() }
/**
* Holds if flow is allowed to pass from parameter `p` and back to itself as a
* side-effect, resulting in a summary from `p` to itself.
*
* One example would be to allow flow like `p.foo = p.bar;`, which is disallowed
* by default as a heuristic.
*/
predicate allowParameterReturnInSelf(ParameterNode p) { none() }
/** An approximated `Content`. */
class ContentApprox = Unit;
/** Gets an approximated value for content `c`. */
pragma[inline]
ContentApprox getContentApprox(Content c) { any() }
private class MyConsistencyConfiguration extends Consistency::ConsistencyConfiguration {
override predicate argHasPostUpdateExclude(ArgumentNode n) {
// The rules for whether an IR argument gets a post-update node are too
// complex to model here.
any()
}
}

View File

@@ -1,93 +0,0 @@
/**
* Provides predicates for mapping the `FunctionInput` and `FunctionOutput`
* classes used in function models to the corresponding instructions.
*/
private import semmle.code.cpp.ir.IR
private import experimental.semmle.code.cpp.ir.dataflow.DataFlow
private import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private import SsaInternals as Ssa
/**
* Gets the instruction that goes into `input` for `call`.
*/
DataFlow::Node callInput(CallInstruction call, FunctionInput input) {
// An argument or qualifier
exists(int index |
result.asOperand() = call.getArgumentOperand(index) and
input.isParameterOrQualifierAddress(index)
)
or
// A value pointed to by an argument or qualifier
exists(int index, int indirectionIndex |
hasOperandAndIndex(result, call.getArgumentOperand(index), indirectionIndex) and
input.isParameterDerefOrQualifierObject(index, indirectionIndex)
)
or
exists(int ind |
result = getIndirectReturnOutNode(call, ind) and
input.isReturnValueDeref(ind)
)
}
/**
* Gets the instruction that holds the `output` for `call`.
*/
Node callOutput(CallInstruction call, FunctionOutput output) {
// The return value
result.asInstruction() = call and
output.isReturnValue()
or
// The side effect of a call on the value pointed to by an argument or qualifier
exists(int index, int indirectionIndex |
result.(IndirectArgumentOutNode).getArgumentIndex() = index and
result.(IndirectArgumentOutNode).getIndirectionIndex() = indirectionIndex and
result.(IndirectArgumentOutNode).getCallInstruction() = call and
output.isParameterDerefOrQualifierObject(index, indirectionIndex)
)
or
exists(int ind |
result = getIndirectReturnOutNode(call, ind) and
output.isReturnValueDeref(ind)
)
}
DataFlow::Node callInput(CallInstruction call, FunctionInput input, int d) {
exists(DataFlow::Node n | n = callInput(call, input) and d > 0 |
// An argument or qualifier
hasOperandAndIndex(result, n.asOperand(), d)
or
exists(Operand operand, int indirectionIndex |
// A value pointed to by an argument or qualifier
hasOperandAndIndex(n, operand, indirectionIndex) and
hasOperandAndIndex(result, operand, indirectionIndex + d)
)
)
}
private IndirectReturnOutNode getIndirectReturnOutNode(CallInstruction call, int d) {
result.getCallInstruction() = call and
result.getIndirectionIndex() = d
}
/**
* Gets the instruction that holds the `output` for `call`.
*/
bindingset[d]
Node callOutput(CallInstruction call, FunctionOutput output, int d) {
exists(DataFlow::Node n | n = callOutput(call, output) and d > 0 |
// The return value
result = getIndirectReturnOutNode(n.asInstruction(), d)
or
// If there isn't an indirect out node for the call with indirection `d` then
// we conflate this with the underlying `CallInstruction`.
not exists(getIndirectReturnOutNode(call, d)) and
n.asInstruction() = result.asInstruction()
or
// The side effect of a call on the value pointed to by an argument or qualifier
exists(Operand operand, int indirectionIndex |
Ssa::outNodeHasAddressAndIndex(n, operand, indirectionIndex) and
Ssa::outNodeHasAddressAndIndex(result, operand, indirectionIndex + d)
)
)
}

View File

@@ -1,136 +0,0 @@
private import cpp
// The `ValueNumbering` library has to be imported right after `cpp` to ensure
// that the cached IR gets the same checksum here as it does in queries that use
// `ValueNumbering` without `DataFlow`.
private import semmle.code.cpp.ir.ValueNumbering
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.ir.dataflow.DataFlow
private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private import PrintIRUtilities
/**
* Gets the local dataflow from other nodes in the same function to this node.
*/
private string getFromFlow(DataFlow::Node useNode, int order1, int order2) {
exists(DataFlow::Node defNode, string prefix |
(
simpleLocalFlowStep(defNode, useNode) and prefix = ""
or
any(DataFlow::Configuration cfg).isAdditionalFlowStep(defNode, useNode) and
defNode.getEnclosingCallable() = useNode.getEnclosingCallable() and
prefix = "+"
) and
if defNode.asInstruction() = useNode.asOperand().getAnyDef()
then
// Shorthand for flow from the def of this operand.
result = prefix + "def" and
order1 = -1 and
order2 = 0
else
if defNode.asOperand().getUse() = useNode.asInstruction()
then
// Shorthand for flow from an operand of this instruction
result = prefix + defNode.asOperand().getDumpId() and
order1 = -1 and
order2 = defNode.asOperand().getDumpSortOrder()
else result = prefix + nodeId(defNode, order1, order2)
)
}
/**
* Gets the local dataflow from this node to other nodes in the same function.
*/
private string getToFlow(DataFlow::Node defNode, int order1, int order2) {
exists(DataFlow::Node useNode, string prefix |
(
simpleLocalFlowStep(defNode, useNode) and prefix = ""
or
any(DataFlow::Configuration cfg).isAdditionalFlowStep(defNode, useNode) and
defNode.getEnclosingCallable() = useNode.getEnclosingCallable() and
prefix = "+"
) and
if useNode.asInstruction() = defNode.asOperand().getUse()
then
// Shorthand for flow to this operand's instruction.
result = prefix + "result" and
order1 = -1 and
order2 = 0
else result = prefix + nodeId(useNode, order1, order2)
)
}
/**
* Gets the properties of the dataflow node `node`.
*/
private string getNodeProperty(DataFlow::Node node, string key) {
// List dataflow into and out of this node. Flow into this node is printed as `src->@`, and flow
// out of this node is printed as `@->dest`.
key = "flow" and
result =
strictconcat(string flow, boolean to, int order1, int order2 |
flow = getFromFlow(node, order1, order2) + "->@" and to = false
or
flow = "@->" + getToFlow(node, order1, order2) and to = true
|
flow, ", " order by to, order1, order2, flow
)
or
// Is this node a dataflow sink?
key = "sink" and
any(DataFlow::Configuration cfg).isSink(node) and
result = "true"
or
// Is this node a dataflow source?
key = "source" and
any(DataFlow::Configuration cfg).isSource(node) and
result = "true"
or
// Is this node a dataflow barrier, and if so, what kind?
key = "barrier" and
result =
strictconcat(string kind |
any(DataFlow::Configuration cfg).isBarrier(node) and kind = "full"
or
any(DataFlow::Configuration cfg).isBarrierIn(node) and kind = "in"
or
any(DataFlow::Configuration cfg).isBarrierOut(node) and kind = "out"
|
kind, ", "
)
or
// Is there partial flow from a source to this node?
// This property will only be emitted if partial flow is enabled by overriding
// `DataFlow::Configuration::explorationLimit()`.
key = "pflow" and
result =
strictconcat(DataFlow::PartialPathNode sourceNode, DataFlow::PartialPathNode destNode, int dist,
int order1, int order2 |
any(DataFlow::Configuration cfg).hasPartialFlow(sourceNode, destNode, dist) and
destNode.getNode() = node and
// Only print flow from a source in the same function.
sourceNode.getNode().getEnclosingCallable() = node.getEnclosingCallable()
|
nodeId(sourceNode.getNode(), order1, order2) + "+" + dist.toString(), ", "
order by
order1, order2, dist desc
)
}
/**
* Property provider for local IR dataflow.
*/
class LocalFlowPropertyProvider extends IRPropertyProvider {
override string getOperandProperty(Operand operand, string key) {
exists(DataFlow::Node node |
operand = node.asOperand() and
result = getNodeProperty(node, key)
)
}
override string getInstructionProperty(Instruction instruction, string key) {
exists(DataFlow::Node node |
instruction = node.asInstruction() and
result = getNodeProperty(node, key)
)
}
}

View File

@@ -1,33 +0,0 @@
/**
* Print the dataflow local store steps in IR dumps.
*/
private import cpp
// The `ValueNumbering` library has to be imported right after `cpp` to ensure
// that the cached IR gets the same checksum here as it does in queries that use
// `ValueNumbering` without `DataFlow`.
private import semmle.code.cpp.ir.ValueNumbering
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.ir.dataflow.DataFlow
private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private import semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate
private import PrintIRUtilities
/**
* Property provider for local IR dataflow store steps.
*/
class LocalFlowPropertyProvider extends IRPropertyProvider {
override string getInstructionProperty(Instruction instruction, string key) {
exists(DataFlow::Node objectNode, Content content |
key = "content[" + content.toString() + "]" and
instruction = objectNode.asInstruction() and
result =
strictconcat(string element, DataFlow::Node fieldNode |
storeStep(fieldNode, content, objectNode) and
element = nodeId(fieldNode, _, _)
|
element, ", "
)
)
}
}

View File

@@ -1,39 +0,0 @@
/**
* Shared utilities used when printing dataflow annotations in IR dumps.
*/
private import cpp
// The `ValueNumbering` library has to be imported right after `cpp` to ensure
// that the cached IR gets the same checksum here as it does in queries that use
// `ValueNumbering` without `DataFlow`.
private import semmle.code.cpp.ir.ValueNumbering
private import semmle.code.cpp.ir.IR
private import semmle.code.cpp.ir.dataflow.DataFlow
/**
* Gets a short ID for an IR dataflow node.
* - For `Instruction`s, this is just the result ID of the instruction (e.g. `m128`).
* - For `Operand`s, this is the label of the operand, prefixed with the result ID of the
* instruction and a dot (e.g. `m128.left`).
* - For `Variable`s, this is the qualified name of the variable.
*/
string nodeId(DataFlow::Node node, int order1, int order2) {
exists(Instruction instruction | instruction = node.asInstruction() |
result = instruction.getResultId() and
order1 = instruction.getBlock().getDisplayIndex() and
order2 = instruction.getDisplayIndexInBlock()
)
or
exists(Operand operand, Instruction instruction |
operand = node.asOperand() and
instruction = operand.getUse()
|
result = instruction.getResultId() + "." + operand.getDumpId() and
order1 = instruction.getBlock().getDisplayIndex() and
order2 = instruction.getDisplayIndexInBlock()
)
or
result = "var(" + node.asVariable().getQualifiedName() + ")" and
order1 = 1000000 and
order2 = 0
}

View File

@@ -1,552 +0,0 @@
private import codeql.ssa.Ssa as SsaImplCommon
private import semmle.code.cpp.ir.IR
private import DataFlowUtil
private import DataFlowImplCommon as DataFlowImplCommon
private import semmle.code.cpp.models.interfaces.Allocation as Alloc
private import semmle.code.cpp.models.interfaces.DataFlow as DataFlow
private import semmle.code.cpp.ir.internal.IRCppLanguage
private import DataFlowPrivate
private import ssa0.SsaInternals as SsaInternals0
import SsaInternalsCommon
private module SourceVariables {
int getMaxIndirectionForIRVariable(IRVariable var) {
exists(Type type, boolean isGLValue |
var.getLanguageType().hasType(type, isGLValue) and
if isGLValue = true
then result = 1 + getMaxIndirectionsForType(type)
else result = getMaxIndirectionsForType(type)
)
}
class BaseSourceVariable = SsaInternals0::BaseSourceVariable;
class BaseIRVariable = SsaInternals0::BaseIRVariable;
class BaseCallVariable = SsaInternals0::BaseCallVariable;
cached
private newtype TSourceVariable =
TSourceIRVariable(BaseIRVariable baseVar, int ind) {
ind = [0 .. getMaxIndirectionForIRVariable(baseVar.getIRVariable())]
} or
TCallVariable(AllocationInstruction call, int ind) {
ind = [0 .. countIndirectionsForCppType(getResultLanguageType(call))]
}
abstract class SourceVariable extends TSourceVariable {
int ind;
bindingset[ind]
SourceVariable() { any() }
abstract string toString();
int getIndirection() { result = ind }
abstract BaseSourceVariable getBaseVariable();
}
class SourceIRVariable extends SourceVariable, TSourceIRVariable {
BaseIRVariable var;
SourceIRVariable() { this = TSourceIRVariable(var, ind) }
IRVariable getIRVariable() { result = var.getIRVariable() }
override BaseIRVariable getBaseVariable() { result.getIRVariable() = this.getIRVariable() }
override string toString() {
ind = 0 and
result = this.getIRVariable().toString()
or
ind > 0 and
result = this.getIRVariable().toString() + " indirection"
}
}
class CallVariable extends SourceVariable, TCallVariable {
AllocationInstruction call;
CallVariable() { this = TCallVariable(call, ind) }
AllocationInstruction getCall() { result = call }
override BaseCallVariable getBaseVariable() { result.getCallInstruction() = call }
override string toString() {
ind = 0 and
result = "Call"
or
ind > 0 and
result = "Call indirection"
}
}
}
import SourceVariables
predicate hasIndirectOperand(Operand op, int indirectionIndex) {
exists(CppType type, int m |
not ignoreOperand(op) and
type = getLanguageType(op) and
m = countIndirectionsForCppType(type) and
indirectionIndex = [1 .. m]
)
}
predicate hasIndirectInstruction(Instruction instr, int indirectionIndex) {
exists(CppType type, int m |
not ignoreInstruction(instr) and
type = getResultLanguageType(instr) and
m = countIndirectionsForCppType(type) and
indirectionIndex = [1 .. m]
)
}
cached
private newtype TDefOrUseImpl =
TDefImpl(Operand address, int indirectionIndex) {
isDef(_, _, address, _, _, indirectionIndex) and
// We only include the definition if the SSA pruning stage
// concluded that the definition is live after the write.
any(SsaInternals0::Def def).getAddressOperand() = address
} or
TUseImpl(Operand operand, int indirectionIndex) {
isUse(_, operand, _, _, indirectionIndex) and
not isDef(_, _, operand, _, _, _)
}
abstract private class DefOrUseImpl extends TDefOrUseImpl {
/** Gets a textual representation of this element. */
abstract string toString();
/** Gets the block of this definition or use. */
abstract IRBlock getBlock();
/** Holds if this definition or use has index `index` in block `block`. */
abstract predicate hasIndexInBlock(IRBlock block, int index);
final predicate hasIndexInBlock(IRBlock block, int index, SourceVariable sv) {
this.hasIndexInBlock(block, index) and
sv = this.getSourceVariable()
}
/** Gets the location of this element. */
abstract Cpp::Location getLocation();
/**
* Gets the index (i.e., the number of loads required) of this
* definition or use.
*
* Note that this is _not_ the definition's (or use's) index in
* the enclosing basic block. To obtain this index, use
* `DefOrUseImpl::hasIndexInBlock/2` or `DefOrUseImpl::hasIndexInBlock/3`.
*/
abstract int getIndirectionIndex();
/**
* Gets the instruction that computes the base of this definition or use.
* This is always a `VariableAddressInstruction` or an `AllocationInstruction`.
*/
abstract Instruction getBase();
final BaseSourceVariable getBaseSourceVariable() {
exists(IRVariable var |
result.(BaseIRVariable).getIRVariable() = var and
instructionHasIRVariable(this.getBase(), var)
)
or
result.(BaseCallVariable).getCallInstruction() = this.getBase()
}
/** Gets the variable that is defined or used. */
final SourceVariable getSourceVariable() {
exists(BaseSourceVariable v, int ind |
sourceVariableHasBaseAndIndex(result, v, ind) and
defOrUseHasSourceVariable(this, v, ind)
)
}
}
pragma[noinline]
private predicate instructionHasIRVariable(VariableAddressInstruction vai, IRVariable var) {
vai.getIRVariable() = var
}
private predicate defOrUseHasSourceVariable(DefOrUseImpl defOrUse, BaseSourceVariable bv, int ind) {
defHasSourceVariable(defOrUse, bv, ind)
or
useHasSourceVariable(defOrUse, bv, ind)
}
pragma[noinline]
private predicate defHasSourceVariable(DefImpl def, BaseSourceVariable bv, int ind) {
bv = def.getBaseSourceVariable() and
ind = def.getIndirection()
}
pragma[noinline]
private predicate useHasSourceVariable(UseImpl use, BaseSourceVariable bv, int ind) {
bv = use.getBaseSourceVariable() and
ind = use.getIndirection()
}
pragma[noinline]
private predicate sourceVariableHasBaseAndIndex(SourceVariable v, BaseSourceVariable bv, int ind) {
v.getBaseVariable() = bv and
v.getIndirection() = ind
}
class DefImpl extends DefOrUseImpl, TDefImpl {
Operand address;
int ind;
DefImpl() { this = TDefImpl(address, ind) }
override Instruction getBase() { isDef(_, _, address, result, _, _) }
Operand getAddressOperand() { result = address }
int getIndirection() { isDef(_, _, address, _, result, ind) }
override int getIndirectionIndex() { result = ind }
Instruction getDefiningInstruction() { isDef(_, result, address, _, _, _) }
override string toString() { result = "DefImpl" }
override IRBlock getBlock() { result = this.getDefiningInstruction().getBlock() }
override Cpp::Location getLocation() { result = this.getDefiningInstruction().getLocation() }
final override predicate hasIndexInBlock(IRBlock block, int index) {
this.getDefiningInstruction() = block.getInstruction(index)
}
predicate isCertain() { isDef(true, _, address, _, _, ind) }
}
class UseImpl extends DefOrUseImpl, TUseImpl {
Operand operand;
int ind;
UseImpl() { this = TUseImpl(operand, ind) }
Operand getOperand() { result = operand }
override string toString() { result = "UseImpl" }
final override predicate hasIndexInBlock(IRBlock block, int index) {
operand.getUse() = block.getInstruction(index)
}
final override IRBlock getBlock() { result = operand.getUse().getBlock() }
final override Cpp::Location getLocation() { result = operand.getLocation() }
final int getIndirection() { isUse(_, operand, _, result, ind) }
override int getIndirectionIndex() { result = ind }
override Instruction getBase() { isUse(_, operand, result, _, ind) }
predicate isCertain() { isUse(true, operand, _, _, ind) }
}
/**
* Holds if `defOrUse1` is a definition which is first read by `use`,
* or if `defOrUse1` is a use and `use` is a next subsequent use.
*
* In both cases, `use` can either be an explicit use written in the
* source file, or it can be a phi node as computed by the SSA library.
*/
predicate adjacentDefRead(DefOrUse defOrUse1, UseOrPhi use) {
exists(IRBlock bb1, int i1, SourceVariable v |
defOrUse1.asDefOrUse().hasIndexInBlock(bb1, i1, v)
|
exists(IRBlock bb2, int i2 |
adjacentDefRead(_, pragma[only_bind_into](bb1), pragma[only_bind_into](i1),
pragma[only_bind_into](bb2), pragma[only_bind_into](i2))
|
use.asDefOrUse().(UseImpl).hasIndexInBlock(bb2, i2, v)
)
or
exists(PhiNode phi |
lastRefRedef(_, bb1, i1, phi) and
use.asPhi() = phi and
phi.getSourceVariable() = pragma[only_bind_into](v)
)
)
}
private predicate useToNode(UseOrPhi use, Node nodeTo) {
exists(UseImpl useImpl |
useImpl = use.asDefOrUse() and
nodeHasOperand(nodeTo, useImpl.getOperand(), useImpl.getIndirectionIndex())
)
or
nodeTo.(SsaPhiNode).getPhiNode() = use.asPhi()
}
pragma[noinline]
predicate outNodeHasAddressAndIndex(
IndirectArgumentOutNode out, Operand address, int indirectionIndex
) {
out.getAddressOperand() = address and
out.getIndirectionIndex() = indirectionIndex
}
private predicate defToNode(Node nodeFrom, Def def) {
nodeHasInstruction(nodeFrom, def.getDefiningInstruction(), def.getIndirectionIndex())
}
/**
* INTERNAL: Do not use.
*
* Holds if `nodeFrom` is the node that correspond to the definition or use `defOrUse`.
*/
predicate nodeToDefOrUse(Node nodeFrom, SsaDefOrUse defOrUse) {
// Node -> Def
defToNode(nodeFrom, defOrUse)
or
// Node -> Use
useToNode(defOrUse, nodeFrom)
}
/**
* Perform a single conversion-like step from `nFrom` to `nTo`. This relation
* only holds when there is no use-use relation out of `nTo`.
*/
private predicate indirectConversionFlowStep(Node nFrom, Node nTo) {
not exists(UseOrPhi defOrUse |
nodeToDefOrUse(nTo, defOrUse) and
adjacentDefRead(defOrUse, _)
) and
exists(Operand op1, Operand op2, int indirectionIndex, Instruction instr |
hasOperandAndIndex(nFrom, op1, pragma[only_bind_into](indirectionIndex)) and
hasOperandAndIndex(nTo, op2, pragma[only_bind_into](indirectionIndex)) and
instr = op2.getDef() and
conversionFlow(op1, instr, _)
)
}
/**
* The reason for this predicate is a bit annoying:
* We cannot mark a `PointerArithmeticInstruction` that computes an offset based on some SSA
* variable `x` as a use of `x` since this creates taint-flow in the following example:
* ```c
* int x = array[source]
* sink(*array)
* ```
* This is because `source` would flow from the operand of `PointerArithmeticInstruction` to the
* result of the instruction, and into the `IndirectOperand` that represents the value of `*array`.
* Then, via use-use flow, flow will arrive at `*array` in `sink(*array)`.
*
* So this predicate recurses back along conversions and `PointerArithmeticInstruction`s to find the
* first use that has provides use-use flow, and uses that target as the target of the `nodeFrom`.
*/
private predicate adjustForPointerArith(Node nodeFrom, UseOrPhi use) {
nodeFrom = any(PostUpdateNode pun).getPreUpdateNode() and
exists(DefOrUse defOrUse, Node adjusted |
indirectConversionFlowStep*(adjusted, nodeFrom) and
nodeToDefOrUse(adjusted, defOrUse) and
adjacentDefRead(defOrUse, use)
)
}
/** Holds if there is def-use or use-use flow from `nodeFrom` to `nodeTo`. */
predicate ssaFlow(Node nodeFrom, Node nodeTo) {
// `nodeFrom = any(PostUpdateNode pun).getPreUpdateNode()` is implied by adjustedForPointerArith.
exists(UseOrPhi use |
adjustForPointerArith(nodeFrom, use) and
useToNode(use, nodeTo)
)
or
not nodeFrom = any(PostUpdateNode pun).getPreUpdateNode() and
exists(DefOrUse defOrUse1, UseOrPhi use |
nodeToDefOrUse(nodeFrom, defOrUse1) and
adjacentDefRead(defOrUse1, use) and
useToNode(use, nodeTo)
)
}
/** Holds if `nodeTo` receives flow from the phi node `nodeFrom`. */
predicate fromPhiNode(SsaPhiNode nodeFrom, Node nodeTo) {
exists(PhiNode phi, SourceVariable sv, IRBlock bb1, int i1, UseOrPhi use |
phi = nodeFrom.getPhiNode() and
phi.definesAt(sv, bb1, i1) and
useToNode(use, nodeTo)
|
exists(IRBlock bb2, int i2 |
use.asDefOrUse().hasIndexInBlock(bb2, i2, sv) and
adjacentDefRead(phi, bb1, i1, bb2, i2)
)
or
exists(PhiNode phiTo |
lastRefRedef(phi, _, _, phiTo) and
nodeTo.(SsaPhiNode).getPhiNode() = phiTo
)
)
}
private SsaInternals0::SourceVariable getOldSourceVariable(SourceVariable v) {
v.getBaseVariable().(BaseIRVariable).getIRVariable() =
result.getBaseVariable().(SsaInternals0::BaseIRVariable).getIRVariable()
or
v.getBaseVariable().(BaseCallVariable).getCallInstruction() =
result.getBaseVariable().(SsaInternals0::BaseCallVariable).getCallInstruction()
}
/**
* Holds if there is a write at index `i` in basic block `bb` to variable `v` that's
* subsequently read (as determined by the SSA pruning stage).
*/
private predicate variableWriteCand(IRBlock bb, int i, SourceVariable v) {
exists(SsaInternals0::Def def, SsaInternals0::SourceVariable v0 |
def.asDefOrUse().hasIndexInBlock(bb, i, v0) and
v0 = getOldSourceVariable(v)
)
}
private module SsaInput implements SsaImplCommon::InputSig {
import InputSigCommon
import SourceVariables
/**
* Holds if the `i`'th write in block `bb` writes to the variable `v`.
* `certain` is `true` if the write is guaranteed to overwrite the entire variable.
*/
predicate variableWrite(IRBlock bb, int i, SourceVariable v, boolean certain) {
DataFlowImplCommon::forceCachingInSameStage() and
variableWriteCand(bb, i, v) and
exists(DefImpl def | def.hasIndexInBlock(bb, i, v) |
if def.isCertain() then certain = true else certain = false
)
}
/**
* Holds if the `i`'th read in block `bb` reads to the variable `v`.
* `certain` is `true` if the read is guaranteed. For C++, this is always the case.
*/
predicate variableRead(IRBlock bb, int i, SourceVariable v, boolean certain) {
exists(UseImpl use | use.hasIndexInBlock(bb, i, v) |
if use.isCertain() then certain = true else certain = false
)
}
}
/**
* The final SSA predicates used for dataflow purposes.
*/
cached
module SsaCached {
/**
* Holds if `def` is accessed at index `i1` in basic block `bb1` (either a read
* or a write), `def` is read at index `i2` in basic block `bb2`, and there is a
* path between them without any read of `def`.
*/
cached
predicate adjacentDefRead(Definition def, IRBlock bb1, int i1, IRBlock bb2, int i2) {
SsaImpl::adjacentDefRead(def, bb1, i1, bb2, i2)
}
/**
* Holds if the node at index `i` in `bb` is a last reference to SSA definition
* `def`. The reference is last because it can reach another write `next`,
* without passing through another read or write.
*/
cached
predicate lastRefRedef(Definition def, IRBlock bb, int i, Definition next) {
SsaImpl::lastRefRedef(def, bb, i, next)
}
}
cached
private newtype TSsaDefOrUse =
TDefOrUse(DefOrUseImpl defOrUse) {
defOrUse instanceof UseImpl
or
// Like in the pruning stage, we only include definition that's live after the
// write as the final definitions computed by SSA.
exists(Definition def, SourceVariable sv, IRBlock bb, int i |
def.definesAt(sv, bb, i) and
defOrUse.(DefImpl).hasIndexInBlock(bb, i, sv)
)
} or
TPhi(PhiNode phi)
abstract private class SsaDefOrUse extends TSsaDefOrUse {
string toString() { none() }
DefOrUseImpl asDefOrUse() { none() }
PhiNode asPhi() { none() }
abstract Location getLocation();
}
class DefOrUse extends TDefOrUse, SsaDefOrUse {
DefOrUseImpl defOrUse;
DefOrUse() { this = TDefOrUse(defOrUse) }
final override DefOrUseImpl asDefOrUse() { result = defOrUse }
final override Location getLocation() { result = defOrUse.getLocation() }
final SourceVariable getSourceVariable() { result = defOrUse.getSourceVariable() }
override string toString() { result = defOrUse.toString() }
}
class Phi extends TPhi, SsaDefOrUse {
PhiNode phi;
Phi() { this = TPhi(phi) }
final override PhiNode asPhi() { result = phi }
final override Location getLocation() { result = phi.getBasicBlock().getLocation() }
override string toString() { result = "Phi" }
}
class UseOrPhi extends SsaDefOrUse {
UseOrPhi() {
this.asDefOrUse() instanceof UseImpl
or
this instanceof Phi
}
final override Location getLocation() {
result = this.asDefOrUse().getLocation() or result = this.(Phi).getLocation()
}
}
class Def extends DefOrUse {
override DefImpl defOrUse;
Operand getAddressOperand() { result = defOrUse.getAddressOperand() }
Instruction getAddress() { result = this.getAddressOperand().getDef() }
/**
* This predicate ensures that joins go from `defOrUse` to the result
* instead of the other way around.
*/
pragma[inline]
int getIndirectionIndex() {
pragma[only_bind_into](result) = pragma[only_bind_out](defOrUse).getIndirectionIndex()
}
Instruction getDefiningInstruction() { result = defOrUse.getDefiningInstruction() }
}
private module SsaImpl = SsaImplCommon::Make<SsaInput>;
class PhiNode = SsaImpl::PhiNode;
class Definition = SsaImpl::Definition;
import SsaCached

View File

@@ -1,270 +0,0 @@
import cpp as Cpp
import semmle.code.cpp.ir.IR
import semmle.code.cpp.ir.internal.IRCppLanguage
private import semmle.code.cpp.ir.implementation.raw.internal.SideEffects as SideEffects
private import DataFlowImplCommon as DataFlowImplCommon
private import DataFlowUtil
/**
* Holds if `operand` is an operand that is not used by the dataflow library.
* Ignored operands are not recognizd as uses by SSA, and they don't have a
* corresponding `(Indirect)OperandNode`.
*/
predicate ignoreOperand(Operand operand) {
operand = any(Instruction instr | ignoreInstruction(instr)).getAnOperand() or
operand = any(Instruction instr | ignoreInstruction(instr)).getAUse() or
operand instanceof MemoryOperand
}
/**
* Holds if `instr` is an instruction that is not used by the dataflow library.
* Ignored instructions are not recognized as reads/writes by SSA, and they
* don't have a corresponding `(Indirect)InstructionNode`.
*/
predicate ignoreInstruction(Instruction instr) {
DataFlowImplCommon::forceCachingInSameStage() and
(
instr instanceof WriteSideEffectInstruction or
instr instanceof PhiInstruction or
instr instanceof ReadSideEffectInstruction or
instr instanceof ChiInstruction or
instr instanceof InitializeIndirectionInstruction
)
}
/**
* Gets the C++ type of `this` in the member function `f`.
* The result is a glvalue if `isGLValue` is true, and
* a prvalue if `isGLValue` is false.
*/
bindingset[isGLValue]
private CppType getThisType(Cpp::MemberFunction f, boolean isGLValue) {
result.hasType(f.getTypeOfThis(), isGLValue)
}
/**
* Gets the C++ type of the instruction `i`.
*
* This is equivalent to `i.getResultLanguageType()` with the exception
* of instructions that directly references a `this` IRVariable. In this
* case, `i.getResultLanguageType()` gives an unknown type, whereas the
* predicate gives the expected type (i.e., a potentially cv-qualified
* type `A*` where `A` is the declaring type of the member function that
* contains `i`).
*/
cached
CppType getResultLanguageType(Instruction i) {
if i.(VariableAddressInstruction).getIRVariable() instanceof IRThisVariable
then
if i.isGLValue()
then result = getThisType(i.getEnclosingFunction(), true)
else result = getThisType(i.getEnclosingFunction(), false)
else result = i.getResultLanguageType()
}
/**
* Gets the C++ type of the operand `operand`.
* This is equivalent to the type of the operand's defining instruction.
*
* See `getResultLanguageType` for a description of this behavior.
*/
CppType getLanguageType(Operand operand) { result = getResultLanguageType(operand.getDef()) }
/**
* Gets the maximum number of indirections a glvalue of type `type` can have.
* For example:
* - If `type = int`, the result is 1
* - If `type = MyStruct`, the result is 1
* - If `type = char*`, the result is 2
*/
int getMaxIndirectionsForType(Type type) {
result = countIndirectionsForCppType(getTypeForGLValue(type))
}
/**
* Gets the maximum number of indirections a value of type `type` can have.
*
* Note that this predicate is intended to be called on unspecified types
* (i.e., `countIndirections(e.getUnspecifiedType())`).
*/
private int countIndirections(Type t) {
result =
1 +
countIndirections([t.(Cpp::PointerType).getBaseType(), t.(Cpp::ReferenceType).getBaseType()])
or
not t instanceof Cpp::PointerType and
not t instanceof Cpp::ReferenceType and
result = 0
}
/**
* Gets the maximum number of indirections a value of C++
* type `langType` can have.
*/
int countIndirectionsForCppType(LanguageType langType) {
exists(Type type | langType.hasType(type, true) |
result = 1 + countIndirections(type.getUnspecifiedType())
)
or
exists(Type type | langType.hasType(type, false) |
result = countIndirections(type.getUnspecifiedType())
)
}
/**
* A `CallInstruction` that calls an allocation function such
* as `malloc` or `operator new`.
*/
class AllocationInstruction extends CallInstruction {
AllocationInstruction() { this.getStaticCallTarget() instanceof Cpp::AllocationFunction }
}
/**
* Holds if `i` is a base instruction that starts a sequence of uses
* of some variable that SSA can handle.
*
* This is either when `i` is a `VariableAddressInstruction` or when
* `i` is a fresh allocation produced by an `AllocationInstruction`.
*/
private predicate isSourceVariableBase(Instruction i) {
i instanceof VariableAddressInstruction or i instanceof AllocationInstruction
}
/**
* Holds if the value pointed to by `operand` can potentially be
* modified be the caller.
*/
predicate isModifiableByCall(ArgumentOperand operand) {
exists(CallInstruction call, int index, CppType type |
type = getLanguageType(operand) and
call.getArgumentOperand(index) = operand and
if index = -1
then not call.getStaticCallTarget() instanceof Cpp::ConstMemberFunction
else not SideEffects::isConstPointerLike(any(Type t | type.hasType(t, _)))
)
}
cached
private module Cached {
/**
* Holds if `op` is a use of an SSA variable rooted at `base` with `ind` number
* of indirections.
*
* `certain` is `true` if the operand is guaranteed to read the variable, and
* `indirectionIndex` specifies the number of loads required to read the variable.
*/
cached
predicate isUse(boolean certain, Operand op, Instruction base, int ind, int indirectionIndex) {
not ignoreOperand(op) and
certain = true and
exists(LanguageType type, int m, int ind0 |
type = getLanguageType(op) and
m = countIndirectionsForCppType(type) and
isUseImpl(op, base, ind0) and
ind = ind0 + [0 .. m] and
indirectionIndex = ind - ind0
)
}
/**
* Holds if `operand` is a use of an SSA variable rooted at `base`, and the
* path from `base` to `operand` passes through `ind` load-like instructions.
*/
private predicate isUseImpl(Operand operand, Instruction base, int ind) {
DataFlowImplCommon::forceCachingInSameStage() and
ind = 0 and
operand.getDef() = base and
isSourceVariableBase(base)
or
exists(Operand mid, Instruction instr |
isUseImpl(mid, base, ind) and
instr = operand.getDef() and
conversionFlow(mid, instr, false)
)
or
exists(int ind0 |
isUseImpl(operand.getDef().(LoadInstruction).getSourceAddressOperand(), base, ind0)
or
isUseImpl(operand.getDef().(InitializeParameterInstruction).getAnOperand(), base, ind0)
|
ind0 = ind - 1
)
}
/**
* Holds if `address` is an address of an SSA variable rooted at `base`,
* and `instr` is a definition of the SSA variable with `ind` number of indirections.
*
* `certain` is `true` if `instr` is guaranteed to write to the variable, and
* `indirectionIndex` specifies the number of loads required to read the variable
* after the write operation.
*/
cached
predicate isDef(
boolean certain, Instruction instr, Operand address, Instruction base, int ind,
int indirectionIndex
) {
certain = true and
exists(int ind0, CppType type, int m |
address =
[
instr.(StoreInstruction).getDestinationAddressOperand(),
instr.(InitializeParameterInstruction).getAnOperand(),
instr.(InitializeDynamicAllocationInstruction).getAllocationAddressOperand(),
instr.(UninitializedInstruction).getAnOperand()
]
|
isDefImpl(address, base, ind0) and
type = getLanguageType(address) and
m = countIndirectionsForCppType(type) and
ind = ind0 + [1 .. m] and
indirectionIndex = ind - (ind0 + 1)
)
}
/**
* Holds if `address` is a use of an SSA variable rooted at `base`, and the
* path from `base` to `address` passes through `ind` load-like instructions.
*
* Note: Unlike `isUseImpl`, this predicate recurses through pointer-arithmetic
* instructions.
*/
private predicate isDefImpl(Operand address, Instruction base, int ind) {
DataFlowImplCommon::forceCachingInSameStage() and
ind = 0 and
address.getDef() = base and
isSourceVariableBase(base)
or
exists(Operand mid, Instruction instr |
isDefImpl(mid, base, ind) and
instr = address.getDef() and
conversionFlow(mid, instr, _)
)
or
exists(int ind0 |
isDefImpl(address.getDef().(LoadInstruction).getSourceAddressOperand(), base, ind0)
or
isDefImpl(address.getDef().(InitializeParameterInstruction).getAnOperand(), base, ind0)
|
ind0 = ind - 1
)
}
}
import Cached
/**
* Inputs to the shared SSA library's parameterized module that is shared
* between the SSA pruning stage, and the final SSA stage.
*/
module InputSigCommon {
class BasicBlock = IRBlock;
BasicBlock getImmediateBasicBlockDominator(BasicBlock bb) { result.immediatelyDominates(bb) }
BasicBlock getABasicBlockSuccessor(BasicBlock bb) { result = bb.getASuccessor() }
class ExitBasicBlock extends IRBlock {
ExitBasicBlock() { this.getLastInstruction() instanceof ExitFunctionInstruction }
}
}

View File

@@ -1,208 +0,0 @@
private import semmle.code.cpp.ir.IR
private import experimental.semmle.code.cpp.ir.dataflow.DataFlow
private import ModelUtil
private import semmle.code.cpp.models.interfaces.DataFlow
private import semmle.code.cpp.models.interfaces.SideEffect
private import DataFlowUtil
private import DataFlowPrivate
private import semmle.code.cpp.models.Models
/**
* Holds if taint propagates from `nodeFrom` to `nodeTo` in exactly one local
* (intra-procedural) step.
*/
predicate localTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
DataFlow::localFlowStep(nodeFrom, nodeTo)
or
localAdditionalTaintStep(nodeFrom, nodeTo)
}
/**
* Holds if taint can flow in one local step from `nodeFrom` to `nodeTo` excluding
* local data flow steps. That is, `nodeFrom` and `nodeTo` are likely to represent
* different objects.
*/
cached
predicate localAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
operandToInstructionTaintStep(nodeFrom.asOperand(), nodeTo.asInstruction())
or
modeledTaintStep(nodeFrom, nodeTo)
or
// Flow from `op` to `*op`.
exists(Operand operand, int indirectionIndex |
nodeHasOperand(nodeFrom, operand, indirectionIndex) and
nodeHasOperand(nodeTo, operand, indirectionIndex - 1)
)
or
// Flow from `instr` to `*instr`.
exists(Instruction instr, int indirectionIndex |
nodeHasInstruction(nodeFrom, instr, indirectionIndex) and
nodeHasInstruction(nodeTo, instr, indirectionIndex - 1)
)
or
// Flow from (the indirection of) an operand of a pointer arithmetic instruction to the
// indirection of the pointer arithmetic instruction. This provides flow from `source`
// in `x[source]` to the result of the associated load instruction.
exists(PointerArithmeticInstruction pai, int indirectionIndex |
nodeHasOperand(nodeFrom, pai.getAnOperand(), pragma[only_bind_into](indirectionIndex)) and
hasInstructionAndIndex(nodeTo, pai, indirectionIndex + 1)
)
}
/**
* Holds if taint propagates from `nodeFrom` to `nodeTo` in exactly one local
* (intra-procedural) step.
*/
private predicate operandToInstructionTaintStep(Operand opFrom, Instruction instrTo) {
// Taint can flow through expressions that alter the value but preserve
// more than one bit of it _or_ expressions that follow data through
// pointer indirections.
instrTo.getAnOperand() = opFrom and
(
instrTo instanceof ArithmeticInstruction
or
instrTo instanceof BitwiseInstruction
or
instrTo instanceof PointerArithmeticInstruction
)
or
// The `CopyInstruction` case is also present in non-taint data flow, but
// that uses `getDef` rather than `getAnyDef`. For taint, we want flow
// from a definition of `myStruct` to a `myStruct.myField` expression.
instrTo.(LoadInstruction).getSourceAddressOperand() = opFrom
or
// Unary instructions tend to preserve enough information in practice that we
// want taint to flow through.
// The exception is `FieldAddressInstruction`. Together with the rules below for
// `LoadInstruction`s and `ChiInstruction`s, flow through `FieldAddressInstruction`
// could cause flow into one field to come out an unrelated field.
// This would happen across function boundaries, where the IR would not be able to
// match loads to stores.
instrTo.(UnaryInstruction).getUnaryOperand() = opFrom and
(
not instrTo instanceof FieldAddressInstruction
or
instrTo.(FieldAddressInstruction).getField().getDeclaringType() instanceof Union
)
}
/**
* Holds if taint may propagate from `source` to `sink` in zero or more local
* (intra-procedural) steps.
*/
pragma[inline]
predicate localTaint(DataFlow::Node source, DataFlow::Node sink) { localTaintStep*(source, sink) }
/**
* Holds if taint can flow from `i1` to `i2` in zero or more
* local (intra-procedural) steps.
*/
pragma[inline]
predicate localInstructionTaint(Instruction i1, Instruction i2) {
localTaint(DataFlow::instructionNode(i1), DataFlow::instructionNode(i2))
}
/**
* Holds if taint can flow from `e1` to `e2` in zero or more
* local (intra-procedural) steps.
*/
pragma[inline]
predicate localExprTaint(Expr e1, Expr e2) {
localTaint(DataFlow::exprNode(e1), DataFlow::exprNode(e2))
}
/**
* Holds if the additional step from `src` to `sink` should be included in all
* global taint flow configurations.
*/
predicate defaultAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink) {
localAdditionalTaintStep(src, sink)
}
/**
* Holds if default `TaintTracking::Configuration`s should allow implicit reads
* of `c` at sinks and inputs to additional taint steps.
*/
bindingset[node]
predicate defaultImplicitTaintRead(DataFlow::Node node, DataFlow::Content c) { none() }
/**
* Holds if `node` should be a sanitizer in all global taint flow configurations
* but not in local taint.
*/
predicate defaultTaintSanitizer(DataFlow::Node node) { none() }
/**
* Holds if taint can flow from `instrIn` to `instrOut` through a call to a
* modeled function.
*/
predicate modeledTaintStep(DataFlow::Node nodeIn, DataFlow::Node nodeOut) {
// Normal taint steps
exists(CallInstruction call, TaintFunction func, FunctionInput modelIn, FunctionOutput modelOut |
call.getStaticCallTarget() = func and
func.hasTaintFlow(modelIn, modelOut)
|
(
nodeIn = callInput(call, modelIn)
or
exists(int n |
modelIn.isParameterDerefOrQualifierObject(n) and
if n = -1
then nodeIn = callInput(call, any(InQualifierAddress inQualifier))
else nodeIn = callInput(call, any(InParameter inParam | inParam.getIndex() = n))
)
) and
nodeOut = callOutput(call, modelOut)
or
exists(int d |
nodeIn = callInput(call, modelIn, d)
or
exists(int n |
d = 1 and
modelIn.isParameterDerefOrQualifierObject(n) and
if n = -1
then nodeIn = callInput(call, any(InQualifierAddress inQualifier))
else nodeIn = callInput(call, any(InParameter inParam | inParam.getIndex() = n))
)
|
call.getStaticCallTarget() = func and
func.hasTaintFlow(modelIn, modelOut) and
nodeOut = callOutput(call, modelOut, d)
)
)
or
// Taint flow from one argument to another and data flow from an argument to a
// return value. This happens in functions like `strcat` and `memcpy`. We
// could model this flow in two separate steps, but that would add reverse
// flow from the write side-effect to the call instruction, which may not be
// desirable.
exists(
CallInstruction call, Function func, FunctionInput modelIn, OutParameterDeref modelMidOut,
int indexMid, InParameter modelMidIn, OutReturnValue modelOut
|
nodeIn = callInput(call, modelIn) and
nodeOut = callOutput(call, modelOut) and
call.getStaticCallTarget() = func and
func.(TaintFunction).hasTaintFlow(modelIn, modelMidOut) and
func.(DataFlowFunction).hasDataFlow(modelMidIn, modelOut) and
modelMidOut.isParameterDeref(indexMid) and
modelMidIn.isParameter(indexMid)
)
or
// Taint flow from a pointer argument to an output, when the model specifies flow from the deref
// to that output, but the deref is not modeled in the IR for the caller.
exists(
CallInstruction call, DataFlow::SideEffectOperandNode indirectArgument, Function func,
FunctionInput modelIn, FunctionOutput modelOut
|
indirectArgument = callInput(call, modelIn) and
indirectArgument.getAddressOperand() = nodeIn.asOperand() and
call.getStaticCallTarget() = func and
(
func.(DataFlowFunction).hasDataFlow(modelIn, modelOut)
or
func.(TaintFunction).hasTaintFlow(modelIn, modelOut)
) and
nodeOut = callOutput(call, modelOut)
)
}

View File

@@ -1,314 +0,0 @@
/**
* This module defines an initial SSA pruning stage that doesn't take
* indirections into account.
*/
private import codeql.ssa.Ssa as SsaImplCommon
private import semmle.code.cpp.ir.IR
private import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon as DataFlowImplCommon
private import semmle.code.cpp.models.interfaces.Allocation as Alloc
private import semmle.code.cpp.models.interfaces.DataFlow as DataFlow
private import semmle.code.cpp.ir.implementation.raw.internal.SideEffects as SideEffects
private import semmle.code.cpp.ir.internal.IRCppLanguage
private import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate
private import experimental.semmle.code.cpp.ir.dataflow.internal.DataFlowUtil
private import experimental.semmle.code.cpp.ir.dataflow.internal.SsaInternalsCommon
private module SourceVariables {
newtype TBaseSourceVariable =
// Each IR variable gets its own source variable
TBaseIRVariable(IRVariable var) or
// Each allocation gets its own source variable
TBaseCallVariable(AllocationInstruction call)
abstract class BaseSourceVariable extends TBaseSourceVariable {
abstract string toString();
abstract DataFlowType getType();
}
class BaseIRVariable extends BaseSourceVariable, TBaseIRVariable {
IRVariable var;
IRVariable getIRVariable() { result = var }
BaseIRVariable() { this = TBaseIRVariable(var) }
override string toString() { result = var.toString() }
override DataFlowType getType() { result = var.getType() }
}
class BaseCallVariable extends BaseSourceVariable, TBaseCallVariable {
AllocationInstruction call;
BaseCallVariable() { this = TBaseCallVariable(call) }
AllocationInstruction getCallInstruction() { result = call }
override string toString() { result = call.toString() }
override DataFlowType getType() { result = call.getResultType() }
}
private newtype TSourceVariable =
TSourceIRVariable(BaseIRVariable baseVar) or
TCallVariable(AllocationInstruction call)
abstract class SourceVariable extends TSourceVariable {
abstract string toString();
abstract BaseSourceVariable getBaseVariable();
}
class SourceIRVariable extends SourceVariable, TSourceIRVariable {
BaseIRVariable var;
SourceIRVariable() { this = TSourceIRVariable(var) }
IRVariable getIRVariable() { result = var.getIRVariable() }
override BaseIRVariable getBaseVariable() { result.getIRVariable() = this.getIRVariable() }
override string toString() { result = this.getIRVariable().toString() }
}
class CallVariable extends SourceVariable, TCallVariable {
AllocationInstruction call;
CallVariable() { this = TCallVariable(call) }
AllocationInstruction getCall() { result = call }
override BaseCallVariable getBaseVariable() { result.getCallInstruction() = call }
override string toString() { result = "Call" }
}
}
import SourceVariables
private newtype TDefOrUseImpl =
TDefImpl(Operand address) { isDef(_, _, address, _, _, _) } or
TUseImpl(Operand operand) {
isUse(_, operand, _, _, _) and
not isDef(_, _, operand, _, _, _)
}
abstract private class DefOrUseImpl extends TDefOrUseImpl {
/** Gets a textual representation of this element. */
abstract string toString();
/** Gets the block of this definition or use. */
abstract IRBlock getBlock();
/** Holds if this definition or use has index `index` in block `block`. */
abstract predicate hasIndexInBlock(IRBlock block, int index);
final predicate hasIndexInBlock(IRBlock block, int index, SourceVariable sv) {
this.hasIndexInBlock(block, index) and
sv = this.getSourceVariable()
}
/** Gets the location of this element. */
abstract Cpp::Location getLocation();
abstract Instruction getBase();
final BaseSourceVariable getBaseSourceVariable() {
exists(IRVariable var |
result.(BaseIRVariable).getIRVariable() = var and
instructionHasIRVariable(this.getBase(), var)
)
or
result.(BaseCallVariable).getCallInstruction() = this.getBase()
}
/** Gets the variable that is defined or used. */
final SourceVariable getSourceVariable() {
exists(BaseSourceVariable v |
sourceVariableHasBaseAndIndex(result, v) and
defOrUseHasSourceVariable(this, v)
)
}
}
pragma[noinline]
private predicate instructionHasIRVariable(VariableAddressInstruction vai, IRVariable var) {
vai.getIRVariable() = var
}
private predicate defOrUseHasSourceVariable(DefOrUseImpl defOrUse, BaseSourceVariable bv) {
defHasSourceVariable(defOrUse, bv)
or
useHasSourceVariable(defOrUse, bv)
}
pragma[noinline]
private predicate defHasSourceVariable(DefImpl def, BaseSourceVariable bv) {
bv = def.getBaseSourceVariable()
}
pragma[noinline]
private predicate useHasSourceVariable(UseImpl use, BaseSourceVariable bv) {
bv = use.getBaseSourceVariable()
}
pragma[noinline]
private predicate sourceVariableHasBaseAndIndex(SourceVariable v, BaseSourceVariable bv) {
v.getBaseVariable() = bv
}
class DefImpl extends DefOrUseImpl, TDefImpl {
Operand address;
DefImpl() { this = TDefImpl(address) }
override Instruction getBase() { isDef(_, _, address, result, _, _) }
Operand getAddressOperand() { result = address }
Instruction getDefiningInstruction() { isDef(_, result, address, _, _, _) }
override string toString() { result = address.toString() }
override IRBlock getBlock() { result = this.getDefiningInstruction().getBlock() }
override Cpp::Location getLocation() { result = this.getDefiningInstruction().getLocation() }
final override predicate hasIndexInBlock(IRBlock block, int index) {
this.getDefiningInstruction() = block.getInstruction(index)
}
predicate isCertain() { isDef(true, _, address, _, _, _) }
}
class UseImpl extends DefOrUseImpl, TUseImpl {
Operand operand;
UseImpl() { this = TUseImpl(operand) }
Operand getOperand() { result = operand }
override string toString() { result = operand.toString() }
final override predicate hasIndexInBlock(IRBlock block, int index) {
operand.getUse() = block.getInstruction(index)
}
final override IRBlock getBlock() { result = operand.getUse().getBlock() }
final override Cpp::Location getLocation() { result = operand.getLocation() }
override Instruction getBase() { isUse(_, operand, result, _, _) }
predicate isCertain() { isUse(true, operand, _, _, _) }
}
private module SsaInput implements SsaImplCommon::InputSig {
import InputSigCommon
import SourceVariables
/**
* Holds if the `i`'th write in block `bb` writes to the variable `v`.
* `certain` is `true` if the write is guaranteed to overwrite the entire variable.
*/
predicate variableWrite(IRBlock bb, int i, SourceVariable v, boolean certain) {
DataFlowImplCommon::forceCachingInSameStage() and
exists(DefImpl def | def.hasIndexInBlock(bb, i, v) |
if def.isCertain() then certain = true else certain = false
)
}
/**
* Holds if the `i`'th read in block `bb` reads to the variable `v`.
* `certain` is `true` if the read is guaranteed.
*/
predicate variableRead(IRBlock bb, int i, SourceVariable v, boolean certain) {
exists(UseImpl use | use.hasIndexInBlock(bb, i, v) |
if use.isCertain() then certain = true else certain = false
)
}
}
private newtype TSsaDefOrUse =
TDefOrUse(DefOrUseImpl defOrUse) {
defOrUse instanceof UseImpl
or
// If `defOrUse` is a definition we only include it if the
// SSA library concludes that it's live after the write.
exists(Definition def, SourceVariable sv, IRBlock bb, int i |
def.definesAt(sv, bb, i) and
defOrUse.(DefImpl).hasIndexInBlock(bb, i, sv)
)
} or
TPhi(PhiNode phi)
abstract private class SsaDefOrUse extends TSsaDefOrUse {
string toString() { result = "SsaDefOrUse" }
DefOrUseImpl asDefOrUse() { none() }
PhiNode asPhi() { none() }
abstract Location getLocation();
}
class DefOrUse extends TDefOrUse, SsaDefOrUse {
DefOrUseImpl defOrUse;
DefOrUse() { this = TDefOrUse(defOrUse) }
final override DefOrUseImpl asDefOrUse() { result = defOrUse }
final override Location getLocation() { result = defOrUse.getLocation() }
final SourceVariable getSourceVariable() { result = defOrUse.getSourceVariable() }
}
class Phi extends TPhi, SsaDefOrUse {
PhiNode phi;
Phi() { this = TPhi(phi) }
final override PhiNode asPhi() { result = phi }
final override Location getLocation() { result = phi.getBasicBlock().getLocation() }
}
class UseOrPhi extends SsaDefOrUse {
UseOrPhi() {
this.asDefOrUse() instanceof UseImpl
or
this instanceof Phi
}
final override Location getLocation() {
result = this.asDefOrUse().getLocation() or result = this.(Phi).getLocation()
}
override string toString() {
result = this.asDefOrUse().toString()
or
this instanceof Phi and
result = "Phi"
}
}
class Def extends DefOrUse {
override DefImpl defOrUse;
Operand getAddressOperand() { result = defOrUse.getAddressOperand() }
Instruction getAddress() { result = this.getAddressOperand().getDef() }
Instruction getDefiningInstruction() { result = defOrUse.getDefiningInstruction() }
override string toString() { result = this.asDefOrUse().toString() + " (def)" }
}
private module SsaImpl = SsaImplCommon::Make<SsaInput>;
class PhiNode = SsaImpl::PhiNode;
class Definition = SsaImpl::Definition;

View File

@@ -1,191 +0,0 @@
/**
* Provides an implementation of global (interprocedural) taint tracking.
* This file re-exports the local (intraprocedural) taint-tracking analysis
* from `TaintTrackingParameter::Public` and adds a global analysis, mainly
* exposed through the `Configuration` class. For some languages, this file
* exists in several identical copies, allowing queries to use multiple
* `Configuration` classes that depend on each other without introducing
* mutual recursion among those configurations.
*/
import TaintTrackingParameter::Public
private import TaintTrackingParameter::Private
/**
* A configuration of interprocedural taint tracking analysis. This defines
* sources, sinks, and any other configurable aspect of the analysis. Each
* use of the taint tracking library must define its own unique extension of
* this abstract class.
*
* A taint-tracking configuration is a special data flow configuration
* (`DataFlow::Configuration`) that allows for flow through nodes that do not
* necessarily preserve values but are still relevant from a taint tracking
* perspective. (For example, string concatenation, where one of the operands
* is tainted.)
*
* To create a configuration, extend this class with a subclass whose
* characteristic predicate is a unique singleton string. For example, write
*
* ```ql
* class MyAnalysisConfiguration extends TaintTracking::Configuration {
* MyAnalysisConfiguration() { this = "MyAnalysisConfiguration" }
* // Override `isSource` and `isSink`.
* // Optionally override `isSanitizer`.
* // Optionally override `isSanitizerIn`.
* // Optionally override `isSanitizerOut`.
* // Optionally override `isSanitizerGuard`.
* // Optionally override `isAdditionalTaintStep`.
* }
* ```
*
* Then, to query whether there is flow between some `source` and `sink`,
* write
*
* ```ql
* exists(MyAnalysisConfiguration cfg | cfg.hasFlow(source, sink))
* ```
*
* Multiple configurations can coexist, but it is unsupported to depend on
* another `TaintTracking::Configuration` or a `DataFlow::Configuration` in the
* overridden predicates that define sources, sinks, or additional steps.
* Instead, the dependency should go to a `TaintTracking2::Configuration` or a
* `DataFlow2::Configuration`, `DataFlow3::Configuration`, etc.
*/
abstract class Configuration extends DataFlow::Configuration {
bindingset[this]
Configuration() { any() }
/**
* Holds if `source` is a relevant taint source.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSource(DataFlow::Node source) { none() }
/**
* Holds if `source` is a relevant taint source with the given initial
* `state`.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSource(DataFlow::Node source, DataFlow::FlowState state) { none() }
/**
* Holds if `sink` is a relevant taint sink
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSink(DataFlow::Node sink) { none() }
/**
* Holds if `sink` is a relevant taint sink accepting `state`.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSink(DataFlow::Node sink, DataFlow::FlowState state) { none() }
/** Holds if the node `node` is a taint sanitizer. */
predicate isSanitizer(DataFlow::Node node) { none() }
final override predicate isBarrier(DataFlow::Node node) {
this.isSanitizer(node) or
defaultTaintSanitizer(node)
}
/**
* Holds if the node `node` is a taint sanitizer when the flow state is
* `state`.
*/
predicate isSanitizer(DataFlow::Node node, DataFlow::FlowState state) { none() }
final override predicate isBarrier(DataFlow::Node node, DataFlow::FlowState state) {
this.isSanitizer(node, state)
}
/** Holds if taint propagation into `node` is prohibited. */
predicate isSanitizerIn(DataFlow::Node node) { none() }
final override predicate isBarrierIn(DataFlow::Node node) { this.isSanitizerIn(node) }
/** Holds if taint propagation out of `node` is prohibited. */
predicate isSanitizerOut(DataFlow::Node node) { none() }
final override predicate isBarrierOut(DataFlow::Node node) { this.isSanitizerOut(node) }
/**
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
*
* Holds if taint propagation through nodes guarded by `guard` is prohibited.
*/
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
deprecated final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) {
this.isSanitizerGuard(guard)
}
/**
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
*
* Holds if taint propagation through nodes guarded by `guard` is prohibited
* when the flow state is `state`.
*/
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard, DataFlow::FlowState state) {
none()
}
deprecated final override predicate isBarrierGuard(
DataFlow::BarrierGuard guard, DataFlow::FlowState state
) {
this.isSanitizerGuard(guard, state)
}
/**
* Holds if taint may propagate from `node1` to `node2` in addition to the normal data-flow and taint steps.
*/
predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) { none() }
final override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
this.isAdditionalTaintStep(node1, node2) or
defaultAdditionalTaintStep(node1, node2)
}
/**
* Holds if taint may propagate from `node1` to `node2` in addition to the normal data-flow and taint steps.
* This step is only applicable in `state1` and updates the flow state to `state2`.
*/
predicate isAdditionalTaintStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
none()
}
final override predicate isAdditionalFlowStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
this.isAdditionalTaintStep(node1, state1, node2, state2)
}
override predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) {
(
this.isSink(node) or
this.isSink(node, _) or
this.isAdditionalTaintStep(node, _) or
this.isAdditionalTaintStep(node, _, _, _)
) and
defaultImplicitTaintRead(node, c)
}
/**
* Holds if taint may flow from `source` to `sink` for this configuration.
*/
// overridden to provide taint-tracking specific qldoc
override predicate hasFlow(DataFlow::Node source, DataFlow::Node sink) {
super.hasFlow(source, sink)
}
}

View File

@@ -1,5 +0,0 @@
import experimental.semmle.code.cpp.ir.dataflow.internal.TaintTrackingUtil as Public
module Private {
import experimental.semmle.code.cpp.ir.dataflow.DataFlow::DataFlow as DataFlow
}

View File

@@ -1,191 +0,0 @@
/**
* Provides an implementation of global (interprocedural) taint tracking.
* This file re-exports the local (intraprocedural) taint-tracking analysis
* from `TaintTrackingParameter::Public` and adds a global analysis, mainly
* exposed through the `Configuration` class. For some languages, this file
* exists in several identical copies, allowing queries to use multiple
* `Configuration` classes that depend on each other without introducing
* mutual recursion among those configurations.
*/
import TaintTrackingParameter::Public
private import TaintTrackingParameter::Private
/**
* A configuration of interprocedural taint tracking analysis. This defines
* sources, sinks, and any other configurable aspect of the analysis. Each
* use of the taint tracking library must define its own unique extension of
* this abstract class.
*
* A taint-tracking configuration is a special data flow configuration
* (`DataFlow::Configuration`) that allows for flow through nodes that do not
* necessarily preserve values but are still relevant from a taint tracking
* perspective. (For example, string concatenation, where one of the operands
* is tainted.)
*
* To create a configuration, extend this class with a subclass whose
* characteristic predicate is a unique singleton string. For example, write
*
* ```ql
* class MyAnalysisConfiguration extends TaintTracking::Configuration {
* MyAnalysisConfiguration() { this = "MyAnalysisConfiguration" }
* // Override `isSource` and `isSink`.
* // Optionally override `isSanitizer`.
* // Optionally override `isSanitizerIn`.
* // Optionally override `isSanitizerOut`.
* // Optionally override `isSanitizerGuard`.
* // Optionally override `isAdditionalTaintStep`.
* }
* ```
*
* Then, to query whether there is flow between some `source` and `sink`,
* write
*
* ```ql
* exists(MyAnalysisConfiguration cfg | cfg.hasFlow(source, sink))
* ```
*
* Multiple configurations can coexist, but it is unsupported to depend on
* another `TaintTracking::Configuration` or a `DataFlow::Configuration` in the
* overridden predicates that define sources, sinks, or additional steps.
* Instead, the dependency should go to a `TaintTracking2::Configuration` or a
* `DataFlow2::Configuration`, `DataFlow3::Configuration`, etc.
*/
abstract class Configuration extends DataFlow::Configuration {
bindingset[this]
Configuration() { any() }
/**
* Holds if `source` is a relevant taint source.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSource(DataFlow::Node source) { none() }
/**
* Holds if `source` is a relevant taint source with the given initial
* `state`.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSource(DataFlow::Node source, DataFlow::FlowState state) { none() }
/**
* Holds if `sink` is a relevant taint sink
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSink(DataFlow::Node sink) { none() }
/**
* Holds if `sink` is a relevant taint sink accepting `state`.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSink(DataFlow::Node sink, DataFlow::FlowState state) { none() }
/** Holds if the node `node` is a taint sanitizer. */
predicate isSanitizer(DataFlow::Node node) { none() }
final override predicate isBarrier(DataFlow::Node node) {
this.isSanitizer(node) or
defaultTaintSanitizer(node)
}
/**
* Holds if the node `node` is a taint sanitizer when the flow state is
* `state`.
*/
predicate isSanitizer(DataFlow::Node node, DataFlow::FlowState state) { none() }
final override predicate isBarrier(DataFlow::Node node, DataFlow::FlowState state) {
this.isSanitizer(node, state)
}
/** Holds if taint propagation into `node` is prohibited. */
predicate isSanitizerIn(DataFlow::Node node) { none() }
final override predicate isBarrierIn(DataFlow::Node node) { this.isSanitizerIn(node) }
/** Holds if taint propagation out of `node` is prohibited. */
predicate isSanitizerOut(DataFlow::Node node) { none() }
final override predicate isBarrierOut(DataFlow::Node node) { this.isSanitizerOut(node) }
/**
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
*
* Holds if taint propagation through nodes guarded by `guard` is prohibited.
*/
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
deprecated final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) {
this.isSanitizerGuard(guard)
}
/**
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
*
* Holds if taint propagation through nodes guarded by `guard` is prohibited
* when the flow state is `state`.
*/
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard, DataFlow::FlowState state) {
none()
}
deprecated final override predicate isBarrierGuard(
DataFlow::BarrierGuard guard, DataFlow::FlowState state
) {
this.isSanitizerGuard(guard, state)
}
/**
* Holds if taint may propagate from `node1` to `node2` in addition to the normal data-flow and taint steps.
*/
predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) { none() }
final override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
this.isAdditionalTaintStep(node1, node2) or
defaultAdditionalTaintStep(node1, node2)
}
/**
* Holds if taint may propagate from `node1` to `node2` in addition to the normal data-flow and taint steps.
* This step is only applicable in `state1` and updates the flow state to `state2`.
*/
predicate isAdditionalTaintStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
none()
}
final override predicate isAdditionalFlowStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
this.isAdditionalTaintStep(node1, state1, node2, state2)
}
override predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) {
(
this.isSink(node) or
this.isSink(node, _) or
this.isAdditionalTaintStep(node, _) or
this.isAdditionalTaintStep(node, _, _, _)
) and
defaultImplicitTaintRead(node, c)
}
/**
* Holds if taint may flow from `source` to `sink` for this configuration.
*/
// overridden to provide taint-tracking specific qldoc
override predicate hasFlow(DataFlow::Node source, DataFlow::Node sink) {
super.hasFlow(source, sink)
}
}

View File

@@ -1,5 +0,0 @@
import experimental.semmle.code.cpp.ir.dataflow.internal.TaintTrackingUtil as Public
module Private {
import experimental.semmle.code.cpp.ir.dataflow.DataFlow2::DataFlow2 as DataFlow
}

View File

@@ -1,191 +0,0 @@
/**
* Provides an implementation of global (interprocedural) taint tracking.
* This file re-exports the local (intraprocedural) taint-tracking analysis
* from `TaintTrackingParameter::Public` and adds a global analysis, mainly
* exposed through the `Configuration` class. For some languages, this file
* exists in several identical copies, allowing queries to use multiple
* `Configuration` classes that depend on each other without introducing
* mutual recursion among those configurations.
*/
import TaintTrackingParameter::Public
private import TaintTrackingParameter::Private
/**
* A configuration of interprocedural taint tracking analysis. This defines
* sources, sinks, and any other configurable aspect of the analysis. Each
* use of the taint tracking library must define its own unique extension of
* this abstract class.
*
* A taint-tracking configuration is a special data flow configuration
* (`DataFlow::Configuration`) that allows for flow through nodes that do not
* necessarily preserve values but are still relevant from a taint tracking
* perspective. (For example, string concatenation, where one of the operands
* is tainted.)
*
* To create a configuration, extend this class with a subclass whose
* characteristic predicate is a unique singleton string. For example, write
*
* ```ql
* class MyAnalysisConfiguration extends TaintTracking::Configuration {
* MyAnalysisConfiguration() { this = "MyAnalysisConfiguration" }
* // Override `isSource` and `isSink`.
* // Optionally override `isSanitizer`.
* // Optionally override `isSanitizerIn`.
* // Optionally override `isSanitizerOut`.
* // Optionally override `isSanitizerGuard`.
* // Optionally override `isAdditionalTaintStep`.
* }
* ```
*
* Then, to query whether there is flow between some `source` and `sink`,
* write
*
* ```ql
* exists(MyAnalysisConfiguration cfg | cfg.hasFlow(source, sink))
* ```
*
* Multiple configurations can coexist, but it is unsupported to depend on
* another `TaintTracking::Configuration` or a `DataFlow::Configuration` in the
* overridden predicates that define sources, sinks, or additional steps.
* Instead, the dependency should go to a `TaintTracking2::Configuration` or a
* `DataFlow2::Configuration`, `DataFlow3::Configuration`, etc.
*/
abstract class Configuration extends DataFlow::Configuration {
bindingset[this]
Configuration() { any() }
/**
* Holds if `source` is a relevant taint source.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSource(DataFlow::Node source) { none() }
/**
* Holds if `source` is a relevant taint source with the given initial
* `state`.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSource(DataFlow::Node source, DataFlow::FlowState state) { none() }
/**
* Holds if `sink` is a relevant taint sink
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSink(DataFlow::Node sink) { none() }
/**
* Holds if `sink` is a relevant taint sink accepting `state`.
*
* The smaller this predicate is, the faster `hasFlow()` will converge.
*/
// overridden to provide taint-tracking specific qldoc
override predicate isSink(DataFlow::Node sink, DataFlow::FlowState state) { none() }
/** Holds if the node `node` is a taint sanitizer. */
predicate isSanitizer(DataFlow::Node node) { none() }
final override predicate isBarrier(DataFlow::Node node) {
this.isSanitizer(node) or
defaultTaintSanitizer(node)
}
/**
* Holds if the node `node` is a taint sanitizer when the flow state is
* `state`.
*/
predicate isSanitizer(DataFlow::Node node, DataFlow::FlowState state) { none() }
final override predicate isBarrier(DataFlow::Node node, DataFlow::FlowState state) {
this.isSanitizer(node, state)
}
/** Holds if taint propagation into `node` is prohibited. */
predicate isSanitizerIn(DataFlow::Node node) { none() }
final override predicate isBarrierIn(DataFlow::Node node) { this.isSanitizerIn(node) }
/** Holds if taint propagation out of `node` is prohibited. */
predicate isSanitizerOut(DataFlow::Node node) { none() }
final override predicate isBarrierOut(DataFlow::Node node) { this.isSanitizerOut(node) }
/**
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
*
* Holds if taint propagation through nodes guarded by `guard` is prohibited.
*/
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
deprecated final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) {
this.isSanitizerGuard(guard)
}
/**
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
*
* Holds if taint propagation through nodes guarded by `guard` is prohibited
* when the flow state is `state`.
*/
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard, DataFlow::FlowState state) {
none()
}
deprecated final override predicate isBarrierGuard(
DataFlow::BarrierGuard guard, DataFlow::FlowState state
) {
this.isSanitizerGuard(guard, state)
}
/**
* Holds if taint may propagate from `node1` to `node2` in addition to the normal data-flow and taint steps.
*/
predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) { none() }
final override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
this.isAdditionalTaintStep(node1, node2) or
defaultAdditionalTaintStep(node1, node2)
}
/**
* Holds if taint may propagate from `node1` to `node2` in addition to the normal data-flow and taint steps.
* This step is only applicable in `state1` and updates the flow state to `state2`.
*/
predicate isAdditionalTaintStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
none()
}
final override predicate isAdditionalFlowStep(
DataFlow::Node node1, DataFlow::FlowState state1, DataFlow::Node node2,
DataFlow::FlowState state2
) {
this.isAdditionalTaintStep(node1, state1, node2, state2)
}
override predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet c) {
(
this.isSink(node) or
this.isSink(node, _) or
this.isAdditionalTaintStep(node, _) or
this.isAdditionalTaintStep(node, _, _, _)
) and
defaultImplicitTaintRead(node, c)
}
/**
* Holds if taint may flow from `source` to `sink` for this configuration.
*/
// overridden to provide taint-tracking specific qldoc
override predicate hasFlow(DataFlow::Node source, DataFlow::Node sink) {
super.hasFlow(source, sink)
}
}

View File

@@ -1,5 +0,0 @@
import experimental.semmle.code.cpp.ir.dataflow.internal.TaintTrackingUtil as Public
module Private {
import experimental.semmle.code.cpp.ir.dataflow.DataFlow3::DataFlow3 as DataFlow
}

View File

@@ -218,7 +218,7 @@ private predicate allocation(Instruction array, Length length, int delta) {
length.(VNLength).getInstruction().getConvertedResultExpression() = lengthExpr
)
or
not exists(int d | deconstructMallocSizeExpr(alloc.getSizeExpr(), _, d)) and
not deconstructMallocSizeExpr(alloc.getSizeExpr(), _, _) and
length.(VNLength).getInstruction().getConvertedResultExpression() = alloc.getSizeExpr() and
delta = 0
)

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

@@ -543,9 +543,7 @@ private predicate boundedPhiCand(
PhiInstruction phi, boolean upper, Bound b, int delta, boolean fromBackEdge, int origdelta,
Reason reason
) {
exists(PhiInputOperand op |
boundedPhiInp(phi, op, b, delta, upper, fromBackEdge, origdelta, reason)
)
boundedPhiInp(phi, _, b, delta, upper, fromBackEdge, origdelta, reason)
}
/**

View File

@@ -0,0 +1,263 @@
private import cpp
private import experimental.semmle.code.cpp.models.interfaces.SimpleRangeAnalysisExpr
private import semmle.code.cpp.rangeanalysis.RangeAnalysisUtils
float evaluateConstantExpr(Expr e) {
result = e.getValue().toFloat()
or
// This handles when a constant value is put into a variable
// and the variable is used later
exists(SsaDefinition defn, StackVariable sv |
defn.getAUse(sv) = e and
result = defn.getDefiningValue(sv).getValue().toFloat()
)
}
// If the constant right operand is negative or is greater than or equal to the number of
// bits in the left operands type, then the result is undefined (except on the IA-32
// architecture where the shift value is masked with 0b00011111, but we can't
// assume the architecture).
bindingset[val]
private predicate isValidShiftExprShift(float val, Expr l) {
val >= 0 and
// We use getFullyConverted because the spec says to use the *promoted* left operand
val < (l.getFullyConverted().getUnderlyingType().getSize() * 8)
}
bindingset[val, shift, max_val]
private predicate canLShiftOverflow(int val, int shift, int max_val) {
// val << shift = val * 2^shift > max_val => val > max_val/2^shift = max_val >> b
val > max_val.bitShiftRight(shift)
}
/**
* A range analysis expression consisting of the `>>` or `>>=` operator when at least
* one operand is a constant (and if the right operand is a constant, it must be "valid"
* (see `isValidShiftExprShift`)). When handling any undefined behavior, it leaves the
* values unconstrained. From the C++ standard: "The behavior is undefined if the right
* operand is negative, or greater than or equal to the length in bits of the promoted
* left operand. The value of E1 >> E2 is E1 right-shifted E2 bit positions. If E1 has an
* unsigned type or if E1 has a signed type and a non-negative value, the value of the
* result is the integral part of the quotient of E1/2^E2. If E1 has a signed type and a
* negative value, the resulting value is implementation-defined."
*/
class ConstantRShiftExprRange extends SimpleRangeAnalysisExpr {
/**
* Holds for `a >> b` or `a >>= b` in one of the following two cases:
* 1. `a` is a constant and `b` is not
* 2. `b` is constant
*
* We don't handle the case where `a` and `b` are both non-constant values.
*/
ConstantRShiftExprRange() {
getUnspecifiedType() instanceof IntegralType and
exists(Expr l, Expr r |
l = this.(RShiftExpr).getLeftOperand() and
r = this.(RShiftExpr).getRightOperand()
or
l = this.(AssignRShiftExpr).getLValue() and
r = this.(AssignRShiftExpr).getRValue()
|
l.getUnspecifiedType() instanceof IntegralType and
r.getUnspecifiedType() instanceof IntegralType and
(
// If the left operand is a constant, verify that the right operand is not a constant
exists(evaluateConstantExpr(l)) and not exists(evaluateConstantExpr(r))
or
// If the right operand is a constant, check if it is a valid shift expression
exists(float constROp |
constROp = evaluateConstantExpr(r) and isValidShiftExprShift(constROp, l)
)
)
)
}
Expr getLeftOperand() {
result = this.(RShiftExpr).getLeftOperand() or
result = this.(AssignRShiftExpr).getLValue()
}
Expr getRightOperand() {
result = this.(RShiftExpr).getRightOperand() or
result = this.(AssignRShiftExpr).getRValue()
}
override float getLowerBounds() {
exists(int lLower, int lUpper, int rLower, int rUpper |
lLower = getFullyConvertedLowerBounds(getLeftOperand()) and
lUpper = getFullyConvertedUpperBounds(getLeftOperand()) and
rLower = getFullyConvertedLowerBounds(getRightOperand()) and
rUpper = getFullyConvertedUpperBounds(getRightOperand()) and
lLower <= lUpper and
rLower <= rUpper
|
if
lLower < 0
or
not (
isValidShiftExprShift(rLower, getLeftOperand()) and
isValidShiftExprShift(rUpper, getLeftOperand())
)
then
// We don't want to deal with shifting negative numbers at the moment,
// and a negative shift is implementation defined, so we set the result
// to the minimum value
result = exprMinVal(this)
else
// We can get the smallest value by shifting the smallest bound by the largest bound
result = lLower.bitShiftRight(rUpper)
)
}
override float getUpperBounds() {
exists(int lLower, int lUpper, int rLower, int rUpper |
lLower = getFullyConvertedLowerBounds(getLeftOperand()) and
lUpper = getFullyConvertedUpperBounds(getLeftOperand()) and
rLower = getFullyConvertedLowerBounds(getRightOperand()) and
rUpper = getFullyConvertedUpperBounds(getRightOperand()) and
lLower <= lUpper and
rLower <= rUpper
|
if
lLower < 0
or
not (
isValidShiftExprShift(rLower, getLeftOperand()) and
isValidShiftExprShift(rUpper, getLeftOperand())
)
then
// We don't want to deal with shifting negative numbers at the moment,
// and a negative shift is implementation defined, so we set the result
// to the maximum value
result = exprMaxVal(this)
else
// We can get the largest value by shifting the largest bound by the smallest bound
result = lUpper.bitShiftRight(rLower)
)
}
override predicate dependsOnChild(Expr child) {
child = getLeftOperand() or child = getRightOperand()
}
}
/**
* A range analysis expression consisting of the `<<` or `<<=` operator when at least
* one operand is a constant (and if the right operand is a constant, it must be "valid"
* (see `isValidShiftExprShift`)). When handling any undefined behavior, it leaves the
* values unconstrained. From the C++ standard: "The behavior is undefined if the right
* operand is negative, or greater than or equal to the length in bits of the promoted left operand.
* The value of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are zero-filled. If E1
* has an unsigned type, the value of the result is E1 x 2 E2, reduced modulo one more than the
* maximum value representable in the result type. Otherwise, if E1 has a signed type and
* non-negative value, and E1 x 2 E2 is representable in the corresponding unsigned type of the
* result type, then that value, converted to the result type, is the resulting value; otherwise,
* the behavior is undefined."
*/
class ConstantLShiftExprRange extends SimpleRangeAnalysisExpr {
/**
* Holds for `a << b` or `a <<= b` in one of the following two cases:
* 1. `a` is a constant and `b` is not
* 2. `b` is constant
*
* We don't handle the case where `a` and `b` are both non-constant values.
*/
ConstantLShiftExprRange() {
getUnspecifiedType() instanceof IntegralType and
exists(Expr l, Expr r |
l = this.(LShiftExpr).getLeftOperand() and
r = this.(LShiftExpr).getRightOperand()
or
l = this.(AssignLShiftExpr).getLValue() and
r = this.(AssignLShiftExpr).getRValue()
|
l.getUnspecifiedType() instanceof IntegralType and
r.getUnspecifiedType() instanceof IntegralType and
(
// If the left operand is a constant, verify that the right operand is not a constant
exists(evaluateConstantExpr(l)) and not exists(evaluateConstantExpr(r))
or
// If the right operand is a constant, check if it is a valid shift expression
exists(float constROp |
constROp = evaluateConstantExpr(r) and isValidShiftExprShift(constROp, l)
)
)
)
}
Expr getLeftOperand() {
result = this.(LShiftExpr).getLeftOperand() or
result = this.(AssignLShiftExpr).getLValue()
}
Expr getRightOperand() {
result = this.(LShiftExpr).getRightOperand() or
result = this.(AssignLShiftExpr).getRValue()
}
override float getLowerBounds() {
exists(int lLower, int lUpper, int rLower, int rUpper |
lLower = getFullyConvertedLowerBounds(getLeftOperand()) and
lUpper = getFullyConvertedUpperBounds(getLeftOperand()) and
rLower = getFullyConvertedLowerBounds(getRightOperand()) and
rUpper = getFullyConvertedUpperBounds(getRightOperand()) and
lLower <= lUpper and
rLower <= rUpper
|
if
lLower < 0
or
not (
isValidShiftExprShift(rLower, getLeftOperand()) and
isValidShiftExprShift(rUpper, getLeftOperand())
)
then
// We don't want to deal with shifting negative numbers at the moment,
// and a negative shift is undefined, so we set to the minimum value
result = exprMinVal(this)
else
// If we have `0b01010000 << [0, 2]`, the max value for 8 bits is 0b10100000
// (a shift of 1) but doing a shift by the upper bound would give 0b01000000.
// So if the left shift operation causes an overflow, we just assume the max value
// If necessary, we may be able to improve this bound in the future
if canLShiftOverflow(lUpper, rUpper, exprMaxVal(this))
then result = exprMinVal(this)
else result = lLower.bitShiftLeft(rLower)
)
}
override float getUpperBounds() {
exists(int lLower, int lUpper, int rLower, int rUpper |
lLower = getFullyConvertedLowerBounds(getLeftOperand()) and
lUpper = getFullyConvertedUpperBounds(getLeftOperand()) and
rLower = getFullyConvertedLowerBounds(getRightOperand()) and
rUpper = getFullyConvertedUpperBounds(getRightOperand()) and
lLower <= lUpper and
rLower <= rUpper
|
if
lLower < 0
or
not (
isValidShiftExprShift(rLower, getLeftOperand()) and
isValidShiftExprShift(rUpper, getLeftOperand())
)
then
// We don't want to deal with shifting negative numbers at the moment,
// and a negative shift is undefined, so we set it to the maximum value
result = exprMaxVal(this)
else
// If we have `0b01010000 << [0, 2]`, the max value for 8 bits is 0b10100000
// (a shift of 1) but doing a shift by the upper bound would give 0b01000000.
// So if the left shift operation causes an overflow, we just assume the max value
// If necessary, we may be able to improve this bound in the future
if canLShiftOverflow(lUpper, rUpper, exprMaxVal(this))
then result = exprMaxVal(this)
else result = lUpper.bitShiftLeft(rUpper)
)
}
override predicate dependsOnChild(Expr child) {
child = getLeftOperand() or child = getRightOperand()
}
}

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

@@ -3,7 +3,7 @@
*/
import cpp
import semmle.code.cpp.dataflow.TaintTracking
import semmle.code.cpp.ir.dataflow.TaintTracking
import semmle.code.cpp.security.PrivateData
import semmle.code.cpp.security.FileWrite
import semmle.code.cpp.security.BufferWrite
@@ -36,7 +36,7 @@ module PrivateCleartextWrite {
}
}
class WriteConfig extends TaintTracking::Configuration {
deprecated class WriteConfig extends TaintTracking::Configuration {
WriteConfig() { this = "Write configuration" }
override predicate isSource(DataFlow::Node source) { source instanceof Source }
@@ -46,6 +46,16 @@ module PrivateCleartextWrite {
override predicate isSanitizer(DataFlow::Node node) { node instanceof Sanitizer }
}
private module WriteConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { source instanceof Source }
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
}
module WriteFlow = TaintTracking::Global<WriteConfig>;
class PrivateDataSource extends Source {
PrivateDataSource() { this.getExpr() instanceof PrivateDataExpr }
}

View File

@@ -1,356 +0,0 @@
/**
* C++-specific implementation of the semantic interface.
*/
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 semmle.code.cpp.controlflow.IRGuards as IRGuards
private import semmle.code.cpp.ir.ValueNumbering
module SemanticExprConfig {
class Location = Cpp::Location;
class Expr = IR::Instruction;
SemBasicBlock getExprBasicBlock(Expr e) { result = getSemanticBasicBlock(e.getBlock()) }
private predicate anyConstantExpr(Expr expr, SemType type, string value) {
exists(IR::ConstantInstruction instr | instr = expr |
type = getSemanticType(instr.getResultIRType()) and
value = instr.getValue()
)
}
predicate integerLiteral(Expr expr, SemIntegerType type, int value) {
exists(string valueString |
anyConstantExpr(expr, type, valueString) and
value = valueString.toInt()
)
}
predicate largeIntegerLiteral(Expr expr, SemIntegerType type, float approximateFloatValue) {
exists(string valueString |
anyConstantExpr(expr, type, valueString) and
not exists(valueString.toInt()) and
approximateFloatValue = valueString.toFloat()
)
}
predicate floatingPointLiteral(Expr expr, SemFloatingPointType type, float value) {
exists(string valueString |
anyConstantExpr(expr, type, valueString) and value = valueString.toFloat()
)
}
predicate booleanLiteral(Expr expr, SemBooleanType type, boolean value) {
exists(string valueString |
anyConstantExpr(expr, type, valueString) and
(
valueString = "true" and value = true
or
valueString = "false" and value = false
)
)
}
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
}
predicate binaryExpr(Expr expr, Opcode opcode, SemType type, Expr leftOperand, Expr rightOperand) {
exists(IR::BinaryInstruction instr | instr = expr |
type = getSemanticType(instr.getResultIRType()) and
leftOperand = instr.getLeft() and
rightOperand = 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
)
)
}
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
opcode instanceof Opcode::InitializeParameter
)
}
predicate conditionalExpr(
Expr expr, SemType type, Expr condition, Expr trueResult, Expr falseResult
) {
none()
}
SemType getUnknownExprType(Expr expr) { result = getSemanticType(expr.getResultIRType()) }
class BasicBlock = IR::IRBlock;
predicate bbDominates(BasicBlock dominator, BasicBlock dominated) {
dominator.dominates(dominated)
}
predicate hasDominanceInformation(BasicBlock block) { any() }
private predicate id(Cpp::Locatable x, Cpp::Locatable y) { x = y }
private predicate idOf(Cpp::Locatable x, int y) = equivalenceRelation(id/2)(x, y)
int getBasicBlockUniqueId(BasicBlock block) { idOf(block.getFirstInstruction().getAst(), result) }
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() |
g.comparesLt(use, _, _, _, _) or
g.comparesLt(_, use, _, _, _) or
g.comparesEq(use, _, _, _, _) or
g.comparesEq(_, use, _, _, _)
)
}
class SsaVariable extends TSsaVariable {
string toString() { none() }
Location getLocation() { none() }
IR::Instruction asInstruction() { none() }
IR::PointerArithmeticInstruction asPointerArithGuard() { none() }
IR::Operand asOperand() { none() }
}
class SsaInstructionVariable extends SsaVariable, TSsaInstruction {
IR::Instruction instr;
SsaInstructionVariable() { this = TSsaInstruction(instr) }
final override string toString() { result = instr.toString() }
final override Location getLocation() { result = instr.getLocation() }
final override IR::Instruction asInstruction() { result = instr }
}
class SsaPointerArithmeticGuard extends SsaVariable, TSsaPointerArithmeticGuard {
IR::PointerArithmeticInstruction instr;
SsaPointerArithmeticGuard() { this = TSsaPointerArithmeticGuard(instr) }
final override string toString() { result = instr.toString() }
final override Location getLocation() { result = instr.getLocation() }
final override IR::PointerArithmeticInstruction asPointerArithGuard() { result = instr }
}
class SsaOperand extends SsaVariable, TSsaOperand {
IR::Operand op;
SsaOperand() { this = TSsaOperand(op) }
final override string toString() { result = op.toString() }
final override Location getLocation() { result = op.getLocation() }
final override IR::Operand asOperand() { result = op }
}
predicate explicitUpdate(SsaVariable v, Expr sourceExpr) { v.asInstruction() = sourceExpr }
predicate phi(SsaVariable v) { v.asInstruction() instanceof IR::PhiInstruction }
SsaVariable getAPhiInput(SsaVariable v) {
exists(IR::PhiInstruction instr | v.asInstruction() = instr |
result.asInstruction() = instr.getAnInput()
or
result.asOperand() = instr.getAnInputOperand()
)
}
Expr getAUse(SsaVariable v) {
result.(IR::LoadInstruction).getSourceValue() = v.asInstruction()
or
result = valueNumber(v.asPointerArithGuard()).getAnInstruction()
}
SemType getSsaVariableType(SsaVariable v) {
result = getSemanticType(v.asInstruction().getResultIRType())
}
BasicBlock getSsaVariableBasicBlock(SsaVariable v) {
result = v.asInstruction().getBlock()
or
result = v.asOperand().getUse().getBlock()
}
private newtype TReadPosition =
TReadPositionBlock(IR::IRBlock block) or
TReadPositionPhiInputEdge(IR::IRBlock pred, IR::IRBlock succ) {
exists(IR::PhiInputOperand input |
pred = input.getPredecessorBlock() and
succ = input.getUse().getBlock()
)
}
class SsaReadPosition extends TReadPosition {
string toString() { none() }
Location getLocation() { none() }
predicate hasRead(SsaVariable v) { none() }
}
private class SsaReadPositionBlock extends SsaReadPosition, TReadPositionBlock {
IR::IRBlock block;
SsaReadPositionBlock() { this = TReadPositionBlock(block) }
final override string toString() { result = block.toString() }
final override Location getLocation() { result = block.getLocation() }
final override predicate hasRead(SsaVariable v) {
exists(IR::Operand operand |
operand.getDef() = v.asInstruction() or
operand.getDef() = valueNumber(v.asPointerArithGuard()).getAnInstruction()
|
not operand instanceof IR::PhiInputOperand and
operand.getUse().getBlock() = block
)
}
}
private class SsaReadPositionPhiInputEdge extends SsaReadPosition, TReadPositionPhiInputEdge {
IR::IRBlock pred;
IR::IRBlock succ;
SsaReadPositionPhiInputEdge() { this = TReadPositionPhiInputEdge(pred, succ) }
final override string toString() { result = pred.toString() + "->" + succ.toString() }
final override Location getLocation() { result = succ.getLocation() }
final override predicate hasRead(SsaVariable v) {
exists(IR::PhiInputOperand operand |
operand.getDef() = v.asInstruction() or
operand.getDef() = valueNumber(v.asPointerArithGuard()).getAnInstruction()
|
operand.getPredecessorBlock() = pred and
operand.getUse().getBlock() = succ
)
}
}
predicate hasReadOfSsaVariable(SsaReadPosition pos, SsaVariable v) { pos.hasRead(v) }
predicate readBlock(SsaReadPosition pos, BasicBlock block) { pos = TReadPositionBlock(block) }
predicate phiInputEdge(SsaReadPosition pos, BasicBlock origBlock, BasicBlock phiBlock) {
pos = TReadPositionPhiInputEdge(origBlock, phiBlock)
}
predicate phiInput(SsaReadPosition pos, SsaVariable phi, SsaVariable input) {
exists(IR::PhiInputOperand operand |
pos = TReadPositionPhiInputEdge(operand.getPredecessorBlock(), operand.getUse().getBlock())
|
phi.asInstruction() = operand.getUse() and
(
input.asInstruction() = operand.getDef()
or
input.asOperand() = operand
)
)
}
class Bound instanceof IRBound::Bound {
string toString() { result = super.toString() }
final Location getLocation() { result = super.getLocation() }
}
private class ValueNumberBound extends Bound instanceof IRBound::ValueNumberBound {
override string toString() { result = IRBound::ValueNumberBound.super.toString() }
}
predicate zeroBound(Bound bound) { bound instanceof IRBound::ZeroBound }
predicate ssaBound(Bound bound, SsaVariable v) {
v.asInstruction() = bound.(IRBound::ValueNumberBound).getValueNumber().getAnInstruction()
}
Expr getBoundExpr(Bound bound, int delta) {
result = bound.(IRBound::Bound).getInstruction(delta)
}
class Guard = IRGuards::IRGuardCondition;
predicate guard(Guard guard, BasicBlock block) { block = guard.getBlock() }
Expr getGuardAsExpr(Guard guard) { result = guard }
predicate equalityGuard(Guard guard, Expr e1, Expr e2, boolean polarity) {
guard.comparesEq(e1.getAUse(), e2.getAUse(), 0, true, polarity)
}
predicate guardDirectlyControlsBlock(Guard guard, BasicBlock controlled, boolean branch) {
guard.controls(controlled, branch)
}
predicate guardHasBranchEdge(Guard guard, BasicBlock bb1, BasicBlock bb2, boolean branch) {
guard.controlsEdge(bb1, bb2, branch)
}
Guard comparisonGuard(Expr e) { result = e }
predicate implies_v2(Guard g1, boolean b1, Guard g2, boolean b2) {
none() // TODO
}
}
SemExpr getSemanticExpr(IR::Instruction instr) { result = instr }
IR::Instruction getCppInstruction(SemExpr e) { e = result }
SemBasicBlock getSemanticBasicBlock(IR::IRBlock block) { result = block }
IR::IRBlock getCppBasicBlock(SemBasicBlock block) { block = result }
SemSsaVariable getSemanticSsaVariable(IR::Instruction instr) {
result.(SemanticExprConfig::SsaVariable).asInstruction() = instr
}
IR::Instruction getCppSsaVariableInstruction(SemSsaVariable var) {
var.(SemanticExprConfig::SsaVariable).asInstruction() = result
}
SemBound getSemanticBound(IRBound::Bound bound) { result = bound }
IRBound::Bound getCppBound(SemBound bound) { bound = result }
SemGuard getSemanticGuard(IRGuards::IRGuardCondition guard) { result = guard }
IRGuards::IRGuardCondition getCppGuard(SemGuard guard) { guard = result }

View File

@@ -1,10 +0,0 @@
/**
* C++-specific implementation of constant analysis.
*/
private import experimental.semmle.code.cpp.semantic.Semantic
/**
* Gets the constant integer value of the specified expression, if any.
*/
int getIntConstantValue(SemExpr expr) { none() }

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