Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
9535f83
Revert "Revert "C++: update expected sizes of error and unknown types…
jbj Sep 4, 2018
a46df8e
Merge pull request #154 from jbj/mergeback-master-20180904
semmle-qlci Sep 5, 2018
cbdbda3
Merge rc/1.18 into next.
adityasharad Sep 5, 2018
8fbc191
Merge pull request #160 from adityasharad/merge/1.18-next-050918
Sep 5, 2018
d5e0357
Revert "Revert "Version: Bump to 1.19.0 dev.""
jbj Sep 5, 2018
69e9156
Merge branch 'master-to-next-20180905-master' into master-to-next-201…
jbj Sep 5, 2018
272bed7
Merge pull request #164 from jbj/master-to-next-20180905
adityasharad Sep 6, 2018
8e3f639
C++: add dbscheme expr kinds for __builtin_addressof and vector fill
nickrolfe Sep 7, 2018
93103e1
C++: add class and test for a GNU vector fill operation
nickrolfe Sep 7, 2018
2abf91b
C++: class and test for clang's __builtin_addressof
nickrolfe Sep 7, 2018
ab05be7
C++: update stats for builtin_addressof and vec_fill
nickrolfe Sep 10, 2018
953537e
Merge pull request #174 from nickrolfe/vec_fill
ian-semmle Sep 10, 2018
767045b
Merge rc/1.18 into next.
adityasharad Sep 12, 2018
7db2589
Merge pull request #185 from adityasharad/merge/1.18-next-120918
hvitved Sep 12, 2018
0957ee7
C++: support clang's __builtin_convertvector
nickrolfe Sep 11, 2018
3d2637a
C++: stats for builtinconvertvector
nickrolfe Sep 13, 2018
bc0d4f1
Merge pull request #188 from nickrolfe/convvec
ian-semmle Sep 13, 2018
9886e4a
Merge remote-tracking branch 'upstream/master' into merge-master-next…
jbj Sep 13, 2018
440d64d
Merge pull request #191 from jbj/merge-master-next-20180913
nickrolfe Sep 14, 2018
e5b9dca
C++: add Class::isStandardLayout()
nickrolfe Sep 18, 2018
f1358b7
C++: test for Class::isStandardLayout()
nickrolfe Sep 18, 2018
017e3a3
C++: stats for is_standard_layout_class
nickrolfe Sep 19, 2018
ebc924a
Merge pull request #204 from nickrolfe/std_layout
ian-semmle Sep 19, 2018
b94df82
JavaScript: Fix expected output due to qltest change.
Sep 20, 2018
8a950a5
Merge pull request #208 from aeyerstaylor/fix-qltest-change
Sep 21, 2018
accacdc
Merge rc/1.18 into next.
adityasharad Sep 25, 2018
314e1a1
Merge pull request #228 from adityasharad/merge/1.18-next-250918
nickrolfe Sep 26, 2018
75680db
Merge branch 'next' into qlucie/master
adityasharad Sep 26, 2018
4ff79b0
C++: Update HashCons test output.
adityasharad Sep 26, 2018
41775c9
Merge pull request #233 from Semmle/qlucie/master
adityasharad Sep 27, 2018
5ff9e35
Merge rc/1.18 into next.
adityasharad Sep 27, 2018
a55d6d7
C++: CRLF -> LF in .expected file
nickrolfe Sep 27, 2018
54c678a
Merge pull request #246 from nickrolfe/lineending
adityasharad Sep 27, 2018
c7137ce
Merge pull request #245 from adityasharad/merge/1.18-next-270918
pavgust Sep 27, 2018
9146cc2
TypeScript: test case for tokenization of template literals
asger-semmle Oct 1, 2018
a199035
TypeScript: test case for whitespace before a rescanned token
asger-semmle Oct 1, 2018
d3a1df6
TypeScript: test case for tokens starting with ">"
asger-semmle Oct 1, 2018
337defd
Merge master into next.
adityasharad Oct 1, 2018
6bfa59a
Merge pull request #262 from adityasharad/merge/master-next-011018
jbj Oct 2, 2018
057af7c
TypeScript: add test case with mixed rescanned tokens
asger-semmle Oct 2, 2018
cc1c7b1
Merge pull request #263 from asger-semmle/ts-tokens
Oct 3, 2018
8bc92bd
TS: test case for type expansion through type parameter bound
asger-semmle Oct 2, 2018
989a82f
Merge pull request #271 from asger-semmle/ts-expansive-types
Oct 4, 2018
49644bf
Merge remote-tracking branch 'upstream/master' into mergeback-2018-10-08
hvitved Oct 8, 2018
546a91e
Revert "JavaScript: Patch CFG to improve support for non-top level im…
hvitved Oct 8, 2018
ccebd5e
Merge remote-tracking branch 'upstream/master' into mergeback-2018-10-08
hvitved Oct 8, 2018
95abf55
Merge pull request #292 from hvitved/mergeback-2018-10-08
jbj Oct 9, 2018
b29b314
Merge remote-tracking branch 'upstream/master' into mergeback-2018-10-11
hvitved Oct 11, 2018
f2663d4
Merge pull request #311 from hvitved/mergeback-2018-10-11
calumgrant Oct 11, 2018
58a0815
Merge remote-tracking branch 'upstream/master' into mergeback-2018-10-17
hvitved Oct 17, 2018
d976168
Merge pull request #328 from hvitved/mergeback-2018-10-17
semmle-qlci Oct 17, 2018
1b79613
C++: Enhance a test
ian-semmle May 26, 2018
894a37c
C++: Accept test changes
ian-semmle Sep 26, 2018
ef15523
C++: Enhance MagicConstantsNumbers test
ian-semmle Oct 12, 2018
121596d
Merge pull request #317 from ian-semmle/discover_walk
nickrolfe Oct 18, 2018
eef8719
C++: Fix AV Rule 85
ian-semmle Oct 25, 2018
56ee5ff
Merge master into next.
adityasharad Oct 25, 2018
d6afbd8
C++: Update a comment
ian-semmle Oct 25, 2018
a08233e
Merge pull request #366 from adityasharad/merge/master-next-251018
Oct 26, 2018
91dad02
Merge pull request #370 from ian-semmle/update_comment
geoffw0 Oct 26, 2018
01d27d3
C++: Accept test changes
ian-semmle Oct 25, 2018
3e17196
Merge pull request #369 from ian-semmle/generated_members
nickrolfe Oct 29, 2018
9a412c9
C++: handle __uuidof(0)
nickrolfe Oct 29, 2018
94347ae
C++: AV Rule 85: Check templates rather than instantiations
ian-semmle Oct 29, 2018
5359f5d
C++: Accept test changes following fix_member_function_indices
ian-semmle Oct 26, 2018
3340e79
Merge pull request #371 from ian-semmle/av85
jbj Oct 30, 2018
bfb5731
Merge pull request #377 from ian-semmle/fix_member_function_indices
geoffw0 Oct 30, 2018
b896899
Merge master into next.
adityasharad Oct 30, 2018
cb3a651
Merge pull request #389 from adityasharad/merge/master-next-311018
ian-semmle Nov 1, 2018
553c2f5
Merge master into next.
adityasharad Nov 6, 2018
89d728a
Merge pull request #412 from adityasharad/merge/master-next-061118
aibaars Nov 6, 2018
2042c9c
CPP: Extend the CPP-205 test (results prior to discover_walk).
geoffw0 Oct 23, 2018
301c133
CPP: More descriptive.
geoffw0 Oct 23, 2018
e6e0d69
CPP: Re-apply effect of discover_walk.
geoffw0 Oct 26, 2018
ee4cfe8
CPP: Update expected output for changes elsewhere.
geoffw0 Nov 6, 2018
1940423
Eclipse plugins: Remove plugin metadata.
adityasharad Nov 6, 2018
9ee4d3b
Merge pull request #378 from nickrolfe/uuidof0
jbj Nov 7, 2018
6f791bb
Java: Account for extraction of calls to <obinit>.
aschackmull Nov 6, 2018
46bebc8
Java: Add test.
aschackmull Nov 9, 2018
992a015
Merge pull request #415 from aschackmull/java/obinit-extraction
yh-semmle Nov 9, 2018
761e5ef
Merge master into next.
adityasharad Nov 9, 2018
47fda72
Merge pull request #448 from adityasharad/merge/master-next-091118
Nov 12, 2018
1500237
Merge remote-tracking branch 'upstream/master' into mergeback-20181112
jbj Nov 12, 2018
17414f0
Merge pull request #451 from jbj/mergeback-20181112
hvitved Nov 13, 2018
96989a1
Merge pull request #427 from adityasharad/eclipse/remove-plugin-metadata
Nov 13, 2018
f0715b0
Merge master into next.
adityasharad Nov 14, 2018
8493adf
Merge pull request #463 from adityasharad/merge/master-next-141118
aibaars Nov 14, 2018
696178e
Merge pull request #465 from esben-semmle/js/fixup-suite-master
adityasharad Nov 14, 2018
9ce1a2a
Add JSF note to qhelp for sub-set of JSF queries
Nov 15, 2018
5c92430
Remove incorrect comment from query
Nov 15, 2018
d4bcc1e
Add note to further file
Nov 16, 2018
90c75cd
Merge pull request #478 from felicity-semmle/cpp/SD-2777-jsf-note
geoffw0 Nov 19, 2018
16ec9f1
Merge remote-tracking branch 'origin/next' into bump/master-next
pavgust Nov 19, 2018
5f58824
Initial commit of Python queries and QL libraries.
Nov 19, 2018
165bb8b
Merge pull request #488 from pavgust/bump/master-next
adityasharad Nov 19, 2018
05b69a1
QL tests for Python queries and libraries.
markshannon Nov 19, 2018
c2e0ee1
Add .qlpath and .project files for Python queries.
markshannon Nov 19, 2018
e930b43
Python security queries. Choose a precision reflecting actual precisi…
markshannon Nov 19, 2018
bc3b983
JS: move CodeInjection tests into subfolder
asger-semmle Nov 20, 2018
a135e46
Update lgtm.yml file to exclude Python source in query and test folders.
markshannon Nov 20, 2018
6317546
Merge pull request #493 from markshannon/python-queries
taus-semmle Nov 20, 2018
7ba4d71
Merge pull request #494 from markshannon/python-tests
taus-semmle Nov 20, 2018
2239f86
JS: add query MethodNameInjection
asger-semmle Nov 20, 2018
a2e5003
JS: add to security suite
asger-semmle Nov 20, 2018
8aff666
JS: suppress similar alerts from RemotePropertyInjection
asger-semmle Nov 20, 2018
1c06f45
JS: address some comments
asger-semmle Nov 20, 2018
49cd287
JS: use StringConcatenation library in ConcatSanitizer
asger-semmle Nov 20, 2018
b16072a
JS: share ConcatSanitizer in common module
asger-semmle Nov 20, 2018
3902f75
JS: share detection of objects with unsafe methods
asger-semmle Nov 20, 2018
260ae36
JS: document the shared module
asger-semmle Nov 20, 2018
4138f81
JS: expand example
asger-semmle Nov 20, 2018
7d80847
JS: add qhelp example to test suite
asger-semmle Nov 20, 2018
00587ba
JS(extractor): support optional chaining
Nov 20, 2018
41b4535
JS(ql): support optional chaining
Nov 20, 2018
5cd3a9c
Merge pull request #500 from markshannon/python-python-security-queri…
pavgust Nov 21, 2018
fa761c0
Update javascript/ql/src/Security/CWE-094/MethodNameInjection.ql
Nov 21, 2018
84d6426
JS: more comments
asger-semmle Nov 21, 2018
cb832b1
Merge branch 'unsafe-global-object-access' of github.com:asger-semmle…
asger-semmle Nov 21, 2018
4ae2493
JS: rename query to Unsafe Dynamic Method Access
asger-semmle Nov 21, 2018
8c7e195
JS: fix string value of taint configuration
asger-semmle Nov 21, 2018
72c4ef4
JS: fixup optional chaining on `CallWithNonLocalAnalyzedReturnFlow`
Nov 21, 2018
366934f
Merge pull request #350 from geoffw0/cpp-205-detail
ian-semmle Nov 21, 2018
976fed7
Python tests: Remove some obsolete tests.
markshannon Nov 21, 2018
27c9326
JS: address doc review
asger-semmle Nov 21, 2018
527c95c
Python tests: Add missing metadata files.
markshannon Nov 21, 2018
13d130d
Merge pull request #514 from markshannon/python-remove-architect-tests
taus-semmle Nov 21, 2018
24bf292
Merge pull request #515 from markshannon/python-add-metadata
taus-semmle Nov 21, 2018
733acac
Merge pull request #506 from esben-semmle/js/optional-chaining-extrac…
Nov 22, 2018
61ef655
JS: handle both data() and taint() source labels
asger-semmle Nov 22, 2018
2ac2233
Add change note for enhance visibility of security alerts and convers…
Nov 16, 2018
722d89f
Upgrade taint-tracking security queries to path-problem queries.
Feb 23, 2018
2a24723
Python: Update test results for path queries.
Nov 16, 2018
88d8201
Python: Convert stack-trace-exposure query to path-problem.
Nov 16, 2018
04e5b89
Python tests: use a more accurate form os os.path.join() in test lib.
Nov 16, 2018
f3fedcd
Python tests: Move security test stubs to correct location.
markshannon Nov 21, 2018
bfb7e17
Python: Move library to correct location.
markshannon Nov 21, 2018
c01db23
Python: Fix up expected results of SqlInjection.ql
markshannon Nov 21, 2018
fb09360
C#: New query for cs/uncontrolled-string-format
calumgrant Nov 20, 2018
1bfa4d5
C#: Documentation for cs/uncontrolled-format-string
calumgrant Nov 21, 2018
64de748
C#: Analysis change notes.
calumgrant Nov 21, 2018
6b2e339
C#: Address QL review comments.
calumgrant Nov 22, 2018
36d9520
C#: Address doc comments.
calumgrant Nov 22, 2018
8c7ca38
JS(extractor): improve parser support for flowtype syntax
Nov 22, 2018
472c042
Merge pull request #526 from esben-semmle/js/flow-parsing-improvements
semmle-qlci Nov 22, 2018
4eabca6
Update java schema to accommodate for key-value configuration files.
Nov 11, 2018
61bd868
Python: Improve API and representation of taint tracking nodes. Updat…
markshannon Nov 23, 2018
95f1935
Python change notes: Merge in internal change notes.
markshannon Nov 23, 2018
4f5cfbc
Correct change for extractor logging levels.
markshannon Nov 23, 2018
61f5c2e
Merge pull request #516 from markshannon/python-path-queries
taus-semmle Nov 23, 2018
d4b2c01
Lift out intermediate helper predicate.
pavgust Nov 23, 2018
ceb316d
Merge pull request #527 from markshannon/python-security-change-note
taus-semmle Nov 23, 2018
b94493a
Python: Add extra sinks for command-injection query.
markshannon Nov 22, 2018
7f5d46b
Python: Add change note for new sinks.
markshannon Nov 23, 2018
f0206a2
Python: Tests for new query: requests called with verify=False.
markshannon Nov 22, 2018
45e864a
Python: New query to test for requests without validation.
markshannon Nov 22, 2018
06e5bc8
Python: Add qhelp for new query.
markshannon Nov 22, 2018
6588606
Python: Account for other 'falsey' values in query.
markshannon Nov 22, 2018
bfc001c
Python: Add change note for requests without cert verification query.
markshannon Nov 23, 2018
3190b12
Python: Fix parent relation for path-queries.
markshannon Nov 23, 2018
17b063f
Merge pull request #473 from sb-semmle/add-properties-files-to-java-s…
yh-semmle Nov 23, 2018
3cee874
Merge pull request #536 from markshannon/python-more-shell-injection
taus-semmle Nov 23, 2018
c20b688
Merge master into next.
adityasharad Nov 23, 2018
f0fbed7
Merge pull request #539 from markshannon/python-path-fix-siblings
taus-semmle Nov 23, 2018
8d7ace2
Merge pull request #535 from adityasharad/merge/master-next-231118
aibaars Nov 25, 2018
4d8f5e1
Python: Add default.qll for backwards compatibility with older querie…
markshannon Nov 26, 2018
a1772a9
Merge pull request #543 from markshannon/python-backward-compat-default
Nov 26, 2018
7dc0a81
Merge pull request #513 from calumgrant/cs/cwe-134
hvitved Nov 26, 2018
8e54c7a
Merge pull request #503 from asger-semmle/unsafe-global-object-access
Nov 26, 2018
516b29d
Merge pull request #544 from pavgust/fix/python-hotfixes
markshannon Nov 26, 2018
7aef8fa
Merge pull request #547 from pavgust/fix/cwe-497-performance
adityasharad Nov 26, 2018
c8e34bf
C++: Update security tag in change note
jbj Nov 27, 2018
a85dfb1
Merge pull request #548 from jbj/security-tags-1.19
geoffw0 Nov 27, 2018
698957e
Python: Correct case of query name and improve help.
markshannon Nov 27, 2018
cf1e7cf
JavaScript: Move an auxiliary predicate into shared library.
Nov 22, 2018
a4da245
Python: Implement check for flask debug mode.
taus-semmle Nov 22, 2018
b393d9a
Add change note.
taus-semmle Nov 27, 2018
623a80f
TS: declassify files with unrecognized shebang line
asger-semmle Nov 27, 2018
8d341ab
Fix stub file.
taus-semmle Nov 27, 2018
6ebf504
Update test results after stub change.
taus-semmle Nov 27, 2018
2b340b4
Merge pull request #530 from markshannon/python-no-cert-validation
taus-semmle Nov 27, 2018
7f94c25
Change precision to `high`.
taus-semmle Nov 27, 2018
31ac33e
Merge pull request #528 from taus-semmle/python-flask-debug
markshannon Nov 27, 2018
2889e07
JavaScript: Add new query `UnvalidatedDynamicMethodCall`.
Nov 22, 2018
f1c538a
JavaScript: Restrict `RemotePropertyInjection` query to avoid double-…
Nov 27, 2018
f9de1d4
JavaScript: Add change notes.
Nov 28, 2018
31d23b6
JavaScript: Sort change notes alphabetically.
Nov 28, 2018
e66691a
Merge pull request #551 from asger-semmle/js-extractor-shebang
semmle-qlci Nov 28, 2018
39f1c79
JavaScript: Address review comments.
Nov 28, 2018
57a976d
Merge pull request #555 from xiemaisi/js/invalid-dynamic-method-call
semmle-qlci Nov 28, 2018
8017df1
JS: add change note for UselessConditional.ql
asger-semmle Nov 28, 2018
46a9b14
Merge commit '61ef6552' into merge-rc1.19
asger-semmle Dec 11, 2018
20ffdf4
Merge commit '8017df17' into merge-rc1.19
asger-semmle Dec 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ path_classifiers:
- javascript/extractor/tests
- javascript/ql/src
- javascript/ql/test
- python/ql/src
- python/ql/test

queries:
- include: "*"
Expand Down
4 changes: 2 additions & 2 deletions change-notes/1.19/analysis-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Cast between `HRESULT` and a Boolean type (`cpp/hresult-boolean-conversion`) | external/cwe/cwe-253 | Finds logic errors caused by mistakenly treating the Windows `HRESULT` type as a Boolean instead of testing it with the appropriate macros. Enabled by default. |
| Setting a DACL to `NULL` in a `SECURITY_DESCRIPTOR` (`cpp/unsafe-dacl-security-descriptor`) | external/cwe/cwe-732 | This query finds code that creates world-writable objects on Windows by setting their DACL to `NULL`. Enabled by default. |
| Cast between `HRESULT` and a Boolean type (`cpp/hresult-boolean-conversion`) | security, external/cwe/cwe-253 | Finds logic errors caused by mistakenly treating the Windows `HRESULT` type as a Boolean instead of testing it with the appropriate macros. Enabled by default. |
| Setting a DACL to `NULL` in a `SECURITY_DESCRIPTOR` (`cpp/unsafe-dacl-security-descriptor`) | security, external/cwe/cwe-732 | This query finds code that creates world-writable objects on Windows by setting their DACL to `NULL`. Enabled by default. |
| Cast from `char*` to `wchar_t*` | security, external/cwe/cwe-704 | Detects potentially dangerous casts from `char*` to `wchar_t*`. Enabled by default on LGTM. |
| Dead code due to `goto` or `break` statement (`cpp/dead-code-goto`) | maintainability, external/cwe/cwe-561 | Detects dead code following a `goto` or `break` statement. Enabled by default on LGTM. |
| Inconsistent direction of for loop | correctness, external/cwe/cwe-835 | This query detects `for` loops where the increment and guard condition don't appear to correspond. Enabled by default on LGTM. |
Expand Down
2 changes: 1 addition & 1 deletion change-notes/1.19/analysis-csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Using a package with a known vulnerability (cs/use-of-vulnerable-package) | security, external/cwe/cwe-937 | Finds project build files that import packages with known vulnerabilities. This is included by default. |

| Uncontrolled format string (cs/uncontrolled-format-string) | security, external/cwe/cwe-134 | Finds data flow from remote inputs to the format string in `String.Format`. This is included by default. |

## Changes to existing queries

Expand Down
7 changes: 5 additions & 2 deletions change-notes/1.19/analysis-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
| Stored cross-site scripting (`js/stored-xss`) | security, external/cwe/cwe-079, external/cwe/cwe-116 | Highlights uncontrolled stored values flowing into HTML content, indicating a violation of [CWE-079](https://cwe.mitre.org/data/definitions/79.html). Results shown on LGTM by default. |
| Unclear precedence of nested operators (`js/unclear-operator-precedence`) | maintainability, correctness, external/cwe/cwe-783 | Highlights nested binary operators whose relative precedence is easy to misunderstand. Results shown on LGTM by default. |
| Unneeded defensive code | correctness, external/cwe/cwe-570, external/cwe/cwe-571 | Highlights locations where defensive code is not needed. Results are shown on LGTM by default. |
| Unsafe dynamic method access (`js/unsafe-dynamic-method-access` ) | security, external/cwe/cwe-094 | Highlights code that invokes a user-controlled method on an object with unsafe methods. Results are shown on LGTM by default. |
| Unvalidated dynamic method access (`js/unvalidated-dynamic-method-call` ) | security, external/cwe/cwe-754 | Highlights code that invokes a user-controlled method without guarding against exceptional circumstances. Results are shown on LGTM by default. |
| Useless assignment to property | maintainability | Highlights property assignments whose value is always overwritten. Results are shown on LGTM by default. |
| User-controlled data in file | security, external/cwe/cwe-912 | Highlights locations where user-controlled data is written to a file. Results are not shown on LGTM by default. |

Expand All @@ -43,11 +45,11 @@
| Duplicate 'if' condition | Lower severity | The severity of this rule has been revised to "warning". |
| Duplicate switch case | Lower severity | The severity of this rule has been revised to "warning". |
| Information exposure through a stack trace | More results | This rule now also flags cases where the entire exception object (including the stack trace) may be exposed. |
| Missing CSRF middleware | Fewer false-positive results | This rule now recognizes additional CSRF protection middlewares. |
| Missing 'this' qualifier | Fewer false-positive results | This rule now recognizes additional intentional calls to global functions. |
| Missing CSRF middleware | Fewer false-positive results | This rule now recognizes additional CSRF protection middlewares. |
| Missing variable declaration | Lower severity | The severity of this rule has been revised to "warning". |
| Regular expression injection | Fewer false-positive results | This rule now identifies calls to `String.prototype.search` with more precision. |
| Remote property injection | Fewer results | The precision of this rule has been revised to "medium". Results are no longer shown on LGTM by default. |
| Remote property injection | Fewer results | The precision of this rule has been revised to "medium". Furthermore, it no longer flags dynamic method calls, which are now handled by two new queries. Results are no longer shown on LGTM by default. |
| Self assignment | Fewer false-positive results | This rule now ignores self-assignments preceded by a JSDoc comment with a `@type` tag. |
| Server-side URL redirect | Fewer false-positive results | This rule now recognizes safe redirects in more cases. |
| Server-side URL redirect | More results | This rule now recognizes redirection calls in more cases. |
Expand All @@ -58,6 +60,7 @@
| Unused variable, import, function or class | Fewer false-positive results | This rule now flags fewer variables that may be used by `eval` calls. |
| Unused variable, import, function or class | Fewer results | This rule now flags import statements with multiple unused imports once. |
| Useless assignment to local variable | Fewer false-positive results | This rule now recognizes additional ways default values can be set. |
| Useless conditional | More results, fewer false-positive results | This rule now recognizes conditionals in more cases, but no longer flags certain defensive coding patterns. |
| Whitespace contradicts operator precedence | Fewer false-positive results | This rule no longer flags operators with asymmetric whitespace. |
| Wrong use of 'this' for static method | More results, fewer false-positive results | This rule now recognizes inherited methods. |

Expand Down
97 changes: 97 additions & 0 deletions change-notes/1.19/analysis-python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Improvements to Python analysis


## General improvements

> Changes that affect alerts in many files or from many queries
> For example, changes to file classification

### Representation of the control flow graph

The representation of the control flow graph (CFG) has been modified to better reflect the semantics of Python.

The following statement types no longer have a CFG node for the statement itself, as their sub-expressions already contain all the
semantically significant information:

* `ExprStmt`
* `If`
* `Assign`
* `Import`

For example, the CFG for `if cond: foo else bar` now starts with the CFG node for `cond`.

For the following statement types, the CFG node for the statement now follows the CFG nodes of its sub-expressions to better reflect the semantics:

* `Print`
* `TemplateWrite`
* `ImportStar`

For example the CFG for `print foo` (in Python 2) has changed from `print -> foo` to `foo -> print`, better reflecting the runtime behavior.


The CFG for the `with` statement has been re-ordered to more closely reflect the semantics.
For the `with` statement:
```python
with cm as var:
body
```
The order of the CFG changes from:

<with>
cm
var
body

to:

cm
<with>
var
body

A new predicate `Stmt.getAnEntryNode()` has been added to make it easier to write reachability queries involving statements.


## New queries

| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Flask app is run in debug mode (`py/flask-debug`) | security, external/cwe/cwe-215, external/cwe/cwe-489 | Finds instances where a Flask application is run in debug mode. Enabled on LGTM by default. |
| Information exposure through an exception (`py/stack-trace-exposure`) | security, external/cwe/cwe-209, external/cwe/cwe-497 | Finds instances where information about an exception may be leaked to an external user. Enabled on LGTM by default. |
| Request without certificate validation (`py/request-without-cert-validation`) | security, external/cwe/cwe-295 | Finds requests where certificate verification has been explicitly turned off, possibly allowing man-in-the-middle attacks. Not enabled on LGTM by default. |

## Changes to existing queries

All taint-tracking queries now support visualization of paths in QL for Eclipse.
Most security alerts are now visible on LGTM by default.

| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
| Assert statement tests the truth value of a literal constant (`py/assert-literal-constant`) | reliability, correctness | Checks whether an assert statement is testing the truth of a literal constant value. Not shown by default. |
| Code injection (`py/code-injection`) | Supports path visualization and is now visible on LGTM by default | No change to expected results |
| Command injection (`py/command-line-injection`) | Additional sinks in the `os`, and `popen` modules | Possibility of new results |
| Deserializing untrusted input (`py/unsafe-deserialization`) | Supports path visualization | No change to expected results |
| Encoding error (`py/encoding-error`) | Better alert location | Alert is now shown at the position of the first offending character, rather than at the top of the file. |
| Missing call to \_\_init\_\_ during object initialization (`py/missing-call-to-init`) | Fewer false positive results | Results where it is likely that the full call chain has not been analyzed are no longer reported. |
| Reflected server-side cross-site scripting (`py/reflective-xss`) | Supports path visualization and is now visible on LGTM by default | No change to expected results |
| SQL query built from user-controlled sources (`py/sql-injection`) | Supports path visualization and is now visible on LGTM by default | No change to expected results |
| Uncontrolled data used in path expression (`py/path-injection`) | Supports path visualization and is now visible on LGTM by default | No change to expected results |
| Uncontrolled command line (`py/command-line-injection`) | Supports path visualization and is now visible on LGTM by default | No change to expected results |
| URL redirection from remote source (`py/url-redirection`) | Fewer false positive results and now supports path visualization | Taint is no longer tracked from the right hand side of binary expressions. In other words `SAFE + TAINTED` is now treated as safe. |


## Changes to code extraction

* Improved scalability: Scaling is near linear to at least 20 CPU cores.
* Five levels of logging can be selected: `ERROR`, `WARN`, `INFO`, `DEBUG` and `TRACE`. `WARN` is the stand-alone default, but `INFO` will be used when run by LGTM.
* The `-v` flag can be specified multiple times to increase logging level by one per `-v`.
* The `-q` flag has been added and can be specified multiple times to reduce the logging level by one per `-q`.
* Log lines are now in the `[SEVERITY] message` style and never overlap.
* Extractor now outputs the location of the first offending character when an EncodingError is encountered.

## Changes to QL libraries

* Taint tracking analysis now understands HTTP requests in the `twisted` library.

* The analysis now handles `isinstance` and `issubclass` tests involving the basic abstract base classes better. For example, the test `issubclass(list, collections.Sequence)` is now understood to be `True`
* Taint tracking automatically tracks tainted mappings and collections, without you having to add additional taint kinds. This means that custom taints are tracked from `x` to `y` in the following flow: `l = [x]; y =l[0]`.
5 changes: 5 additions & 0 deletions change-notes/1.19/extractor-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ extraction:
* The TypeScript compiler is now bundled with the distribution, and no longer needs to be installed manually.
Should the compiler version need to be overridden, set the `SEMMLE_TYPESCRIPT_HOME` environment variable to
point to an installation of the `typescript` NPM package.

* The extractor now supports [Optional Chaining](https://github.com/tc39/proposal-optional-chaining) expressions.

* The extractor now supports additional [Flow](https://flow.org/) syntax.

4 changes: 1 addition & 3 deletions cpp/ql/src/Critical/NotInitialised.ql
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
*/
import cpp

// This query is the JSF version
//
// (see also InitialisationNotRun.ql and GlobalUseBeforeInit.ql)
// See also InitialisationNotRun.ql and GlobalUseBeforeInit.ql

// Holds if s defines variable v (conservative)
predicate defines(ControlFlowNode s, Variable lv) {
Expand Down
8 changes: 0 additions & 8 deletions cpp/ql/src/META-INF/MANIFEST.MF

This file was deleted.

20 changes: 12 additions & 8 deletions cpp/ql/src/Security/CWE/CWE-497/ExposedSystemData.ql
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@ abstract class SystemData extends Element {
result = getAnExpr() or

// flow via global or member variable (conservative approximation)
exists(Variable var |
(
var.getAnAssignedValue() = getAnExprIndirect() or
var.getAnAccess() = getAnExprIndirect()
) and
result = var.getAnAccess() and
not var instanceof LocalScopeVariable
) or
result = getAnAffectedVar().getAnAccess() or

// flow via stack variable
definitionUsePair(_, getAnExprIndirect(), result) or
Expand All @@ -50,6 +43,17 @@ abstract class SystemData extends Element {
// flow from assigned value to assignment expression
result.(AssignExpr).getRValue() = getAnExprIndirect()
}

/** Gets a global or member variable that may be affected by this system
* data (conservative approximation).
*/
private Variable getAnAffectedVar() {
(
result.getAnAssignedValue() = this.getAnExprIndirect() or
result.getAnAccess() = this.getAnExprIndirect()
) and
not result instanceof LocalScopeVariable
}
}

/**
Expand Down
6 changes: 5 additions & 1 deletion cpp/ql/src/jsf/4.05 Libraries/AV Rule 24.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@


<overview>

<!-- Mention that this rule may not be applicable in projects that don't follow the JSF standard. -->
<include src="cpp/jsfNote.qhelp" />

<p>
This rule finds calls to the standard library functions <code>abort, exit, getenv</code> and <code>system</code>.
This query highlights calls to the standard library functions <code>abort, exit, getenv</code> and <code>system</code>.
The functions <code>abort</code> and <code>exit</code> should not be called as they immediately terminate the program
and will bypass all the normal error and exception handling routines in the software. This is especially important in
software which is run on systems without an interactive OS, as restarting the software may require a complete reboot
Expand Down
6 changes: 5 additions & 1 deletion cpp/ql/src/jsf/4.10 Classes/AV Rule 85.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@


<overview>

<!-- Mention that this rule may not be applicable in projects that don't follow the JSF standard. -->
<include src="cpp/jsfNote.qhelp" />

<p>
This rule ensures that all operators with opposites (e.g. == and !=) are both defined, and
This query ensures that all operators with opposites (e.g. == and !=) are both defined, and
that one of them is defined in terms of the other. This just enforces the consistency of meaning
of the operators.
</p>
Expand Down
41 changes: 34 additions & 7 deletions cpp/ql/src/jsf/4.10 Classes/AV Rule 85.ql
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,50 @@ predicate oppositeOperators(string op1, string op2) {
/* this match is very syntactic: we simply check that op1 is defined as
!op2(_, _) */
predicate implementedAsNegationOf(Operator op1, Operator op2) {
exists(Block b, ReturnStmt r, NotExpr n, FunctionCall c |
exists(Block b, ReturnStmt r, NotExpr n, Expr o |
b = op1.getBlock() and
b.getNumStmt() = 1 and
r = b.getStmt(0) and
n = r.getExpr() and
c = n.getOperand() and
c.getTarget() = op2)
o = n.getOperand() and
(
o instanceof LTExpr and op2.hasName("operator<") or
o instanceof LEExpr and op2.hasName("operator<=") or
o instanceof GTExpr and op2.hasName("operator>") or
o instanceof GEExpr and op2.hasName("operator>=") or
o instanceof EQExpr and op2.hasName("operator==") or
o instanceof NEExpr and op2.hasName("operator!=") or
o.(FunctionCall).getTarget() = op2
)
)
}

predicate classIsCheckableFor(Class c, string op) {
oppositeOperators(op, _) and
// We check the template, not its instantiations
not c instanceof ClassTemplateInstantiation and
// Member functions of templates are not necessarily instantiated, so
// if the function we want to check exists, then make sure that its
// body also exists
((c instanceof TemplateClass)
implies
forall(Function f | f = c.getAMember() and f.hasName(op)
| exists(f.getEntryPoint())))
}

from Class c, string op, string opp, Operator rator
where c.fromSource() and
oppositeOperators(op, opp) and
classIsCheckableFor(c, op) and
classIsCheckableFor(c, opp) and
rator = c.getAMember() and
rator.hasName(op) and
not exists(Operator oprator | oprator = c.getAMember() and
oprator.hasName(opp) and
( implementedAsNegationOf(rator, oprator)
or implementedAsNegationOf(oprator, rator)))
forex(Operator aRator |
aRator = c.getAMember() and aRator.hasName(op) |
not exists(Operator oprator |
oprator = c.getAMember() and
oprator.hasName(opp) and
( implementedAsNegationOf(aRator, oprator)
or implementedAsNegationOf(oprator, aRator))))
select c, "When two operators are opposites, both should be defined and one should be defined in terms of the other. Operator " + op +
" is declared on line " + rator.getLocation().getStartLine().toString() + ", but it is not defined in terms of its opposite operator " + opp + "."
6 changes: 5 additions & 1 deletion cpp/ql/src/jsf/4.13 Functions/AV Rule 111.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@


<overview>

<!-- Mention that this rule may not be applicable in projects that don't follow the JSF standard. -->
<include src="cpp/jsfNote.qhelp" />

<p>
This rule finds return statements that return pointers to an object allocated on the stack. The lifetime
This query highlights return statements that return pointers to an object allocated on the stack. The lifetime
of a stack allocated memory location only lasts until the function returns, , and
the contents of that memory become undefined after that. Clearly, using a pointer to stack
memory after the function has already returned will have undefined results.
Expand Down
Loading