Commit Graph

33872 Commits

Author SHA1 Message Date
Taus
71780228ae Python: Rename TypeTrackerPrivate.qll 2021-04-21 13:08:26 +00:00
Asger Feldthaus
2c9a6e7bef JS: Cache function-wrapping steps in type-tracking stage 2021-04-21 13:45:58 +01:00
Arthur Baars
bc6aec7a99 Merge pull request #167 from github/alexrford/numlines
Implement FLines metrics queries
2021-04-21 14:42:18 +02:00
Tamas Vajk
e25305e3cc Java: Introduce LoC summary metric query 2021-04-21 14:27:00 +02:00
Anders Schack-Mulligen
f9599da32d Java/C#: Move a couple of flow summary tweaks to the shared implementation. 2021-04-21 14:24:15 +02:00
Alex Ford
240f0abf27 drop @tags from metrics queries 2021-04-21 13:00:48 +01:00
Alex Ford
15289dba34 simplify File.getNumberOfLines 2021-04-21 12:59:25 +01:00
Rasmus Wriedt Larsen
be9cbd79d6 Python: Add change-note for Django 3.2 support 2021-04-21 13:58:34 +02:00
Alex Ford
cc5bbfce0b Get -> Gets 2021-04-21 12:57:55 +01:00
Alex Ford
5a191692df Update ql/src/queries/metrics/FLinesOfComments.ql
Co-authored-by: Arthur Baars <aibaars@github.com>
2021-04-21 12:57:12 +01:00
Rasmus Wriedt Larsen
59c6f76457 Python: Add test for new response.headers in Django
See https://docs.djangoproject.com/en/3.2/ref/request-response/#setting-header-fields
2021-04-21 13:55:22 +02:00
Rasmus Wriedt Larsen
2302c8d5fa Python: Model new alias method on django QuerySets 2021-04-21 13:52:38 +02:00
yoff
a19373ab54 Merge pull request #5727 from tausbn/python-use-localsource-in-stepsummary
Python: Use `LocalSourceNode` in `StepSummary::step`
2021-04-21 13:50:31 +02:00
Tamás Vajk
205469316c Merge pull request #5738 from tamasvajk/feature/loc
C# Add line of code metric query
2021-04-21 13:49:32 +02:00
Taus
489e1e94e4 Python: Prevent bad joins
Adds a few unbinds to prevent bad joins from occurring.

Firstly, we never want to join `StepSummary::step` with
`TypeTracker::append` on `summary` as the first join, as the resulting
relation is absolutely massive. So we decouple the two occurrences of
`summary` by unbinding each of them.

Secondly, in some cases the node we're stepping to (`nodeTo` for type
trackers, `nodeFrom` for type backtrackers) will get joined eagerly
with the typetracker one is defining, and again this produces an
uncomfortably large intermediate join. A bit of unbinding prevents this
as well.
2021-04-21 11:44:34 +00:00
Taus
9e95f6e7c1 Python: Remove typePreservingStep
This requires a bit of explanation, so strap in.

Firstly, because we use `LocalSourceNode`s as the start and end points
of our `StepSummary::step` relation, there's no need to include
`simpleLocalFlowStep` (via `typePreservingStep`) in `smallstep`. Indeed,
since the successor node for a `step` is a `LocalSourceNode`, and local
sources never have incoming flow, this is entirely futile -- we can find
values for `mid` and `nodeTo` that satisfy the body of `step`, but
`nodeTo` will never be a `LocalSourceNode`.

With this in mind, we can simplify `smallstep` to only refer to
`jumpStep`.

This then brings the other uses of `typePreservingStep` into question.
The only other place we use this predicate is in the `TypeTracker` and
`TypeBackTracker` `smallstep` predicates. Note, however, that here we
no longer need `jumpStep` to be part of `typeTrackingStep` (as it is
already accounted for in `StepSummary::smallstep`) so we can simplify
to `simpleLocalFlowStep`. At this point, `typePreservingStep` is unused.

Finally, because of the way `smallstep` is used in `step` (inside
`StepSummary`), `nodeTo` must always be a `LocalSourceNode`, so I have
propagated this restriction to `smallstep` as well. We can always lift
this restriction later, but for now it seems like it's likely to cause
fewer surprises to have made this explicit.
2021-04-21 11:12:06 +00:00
asgerf
226792c73a JS: Expand RemoteFlowSource and move into own section 2021-04-21 12:04:09 +01:00
edvraa
8f6411dba3 Simpify with exists 2021-04-21 13:52:41 +03:00
asgerf
5df8583056 JS: Mention isUserControlledObject 2021-04-21 11:40:27 +01:00
asgerf
ff73c0b247 JS: Add section with access paths to cheat sheet 2021-04-21 11:40:27 +01:00
Alex Ford
4e119cc085 consider empty files (no ruby tokens) to have 0 lines 2021-04-21 11:29:55 +01:00
Alex Ford
a8597025aa fixed logic for line counting 2021-04-21 11:29:09 +01:00
edvraa
0590522e4b a deserializer 2021-04-21 13:29:00 +03:00
edvraa
3ac5f7bb18 Move RemoteSource and LocalSource to UnsafeDeserialization.qll 2021-04-21 13:27:26 +03:00
edvraa
452ec8c43f comments 2021-04-21 13:12:53 +03:00
edvraa
13655b5d80 Add RegExUtils 2021-04-21 13:08:35 +03:00
asgerf
f611d06ed0 JS: Add getALocalUse to cheat sheet 2021-04-21 10:53:10 +01:00
Alex Ford
bcc1be05de use explicit this prefixes in FileSystem.qll 2021-04-21 10:51:28 +01:00
Alex Ford
85ecacd858 make helper predicates private 2021-04-21 10:50:00 +01:00
Alex Ford
9d117d10b8 drop MetricFile class 2021-04-21 10:45:42 +01:00
Alex Ford
c6b6a83501 extend FLines* tests 2021-04-21 10:42:53 +01:00
Rasmus Wriedt Larsen
08e86fdfe5 JS: Make CredentialsFunctionName use nameIndicatesSensitiveData
Someone from JS team needs to verify that this is actually OK.
2021-04-21 11:38:52 +02:00
Rasmus Wriedt Larsen
e977d6eb75 JS: Rewrite to use notSensitiveRegexp 2021-04-21 11:36:39 +02:00
Rasmus Wriedt Larsen
b9a1a1fd5c JS: Rewrite to use nameIndicatesSensitiveData
I added this predicate mostly because it was nice with an easy shortcut for it,
but also since I spotted the `CredentialsFunctionName` not checking agaisnt the
regexps in `notSensitive`, which looked suspicious. So the main goal of adding
`nameIndicatesSensitiveData` is that you don't accidentially forget to ensure
that the name doesn't match against `notSensitve`.
2021-04-21 11:36:38 +02:00
Rasmus Wriedt Larsen
b6f8e5057b JS: Rewrite to use SensitiveDataClassification::password (and like) 2021-04-21 11:36:17 +02:00
Alex Ford
a1c91e28da move FLines* tests to a common directory 2021-04-21 10:34:58 +01:00
Rasmus Wriedt Larsen
94fec5f8b7 JS: Rewrite to use SensitiveDataClassification 2021-04-21 11:34:02 +02:00
Rasmus Wriedt Larsen
0d08718f08 JS: Adapt SensitiveActions to use shared lib
Although there are warnings for the new deprecated classes/predicates, the test
in javascript/ql/test/library-tests/SensitiveActions/ passes 👍
2021-04-21 11:34:01 +02:00
Rasmus Wriedt Larsen
775ed41592 Python: Update SensitiveDataHeuristics with newer JS version
which also prompted me to rewrite the QLDoc for `nameIndicatesSensitiveData`
2021-04-21 11:34:01 +02:00
Rasmus Wriedt Larsen
16b62486e9 Python: Extract SensitiveDataHeuristics to be shared with JS
Initially I had called `nameIndicatesSensitiveData` for `maybeSensitiveName`,
which made the relationship with `maybeSensitive` and `notSensitive` quite
strange -- and therefore I added the more informative `maybeSensitiveRegexp` and
`notSensitiveRegexp`.

Although I'm no longer using `maybeSensitiveName`, and I no longer have a strong
argument for making this name change, I still like it. If someone thinks this is
a terrible idea, I'm happy to change it though 👍
2021-04-21 11:31:28 +02:00
Alex Ford
fcd46025fe update metadata for FLines* queries 2021-04-21 10:28:20 +01:00
Arthur Baars
abb37e212a Merge pull request #165 from github/aibaars/methods
Implement method lookup
2021-04-21 11:24:20 +02:00
Arthur Baars
549e5ab9d6 Revert "Rename Method -> MethodDeclaration"
This reverts commit d361ef37af.
2021-04-21 10:50:47 +02:00
Arthur Baars
1245674df8 Add missing @id properties 2021-04-21 10:50:47 +02:00
Tamas Vajk
2a6f979ce6 C# Add line of code metric query 2021-04-21 10:42:06 +02:00
Anders Schack-Mulligen
9362ae0687 Merge pull request #5422 from tamasvajk/feature/sink-migration-ldap
Java: Migrate LDAP injection sinks to CSV format
2021-04-21 10:05:28 +02:00
Rasmus Wriedt Larsen
63a2657aef Merge branch 'main' into inline-taint-tests 2021-04-21 10:02:55 +02:00
Tom Hvitved
7080b256fb Merge pull request #5715 from hvitved/csharp/ssa/perf-tweaks
C#: A few minor SSA performance tweaks
2021-04-21 09:59:12 +02:00
Tom Hvitved
def62e8c22 Merge pull request #5718 from hvitved/csharp/hardcoded-cred-remove-cp
C#: Remove CP from `HardcodedCredentials::getCredentialSink`
2021-04-21 09:58:56 +02:00
Tom Hvitved
1ed11b297b Merge pull request #5725 from hvitved/csharp/dataflow/performance
C#: Various data-flow performance tweaks
2021-04-21 09:46:15 +02:00