Commit Graph

17948 Commits

Author SHA1 Message Date
ubuntu
15562e4814 Update LdapjsSearchOptions 2020-09-01 22:28:58 +02:00
ubuntu
e2e55455c1 Update LdapjsSearchOptions and getQueryCall 2020-09-01 22:23:07 +02:00
Robert Marsh
015bf6e879 C++: Add reverse flow when this ptr is returned 2020-09-01 13:08:44 -07:00
Robert Marsh
2a57fa22e3 C++: handle reference args to iterator operators 2020-09-01 12:52:01 -07:00
Alessio Della Libera
8f00acd4e2 Update javascript/ql/src/experimental/Security/CWE-090/Ldapjs.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2020-09-01 21:00:49 +02:00
Alessio Della Libera
78ebcee570 Update javascript/ql/src/experimental/Security/CWE-090/Ldapjs.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2020-09-01 21:00:38 +02:00
Alessio Della Libera
b86b9ba510 Update javascript/ql/src/experimental/Security/CWE-090/LdapInjectionCustomizations.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2020-09-01 21:00:21 +02:00
Alessio Della Libera
28729915d7 Update javascript/ql/src/experimental/Security/CWE-090/Ldapjs.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2020-09-01 20:56:25 +02:00
Alessio Della Libera
1b50477fae Update javascript/ql/src/experimental/Security/CWE-090/Ldapjs.qll
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2020-09-01 20:55:44 +02:00
Alessio Della Libera
44e728016b Update javascript/ql/src/experimental/Security/CWE-090/LdapInjection.qhelp
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2020-09-01 20:54:58 +02:00
Erik Krogh Kristensen
6cbdc7ad8f autoformat 2020-09-01 20:16:49 +02:00
Mathias Vorreiter Pedersen
d4293ad9c3 C++: Fix code after review comments. 2020-09-01 18:25:46 +02:00
Anders Schack-Mulligen
cc61e6117e Merge pull request #3542 from porcupineyhairs/mongoJava
Java : add MongoDB injection sinks
2020-09-01 16:19:17 +02:00
CodeQL CI
311e62f21d Merge pull request #4081 from aschackmull/java/dispatch-ctx-this-param
Approved by aibaars
2020-09-01 15:06:47 +01:00
Ian Lynagh
1cba09dde2 C++: Remove some remnants of the extractor CFG 2020-09-01 14:49:36 +01:00
Rasmus Wriedt Larsen
ab06c459f4 Python: Make validTest error on empty output again
I accidentially disabled that when introducing the ability to handle more than
one OK.
2020-09-01 14:42:11 +02:00
yoff
caa680c72e Merge pull request #4149 from RasmusWL/python-more-additional-taint-steps
Python: more additional taint steps
2020-09-01 14:38:33 +02:00
Rasmus Wriedt Larsen
0cc018fec0 Python: Taint tracking setup alá Go
\## TaintFlow sources

The class `RemoteFlowSource` is very similarly defined as the other languages [C++](ac22e7950c/cpp/ql/src/semmle/code/cpp/security/FlowSources.qll), [Java](6de612a566/java/ql/src/semmle/code/java/dataflow/FlowSources.qll), [C#](fddbce0b7b/csharp/ql/src/semmle/code/csharp/security/dataflow/flowsources/Remote.qll), [JS](78334af354/javascript/ql/src/semmle/javascript/security/dataflow/RemoteFlowSources.qll), and [Go](24b3133e0c/ql/src/semmle/go/security/FlowSources.qll). There are some minor differences:

- Java/C++ defines the class in `FlowSources.qll`
- C# uses `csharp/ql/src/semmle/code/csharp/security/dataflow/flowsources/Remote.qll`, and provide `StoredFlowSource` and `LocalFlowSource` in separate classes.
- JS uses `RemoteFlowSources.qll`.
- JS defines additional predicate `RemoteFlowSource.isUserControlledObject`
- Go uses the class name `UntrustedFlowSource`, but still defined in `ql/src/semmle/go/security/FlowSources.qll`
- Go uses the `::Range` pattern to allow both extensibility and refinement

The big difference is how a RemoteFlowSource is specified:

- Java and C# have all subclasses of `RemoteFlowSource` defined in the same file
- Go and JS defines subclasses for frameworks in the actual framework `.qll` file, and all frameworks are transitively imported by `import go` or `import javascript` (so subclasses are always in scope).
- C++ uses class `RemoteFlowFunction` to do all the heavy lifting (and its subclasses are transitively imported).

\### What we will do

Use file `RemoteFlowSource.qll`, define subclasses in framework library classes.

_Why? Personally I really like it, Go/JS is already doing it, and Tom expressed a preference for doing the same for C# (although that is not what they are doing today)._

Jonas gave this advice:
> Whether you split the definitions between multiple files or keep them all in one file, the property you want is that all definitions are included when the abstract class is included. Otherwise you can get unexpected results via transitive includes.

We will make imports of all frameworks in the same file that defines `RemoteFlowSource`, as it seems to be the least intrusive change. If that turns out to be a problem, we can also move them to `python.qll` (the other way is not so easy).

\## TaintFlow sinks

[JS](473787a426/javascript/ql/src/semmle/javascript/Concepts.qll) and [Go](ecff1e6a16/ql/src/semmle/go/Concepts.qll) defines abstract base classes for interesting sinks in `Concepts.qll` (and all uses the `::Range` pattern in Go).

I really like this idea, since it allows multiple queries to reuse the same sink definitions, and it makes it _easy_ to discover what default sinks are available.

Personally I'm not 100% on board with the naming, but I don't have any good reason to change the naming convention.

\## Framework modeling

Following the model from Go ([example](https://github.com/github/codeql-go/blob/main/ql/src/semmle/go/frameworks/Gin.qll)), I propose that we make every definition in a framework modeling `private`. This allows some greater flexibility in changing our modeling, since we don't need to think about keeping deprecated versions around for a whole year.

It _does_ have the downside that someone writing a query can't reuse the classes/predicates for a framework, but it didn't seem to be too big of a concern. If we need to provide access, we can always make the definitions non-private (the other way is not so easy).

\## Customizations

Also introduced `Customizations.qll` like in JS/Java/Go (to replace `site.qll`)
2020-09-01 14:37:11 +02:00
Taus Brock-Nannestad
6a96c53d15 Python: Add missing getNode invocation 2020-09-01 14:04:31 +02:00
Rasmus Lerchedahl Petersen
8b13a429b7 Python: Address review comments 2020-09-01 14:00:41 +02:00
Taus Brock-Nannestad
26d14aba98 Python: Use nodeFrom/nodeTo instead of pred/succ 2020-09-01 14:00:30 +02:00
CodeQL CI
b9a6183ec2 Merge pull request #4175 from aschackmull/java/adjust-cwe-089-qltest
Approved by aibaars
2020-09-01 12:43:56 +01:00
Erik Krogh Kristensen
2628c05e43 split out comment over multiple lines 2020-09-01 13:12:44 +02:00
Erik Krogh Kristensen
c6947320ea use isAsyncOrGenerator instead of isOrdinary 2020-09-01 13:11:44 +02:00
Arthur Baars
2729d109a5 Merge pull request #4123 from aschackmull/java/records-dataflow
Java: Add data flow for record getters.
2020-09-01 13:02:24 +02:00
Anders Schack-Mulligen
e5d7208c12 Java: Adjust a few qltests. 2020-09-01 12:49:09 +02:00
Arthur Baars
aedfa47cb4 Add missing QHelp files 2020-09-01 12:46:57 +02:00
Rasmus Wriedt Larsen
c5e3333d10 Python: Update expected tests after last commit
I'm pushing too fast it seems
2020-09-01 12:01:34 +02:00
Rasmus Wriedt Larsen
e0cfe8123e Python: Update comments for new taint tests
I see I didn't keep them up to date as I implemented things
2020-09-01 11:58:26 +02:00
Rasmus Lerchedahl Petersen
6d23d7fa0e Python: Test that pointsTo implies data flow
Running the test on a larger database gives some interesting results.
2020-09-01 11:56:22 +02:00
Rasmus Wriedt Larsen
cda88a5e64 Python: Refactor: use DataFlow::Node.asExpr() 2020-09-01 11:53:06 +02:00
Rasmus Wriedt Larsen
ddc55a18cf Python: Fix taint handling of copy.deepcopy
(test results didn't change)

Thanks @yoff 👍
2020-09-01 11:50:46 +02:00
Rasmus Wriedt Larsen
e5a361c230 Python: Better taint tests for copy.deepcopy 2020-09-01 11:50:33 +02:00
Mathias Vorreiter Pedersen
aa3b268525 Merge pull request #4162 from jbj/ssa-ref-parameters
C++: SSA and range analysis for reference parameters
2020-09-01 11:48:41 +02:00
Anders Schack-Mulligen
82692876d8 Java: Add some test cases. 2020-09-01 11:24:30 +02:00
Mathias Vorreiter Pedersen
472363b86e Merge branch 'main' into mathiasvp/read-step-without-memory-operands 2020-09-01 11:08:52 +02:00
Anders Schack-Mulligen
c25dd4be8c Merge pull request #3363 from ggolawski/xslt-injection
CodeQL query to detect XSLT injections
2020-09-01 11:03:19 +02:00
Anders Schack-Mulligen
1dae99e4a5 Merge pull request #3543 from porcupineyhairs/WebsocketReadAsSource
Java: add websocket reads as remote flow source.
2020-09-01 10:58:02 +02:00
Mathias Vorreiter Pedersen
91a23096bb C#: Sync identical files 2020-09-01 10:54:54 +02:00
Mathias Vorreiter Pedersen
3cca74e654 C++: Accept test changes 2020-09-01 10:54:46 +02:00
Mathias Vorreiter Pedersen
9de570b300 C++: Use the newly added predicates in field flow. This commit also adds a Class column to the FieldContent branch so FieldContent has a pretty toString implementation again. 2020-09-01 10:54:09 +02:00
Mathias Vorreiter Pedersen
1e13a39932 C++: Add getUpdatedInterval predicate to ChiInstructions, and getUsedInterval predicate to NonPhiMemoryOperands. 2020-09-01 10:53:48 +02:00
Anders Schack-Mulligen
beca44ec2f Merge pull request #4172 from rvermeulen/java/xss-sink-extensible
Java: Customizable XSS analysis
2020-09-01 09:27:50 +02:00
Robert Marsh
87b657054f C++: reverse flow for iterator operator qualifiers 2020-08-31 14:53:05 -07:00
Robert Marsh
d4cf92e374 C++: Improve non-member iterator operator detection 2020-08-31 14:52:29 -07:00
Robert Marsh
10005dd199 Merge branch 'main' into rdmarsh2/cpp/input-iterators-1Merge changes to input/output models for functions that return thisand resolve conflicting changes to taint tests. 2020-08-31 14:49:01 -07:00
Remco Vermeulen
2bdd3d7712 Apply qldoc suggestions
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2020-08-31 17:28:51 +02:00
Taus Brock-Nannestad
ec64606d5a Python: Remove CopyStep branch type 2020-08-31 17:23:02 +02:00
Taus Brock-Nannestad
eb6443df21 Merge branch 'python-add-typetracker' of github.com:tausbn/ql into python-add-typetracker 2020-08-31 17:22:13 +02:00
Taus
8e1f99af99 Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
2020-08-31 17:20:12 +02:00