Rasmus Wriedt Larsen
471318369b
Python: Don't quote %s in django example
...
This is vulnerable to SQL injection because of the quotes around %s -- added
some code that highlights this in test.py
Since our examples did this in the safe query, I ended up rewriting them
completely, causing a lot of trouble for myself :D
2019-10-29 13:58:07 +01:00
Rasmus Wriedt Larsen
f1004b10ba
Merge pull request #2147 from tausbn/python-cyclic-import-package-fp
...
Python: Fix cyclic import FP relating to packages.
2019-10-25 11:57:55 +02:00
Rasmus Wriedt Larsen
bc50e90f5b
Python: Use mock for tornado tests
2019-10-24 15:01:40 +02:00
Rasmus Wriedt Larsen
2874c54133
Python: Move pyramid tests from internal repo
...
Use minimal mock instead of full library
2019-10-23 16:28:46 +02:00
Rasmus Wriedt Larsen
a98466392d
Python: Improve tests and docs for py/iter-returns-non-iterator
2019-10-23 10:46:07 +02:00
Taus Brock-Nannestad
32de65c0c6
Python: Add discussed test case (a false negative).
2019-10-22 15:10:40 +02:00
Taus Brock-Nannestad
83bf54c524
Python: Move false positive (now a true negative) into subfolder.
2019-10-22 15:08:29 +02:00
Taus Brock-Nannestad
70d9d1bd0e
Python: Add false positive test case for cyclic import.
2019-10-18 14:03:23 +02:00
semmle-qlci
ff5a98b260
Merge pull request #2074 from taus-semmle/python-unreachable-nonlocal
...
Approved by RasmusWL
2019-10-07 15:45:24 +01:00
semmle-qlci
e36e16af48
Merge pull request #2079 from taus-semmle/python-unused-local-nonlocal
...
Approved by RasmusWL
2019-10-07 15:38:21 +01:00
Rasmus Wriedt Larsen
3f45d8614b
Merge pull request #2047 from taus-semmle/python-modernise-and-fix-cyclic-import-fp
...
Python: modernise and fix cyclic import false positive.
2019-10-07 14:28:36 +02:00
Taus Brock-Nannestad
5946a4a066
Python: Teach py/unused-local-variable about nonlocal.
2019-10-03 17:56:29 +02:00
AlexTereshenkov
3e6f8fb6be
Add bind-socket-all-network-interfaces Python query ( #2048 )
...
Add bind-socket-all-network-interfaces Python query
2019-10-03 11:23:11 +01:00
Taus Brock-Nannestad
384013e0dc
Python: Add tests for reachability when using nonlocal.
2019-10-02 17:13:00 +02:00
Taus
fb20cab4c8
Merge pull request #2012 from RasmusWL/python-modernise-cls-self-checks
...
Python: modernise cls self argument name checks
2019-09-30 15:50:32 +02:00
Taus Brock-Nannestad
aa16d20d5a
Python: Fix false positive for cyclic imports guarded by if False:.
2019-09-27 15:22:12 +02:00
Taus Brock-Nannestad
25985e901b
Python: Remove a few false positives from py/unused-import.
2019-09-27 11:46:59 +02:00
Rasmus Wriedt Larsen
457794e030
Python: Consistenly use parameter instead of argument in docs
...
The Python 3 FAQ states that this is the right thing [0]
It sadly doesn't align 100% with PEP8, which calls them for "arguments" [1], but
after discussion with Taus, we decided to go with "parameter" everywhere to be
consistent.
[0] https://docs.python.org/3/faq/programming.html#faq-argument-vs-parameter
[1] https://www.python.org/dev/peps/pep-0008/#function-and-method-arguments
2019-09-26 16:31:09 +02:00
Rasmus Wriedt Larsen
12c49031e8
Python: Modernise bottle library
2019-09-26 15:03:47 +02:00
Rasmus Wriedt Larsen
546405a379
Python: Add more tests for cls/self argument names
2019-09-26 13:25:14 +02:00
Rasmus Wriedt Larsen
c6d9eb9254
Python: Move more tests for argument names into own file
...
Plus fixup of expected output from unrelated tests
2019-09-26 13:25:14 +02:00
Rasmus Wriedt Larsen
d273974045
Python: Don't flag return procedure_call() in __init__ as error
...
This commit fixes the results for
0d8a429b7e/files/mayaTools/cgm/lib/classes/AttrFactory.py (L90)
```
def __init__(...):
if error_case:
return guiFactory.warning(...)
```
that was wrongly reporting _Explicit return in __init__ method._ as an error.
2019-09-23 11:22:55 +02:00
Rasmus Wriedt Larsen
6e50a0ef84
Python: Modernise the py/explicit-return-in-init query.
...
Add explicit test case to show that we don't doulbe report this problem.
2019-09-23 11:22:55 +02:00
Rasmus Wriedt Larsen
3c33e863ad
Python: split tests for Functions into more files
...
Makes it easier to see what the testcases are relevant for what queries.
2019-09-19 11:54:28 +02:00
Taus Brock-Nannestad
d336140c19
Python: Modernise the py/non-iterable-in-for-loop query.
...
Also adds a small test case exhibiting the same false positive seen in
ODASA-8042.
2019-09-05 12:24:51 +02:00
Mark Shannon
3f740d6efe
Python: Update CWE-312 queries to use new taint-tracking configuration.
2019-08-30 11:21:04 +01:00
Mark Shannon
811815aa4e
Merge branch 'master' into python-cwe-312
2019-08-30 10:39:04 +01:00
Mark Shannon
989d7aeace
Merge branch 'master' into python-cwe-312
2019-08-29 15:57:49 +01:00
Mark Shannon
e5900921e7
Python taint-tracking: Remove warnings from test output.
2019-08-29 10:31:50 +01:00
Mark Shannon
64c160b75c
Python taint-tracking: Fix ambiguous flow through class instantiation. Tweak the path query to ensure edge to sink is always present.
2019-08-29 10:31:50 +01:00
Mark Shannon
d31e55f88e
Python taint-tracking: Avoid ambiguous flows through calls. Fix up tests.
2019-08-29 10:31:50 +01:00
Mark Shannon
78ce19678a
Python taint-tracking: Fix up SQL injection query.
2019-08-29 10:31:50 +01:00
Mark Shannon
7c4a18eee3
Python taint-tracking: Fix up handling of legacy (config-less) taint-tracking
2019-08-29 10:31:50 +01:00
Mark Shannon
2d9d292ee4
Python: Fix up pi-node handling in taint-tracking.
2019-08-29 10:31:50 +01:00
Rebecca Valentine
36f99c19bc
Merge pull request #1840 from markshannon/python-better-hasattribute-handling
...
Python: Add 'hasAttribute' predicate to ObjectInternal and Value.
2019-08-28 10:45:44 -07:00
Mark Shannon
1c8ce418d9
Python: Add test to confirm #1212 is fixed.
2019-08-28 12:01:04 +01:00
Mark Shannon
8909c3d6ab
Python: Fix tags and message for CWE-312 queries.
2019-08-23 15:20:19 +01:00
Taus Brock-Nannestad
92f48191c2
Update test results for UndefinedGlobal.ql.
2019-08-22 17:53:36 +02:00
Taus Brock-Nannestad
b82ebf2a37
Add tests.
2019-08-22 16:30:14 +02:00
Mark Shannon
4759044ee4
Python tests: Fix up tests for CWE-312 to not use external locations.
2019-08-22 15:27:49 +01:00
Mark Shannon
9df205b288
Python tests: Fix up CWE-327 tests to use new sensitive-data library.
2019-08-22 15:27:48 +01:00
Mark Shannon
816938369e
Python: Add tests for clear-text storage and logging.
2019-08-22 15:27:48 +01:00
Mark Shannon
e77ae09a86
Python tests: Update test results to account for better handling of branches in finally blocks.
2019-08-21 14:47:57 +01:00
Mark Shannon
714fecbf5e
Python: Revert tests removed in #1767 .
2019-08-21 14:39:53 +01:00
Mark Shannon
edb50c129d
Python tests: TEMPORARILY remove 5 tests to allow modification of extractor CFG pass.
2019-08-19 16:00:28 +01:00
Mark Shannon
453ae19881
Python points-to: Add .getAstNode() method to TaintedNode for forward compatibility with upcoming taint-tracking enhancements.
2019-08-16 09:54:11 +01:00
Taus
34106ec739
Merge pull request #1730 from markshannon/python-prepare-for-unrolling
...
Python prepare for implementing loop unrolling in extractor.
2019-08-13 10:54:24 +02:00
Taus
5f55cb046d
Merge pull request #1691 from markshannon/python-fewer-missing-edges
...
Python: Make a few more expressions point-to the 'unknown' value.
2019-08-12 16:15:09 +02:00
Mark Shannon
8dd3963546
Python tests: Temporarily remove some analysis tests prior to implementing loop-unrolling in extractor.
2019-08-12 14:12:02 +01:00
Rebecca Valentine
8823cdfdbc
Merge pull request #1713 from markshannon/python-remove-parents
...
Python taint-tracking: Remove 'parents' query from path-queries.
2019-08-08 10:01:40 -07:00