Commit Graph

9012 Commits

Author SHA1 Message Date
Calum Grant
5e6b7be5b8 C#: Update nullability tests. 2019-12-06 12:41:20 +00:00
Calum Grant
5f6527a183 C#: Compare symbols using SymbolEqualityComparer. 2019-12-06 12:41:20 +00:00
Calum Grant
ca195e9340 C#: Update project files to Roslyn 3.4 2019-12-06 12:41:20 +00:00
Tom Hvitved
3a95cd5e9c C#: Remove a Cartesian product 2019-12-06 10:42:59 +00:00
james
67eea44678 Merge branch 'rc/1.23' into jf-mergeback-123 2019-12-06 09:16:39 +00:00
Tom Hvitved
3e93aa9787 C#: Address review comments
- Undo split of `localvars` relation.
- Properly extract tuple declarations in `is` expressions.
2019-12-05 22:31:38 +00:00
Robert Marsh
39b400ca69 C++: Add DefinitionByReferenceNode to IR dataflow 2019-12-05 11:56:57 -08:00
Calum Grant
59ce8842bb Merge branch 'master' of git.semmle.com:Semmle/ql into ASPNetPagesValidateRequest
# Conflicts:
#	change-notes/1.24/analysis-csharp.md
2019-12-05 15:58:47 +00:00
Dave Bartolomeo
cbb6797ca8 Merge from master and resolve conflicts 2019-12-04 10:14:52 -07:00
Calum Grant
73c8888361 Merge pull request #2356 from cldrn/ASPNetRequestValidationMode
Adds CodeQL query to check for insecure RequestValidationMode in ASP.NET
2019-12-04 17:02:08 +00:00
Dave Bartolomeo
50dc5e2ba3 Merge pull request #2438 from rdmarsh2/rdmarsh/ir-line-number-ids
C++/C#: use line numbers for instruction IDs
2019-12-03 18:48:28 -08:00
Robert Marsh
722cc91eae C++: make getLineRank private 2019-12-03 10:53:08 -08:00
Jonas Jensen
57917bec17 Merge pull request #2480 from hvitved/dataflow/performance-tweaks
Data flow: Various performance tweaks
2019-12-03 18:44:11 +01:00
Calum Grant
8018db3f66 Merge pull request #2474 from hvitved/csharp/dispatch-perf
C#: Improve performance of dispatch library
2019-12-03 15:47:43 +00:00
Robert Marsh
1b802c7e18 C#: accept test change 2019-12-02 13:59:19 -08:00
Paulino Calderon
5fd0662264 Update csharp/ql/src/Security Features/CWE-016/ASPNetPagesValidateRequest.qhelp
Fixes typo

Co-Authored-By: James Fletcher <42464962+jf205@users.noreply.github.com>
2019-12-02 16:44:39 -05:00
Paulino Calderon
9576e2a698 Update csharp/ql/src/Security Features/CWE-016/ASPNetPagesValidateRequest.qhelp
Adds missing code tags

Co-Authored-By: James Fletcher <42464962+jf205@users.noreply.github.com>
2019-12-02 16:43:51 -05:00
Calum Grant
c05263ca98 C#: Fix some IR types that didn't compile. 2019-12-02 13:27:58 +00:00
Tom Hvitved
b3990c5a1d Data flow: Revert reordering changes in flowStore and flowRead 2019-12-02 14:25:59 +01:00
Tom Hvitved
5baa133e6c Data flow: Sync files 2019-12-02 13:41:17 +01:00
Tom Hvitved
b1245eeac8 Data flow: Various performance tweaks 2019-12-02 13:38:10 +01:00
Nick Rolfe
d293418672 Merge pull request #2478 from jbj/mergeback-20191202
Mergeback from rc/1.23 to master
2019-12-02 12:28:20 +00:00
Calum Grant
fcd13dc595 Merge remote-tracking branch 'upstream/master' into ASPNetRequestValidationMode
# Conflicts:
#	change-notes/1.24/analysis-csharp.md
2019-12-02 12:03:11 +00:00
semmle-qlci
dc7a0c1b91 Merge pull request #2442 from hvitved/csharp/dataflow/conversion-operator
Approved by calumgrant
2019-12-02 11:01:35 +00:00
Jonas Jensen
5b24b1efc3 Merge remote-tracking branch 'upstream/rc/1.23' into mergeback-20191202
Conflicts solved:
	javascript/extractor/src/com/semmle/js/extractor/Main.java
	javascript/ql/test/query-tests/Statements/UseOfReturnlessFunction/tst.js
2019-12-02 09:57:34 +01:00
Paulino Calderon
8026925a3a Update csharp/ql/src/Security Features/CWE-016/ASPNetRequestValidationMode.ql
Added missing quotes.

Co-Authored-By: James Fletcher <42464962+jf205@users.noreply.github.com>
2019-11-29 22:39:50 -05:00
Paulino Calderon
879d34d24d Update csharp/ql/src/Security Features/CWE-016/ASPNetRequestValidationMode.qhelp
Missing comma.

Co-Authored-By: James Fletcher <42464962+jf205@users.noreply.github.com>
2019-11-29 22:39:29 -05:00
Paulino Calderon
22964cba74 Update csharp/ql/src/Security Features/CWE-016/ASPNetRequestValidationMode.qhelp
Rephrasing.

Co-Authored-By: James Fletcher <42464962+jf205@users.noreply.github.com>
2019-11-29 22:39:04 -05:00
Paulino Calderon
a2dfd551f6 Update csharp/ql/src/Security Features/CWE-016/ASPNetRequestValidationMode.qhelp
built in to built-in

Co-Authored-By: James Fletcher <42464962+jf205@users.noreply.github.com>
2019-11-29 22:38:42 -05:00
Tom Hvitved
c845a1ba91 C#: Improve performance of dispatch library 2019-11-29 15:32:00 +01:00
Calum Grant
30a2620a8c C#: Tidy up docs, query metadata and add tests. 2019-11-29 10:31:58 +00:00
Tom Hvitved
a062d7d41c C#: Add regression test 2019-11-29 10:10:24 +01:00
Anders Schack-Mulligen
333d0a69d2 Java/C++/C#: Bugfix for field flow through reverse read. 2019-11-29 09:38:24 +01:00
Tom Hvitved
04cecc04dd C#: Update EntityFrameworkCore test 2019-11-28 15:28:50 +01:00
Paulino Calderon
eeffd7cf8d Adds CodeQL query to check for Pages validateRequest directive 2019-11-28 14:22:08 +00:00
Tom Hvitved
af453d081e C#: Only track taint through conversion operators defined in libraries 2019-11-28 15:21:04 +01:00
Tom Hvitved
ba4fb82a08 C#: Add DB upgrade script 2019-11-28 14:30:21 +01:00
Tom Hvitved
b79fc87961 C#: Split up localvars database relation into two relations 2019-11-28 14:30:21 +01:00
Calum Grant
d001c3c2d2 C#: Restructure files. 2019-11-27 17:29:53 +00:00
Calum Grant
c906a8238d C#: Edit qhelp for cs/insecure-request-validation-mode 2019-11-27 16:37:37 +00:00
Calum Grant
4b19f3b6a4 C#: Whitespace edit and edit query metadata. 2019-11-27 16:37:37 +00:00
Paulino Calderon
6f346c6676 Adds CodeQL query to check for insecure RequestValidationMode in ASP.NET 2019-11-27 16:37:37 +00:00
Tom Hvitved
ce16bc553a C#: Autoformat 2019-11-27 13:47:24 +01:00
Tom Hvitved
39aaa38486 C#: Update EntityFramework test 2019-11-27 10:28:12 +01:00
Dave Bartolomeo
aa6bd07971 Merge remote-tracking branch 'upstream/master' into dbartol/May-Must 2019-11-26 14:07:13 -07:00
Robert Marsh
e368d5dda0 C++: simplify getDisplayOrderInBlock 2019-11-26 16:02:30 -05:00
Jonas Jensen
c05cc77a91 Merge pull request #2421 from dbartol/dbartol/IndirectAlias
C++/C#: Cleanup in preparation for indirect alias analysis
2019-11-26 21:59:17 +01:00
Dave Bartolomeo
f3b4140948 C++/C#: Consistent handling of "may" vs. "must" memory accesses
In the IR, some memory accesses are "must" accesses (the entire memory location is always read or written), and some are "may" accesses (some, all, or none of the bits in the location are written). We previously had to special case specific "may" accesses in a few places. This change regularizes our handling of "may" accesses.

The `MemoryAccessKind` enumeration now describes only the extent of the access (the set of locations potentially accessed), but does not distinguish "must" from "may". The new predicates `Operand.hasMayMemoryAccess()` and `Instruction.hasResultMayMemoryAccess()` hold when the access is a "may" access.

Unaliased SSA now correctly ignores variables that are ever accessed via a "may" access.

Aliased SSA now distinguishes `MemoryLocation`s for "may" and "must" accesses. I've refactored `getOverlap()` into the core `getExtentOverlap()`, which considers only the extent, but not the "may" vs. "must", and `getOverlap()`, which tweaks the result of `getExtentOverlap()` based on "may" vs. "must" and read-only locations.

When determining the overlap between a `Phi` operand and its definition, we now use the result of the defining `Chi` instruction, if one exists. This gives exact definitions for `Phi` operands for virtual variables.
2019-11-26 12:13:07 -07:00
Dave Bartolomeo
4e1ee7a998 C++/C#: Fix formatting 2019-11-26 10:48:24 -07:00
Tom Hvitved
71e958eabc C#: Add taint-tracking steps through conversion operator calls 2019-11-26 13:53:50 +01:00