Commit Graph

17948 Commits

Author SHA1 Message Date
James Fletcher
c95f58c30d Merge pull request #2830 from shati-patel/docs-preparation
Merge master into `docs-preparation` branch
2020-02-13 14:59:09 +00:00
Henning Makholm
3ec11a1089 Don't chain to ./codeql in .codeqlmanifest.json
This entry in `.codeqlmanifest.json` was intended to allow
unpacking the CodeQL CLI as a subdirectory of `ql`, and things
would Just Work.

However, it is not necessary anymore because recent releases of
the CLI will search their own directory as a fallback
_independently_ of the parent directory.

On the contrary, removing this link will make internal testing
easier because you then run a test build of the CLI with
`--search-path` pointing to the `ql` checkout without inadvertently
making extractors in a _different_ build that is unpacked there visible.
2020-02-13 15:30:15 +01:00
Erik Krogh Kristensen
897bb4d801 add test for chrome-remote-interface 2020-02-13 15:12:45 +01:00
Erik Krogh Kristensen
1ab5ca4e64 typo in docstring
Co-Authored-By: Esben Sparre Andreasen <esbena@github.com>
2020-02-13 14:15:28 +01:00
jack1142
e1644dd68b Python: Handle __class_getitem__ in py/not-named-self (#2825)
Fixes #2824
2020-02-13 13:38:36 +01:00
Rasmus Wriedt Larsen
1558cf2eae Python: Fix typo (decent => descent) 2020-02-13 13:35:29 +01:00
Tom Hvitved
8748a1218d C#: Generate fresh TRAP ID for local functions 2020-02-13 13:02:46 +01:00
Taus
dcb41a139c Merge pull request #2780 from RasmusWL/python-clean-qltest-options
Python: clean qltest options files
2020-02-13 12:14:17 +01:00
Erik Krogh Kristensen
7c69ee1aff Merge remote-tracking branch 'upstream/master' into CVE74 2020-02-13 11:09:09 +01:00
Erik Krogh Kristensen
d6afd438ba add model for chrome-remote-interface as a ClientRequest 2020-02-13 10:58:07 +01:00
Geoffrey White
4412cea04a Merge pull request #2821 from jbj/ValueNumbering-var-operand
C++: Fix perf of IR value numbering
2020-02-13 09:11:34 +00:00
Rebecca Valentine
acb3c524dd Updates expected results. 2020-02-12 19:46:43 -08:00
Rebecca Valentine
65cba82c7e Fixes bug w/ use of pointsTo 2020-02-12 19:45:55 -08:00
Rebecca Valentine
bfb720c7f3 Adds range and tuple types 2020-02-12 19:36:03 -08:00
Rebecca Valentine
3ce250b2cf Adds some debugging changes. 2020-02-12 19:29:42 -08:00
Robert Marsh
52b164434d C++: remove accidental commit 2020-02-12 15:23:30 -08:00
Robert Marsh
1d5971f8ec C++: accept test changes from extractor update 2020-02-12 13:29:21 -08:00
Tom Hvitved
89527766be Merge pull request #2744 from calumgrant/cs/local-var-parent
C#: Distinguish between local variables extracted in different compil…
2020-02-12 19:41:29 +01:00
Felicity Chapman
39ba3dedc1 Fix build failure by moving control-flow image 2020-02-12 17:16:31 +00:00
Felicity Chapman
8db3651dfd Add draft introductions and create map topic for Python 2020-02-12 16:38:23 +00:00
Jonas Jensen
2abe416670 Merge pull request #2799 from MathiasVP/missing-flow-in-crement
C++: Fix false negatives for postfix crement expressions
2020-02-12 15:03:48 +01:00
Jonas Jensen
033a4c30ea C++: Fix perf of IR value numbering
On some snapshots, notably ffmpeg, the IR `ValueNumbering` recursion
would generate billions of tuples and eventually run out of space.

It turns out it was fairly common for an `Instruction` to get more than
one `ValueNumber` in the base cases for `VariableAddressInstruction` and
`InitializeParameterInstruction`, and it could also happen in an
instruction with more than one operand of the same `OperandTag`. When a
binary operation was applied to an instruction with `m` value numbers
and another instruction with `n` value numbers, the result would get
`m * n` value numbers. This led to doubly-exponential growth in the
number of value numbers in rare cases.

The underlying reason why a `VariableAddressInstruction` could get
multiple value numbers is that it was keyed on the associated
`IRVariable`, and the `IRVariable` is defined in part by the type of its
underlying `Variable` (or other AST element). If the extractor defines a
variable to have multiple types because of linker ambiguity, this leads
to the creation of multiple `IRVariable`s. That should ideally be solved
in `TIRVariable.qll`, but for now I've put a workaround in
`ValueNumberingInternal.qll` instead.

To remove the problem with instructions having multiple operands, the
construction in `Operand.qll` will now filter out any such operand. It
wasn't enough to apply that filter to the `raw` stage, so I've applied
it to all three stages.
2020-02-12 14:38:41 +01:00
Taus
895f2f74ab Merge branch 'master' into python-clean-qltest-options 2020-02-12 13:44:41 +01:00
Taus
12113e947f Merge pull request #2603 from RasmusWL/python-fix-http-source-sink
Python: Make web libs use HttpRequestTaintSource and HttpResponseTaintSink
2020-02-12 13:42:22 +01:00
Mathias Vorreiter Pedersen
c8be67ce0e C++: Generalize PostfixCrementOperation to CrementOperation to fix false negatives reported by Geoffrey 2020-02-12 13:26:10 +01:00
Taus
de45b1a08e Merge pull request #2767 from RasmusWL/python-six-tests
Python: Update expected six results
2020-02-12 12:53:36 +01:00
Erik Krogh Kristensen
d913654604 Merge remote-tracking branch 'upstream/master' into FalsySanitizer 2020-02-12 10:28:48 +01:00
Tom Hvitved
78380f5d59 Merge pull request #2658 from calumgrant/cs/serialization-check-bypass-type
C#: Fix cs/serialization-check-bypass
2020-02-12 10:26:01 +01:00
Anders Schack-Mulligen
5b7c150f58 Merge pull request #2813 from p-/fix-doc-java-dataflow
Doc: fix sample query in Java data flow documentation
2020-02-12 10:08:05 +01:00
Rebecca Valentine
2270c6c960 Adds modernized files. 2020-02-11 21:45:49 -08:00
Rebecca Valentine
178acc85b9 Adds main modifications. 2020-02-11 21:25:50 -08:00
Robert Marsh
837fe84cec C++/C#: autoformat Opcode.qll 2020-02-11 12:18:45 -08:00
Robert Marsh
f467260815 C++: respond to PR comments. 2020-02-11 12:17:46 -08:00
Robert Marsh
5269fb713f Merge pull request #2812 from geoffw0/nospacezero
C++: Improve NoSpaceForZeroTerminator.ql
2020-02-11 14:37:32 -05:00
Peter Stöckli
ddbec74b67 Doc: fix sample query in Java data flow doc 2020-02-11 20:17:53 +01:00
Mathias Vorreiter Pedersen
1dd5926f41 C++: Generalize new case in adjustedSink to all AssignOperations 2020-02-11 17:15:42 +01:00
Geoffrey White
87781a944b C++: Change note. 2020-02-11 15:25:59 +00:00
Geoffrey White
75a50a1714 C++: Understand formatting function varargs as needing null termination. 2020-02-11 15:25:59 +00:00
Geoffrey White
de8d84dfff C++: Clearer comments in NoSpaceForZeroTerminator.ql. 2020-02-11 15:25:59 +00:00
Geoffrey White
2f290bd528 C++: Additional test cases. 2020-02-11 15:25:59 +00:00
Calum Grant
5838df17c6 Merge pull request #2766 from hvitved/csharp/stackalloc
C#: Extract `stackalloc` information
2020-02-11 15:06:15 +00:00
Rasmus Wriedt Larsen
efedcd26d0 Python: Django tests need --lang=3 2020-02-11 13:16:52 +01:00
Erik Krogh Kristensen
35d8151374 add a few arrary methods to TaintedPath.qll 2020-02-11 12:23:51 +01:00
Tom Hvitved
1948446ad3 Address review comments 2020-02-11 11:56:40 +01:00
Rasmus Wriedt Larsen
1f762841ec Python: In py/import-own-module handle from foo import * 2020-02-11 11:45:48 +01:00
Rasmus Wriedt Larsen
5cc2efef8e Python: Fix FPs for py/import-own-module
Before I added `--max-import-depth=2`, there was a bit of trouble, where it
would alert on `from pkg_ok import foo2` -- since all the `pkg_ok.foo<n>`
modules were missing, I guess the analysis didn't make any assumptions on
whether `foo2` is a module or a regular attribute.
2020-02-11 11:45:48 +01:00
Rasmus Wriedt Larsen
f3f9e340d3 Python: Update tests for py/import-own-module
So I've been thinking a bit about import pkg_ok.foo1 after reading the Python
references for imports of submodules
https://docs.python.org/3/reference/import.html#submodules

> When a submodule is loaded using any mechanism (...) a binding is placed in the
parent module’s namespace to the submodule object. For example, if package spam
has a submodule foo, after importing spam.foo, spam will have an attribute foo
which is bound to the submodule.

That does at least explain what is going on here.

I feel that import pkg_ok.foo1 might be a very contrived example. In principle
it should be an alert, since the module pkg_ok ends up with an import of itself,
but my gut feeling is that in practice it's not a very important piece of code
to give alerts for. if we really care about giving these import related alerts,
we could probably add a new query for this pattern, as it's kind of surprising
that it works when you're just an ordinary python programmer.
2020-02-11 11:45:48 +01:00
Shati Patel
bd94e80271 Merge pull request #2809 from jf205/update-rc123
docs: port some more changes onto rc/1.23
2020-02-11 11:26:36 +01:00
James Fletcher
cb94c95115 Merge pull request #2807 from shati-patel/sphinx-blog
Remove link to blog
2020-02-11 09:16:42 +00:00
Arthur Baars
a460d90434 Remove trailing ; in QL language spec
(cherry picked from commit c91815f44d)
2020-02-11 09:13:30 +00:00