Arthur Baars
9412b331db
Revert "Revert "Python: switch to shared implementation of IncompleteHostnameRegExp.ql""
...
This reverts commit 6d24591416 .
2022-03-18 16:31:22 +01:00
Mathias Vorreiter Pedersen
abe30457ee
Python: Accept test changes.
2022-03-17 14:03:58 +01:00
Rasmus Lerchedahl Petersen
143e9ee954
Merge branch 'main' of github.com:github/codeql into python/promote-xpath-injection
2022-03-02 13:14:08 +01:00
Arthur Baars
5ce6b847d1
Merge pull request #8166 from aibaars/regex-char-sequence-1
...
Ruby/Python: regex parser: group sequences of 'normal' characters
2022-02-28 17:47:53 +01:00
Arthur Baars
69ed121ecb
Ruby/Python: regex parser: group sequences of 'normal' characters
2022-02-22 16:15:33 +01:00
Rasmus Wriedt Larsen
b59ab7f5f3
Merge branch 'main' into python/promote-log-injection
2022-02-21 09:59:31 +01:00
Rasmus Wriedt Larsen
5a90214ece
Merge pull request #7783 from yoff/python/promote-ldap-injection
...
Python: promote LDAP injection query
2022-02-15 10:24:18 +01:00
Rasmus Lerchedahl Petersen
84447e4710
python: more detailed alert message
2022-02-14 11:55:07 +01:00
Rasmus Lerchedahl Petersen
103b5761f3
python: remove superfluous configuration
...
this also removes duplicated nodes and edges
in the path results
2022-02-08 11:34:11 +01:00
Rasmus Lerchedahl Petersen
88efcff818
python: move query
...
and update reference in query test
2022-02-08 11:24:09 +01:00
Rasmus Lerchedahl Petersen
e51ba6f421
python: rename test directory
2022-02-08 11:20:10 +01:00
Rasmus Lerchedahl Petersen
e52dca0a35
python: move tests
2022-02-08 11:19:28 +01:00
Rasmus Lerchedahl Petersen
c2cd58edc4
python: rewrite to separate configurations
...
source nodes get duplicated, so perhaps flow states
are actually better for performance?
2022-02-01 14:36:11 +01:00
Rasmus Wriedt Larsen
f7a0b17ed6
Merge pull request #7687 from yoff/python/PathInjection-FlowState
...
python: Rewrite path injection query to use flow state
2022-02-01 11:33:37 +01:00
Rasmus Lerchedahl Petersen
20d54543fd
python: move log injection out of experimental
...
- move from custom concept `LogOutput` to standard concept `Logging`
- remove `Log.qll` from experimental frameworks
- fold models into standard models (naively for now)
- stdlib:
- make Logger module public
- broaden definition of instance
- add `extra` keyword as possible source
- flak: add app.logger as logger instance
- django: `add django.utils.log.request_logger` as logger instance
(should we add the rest?)
- remove LogOutput from experimental concepts
2022-01-31 11:27:55 +01:00
Rasmus Lerchedahl Petersen
0c3bce1415
python: deprecation
...
I am slightly concerned that the test now generates many more
intermediate results. I suppose that maes the analysis heavy.
Should the new library get a new name instead, so the old code
does not get evaluated?
2022-01-31 08:32:24 +01:00
Rasmus Lerchedahl Petersen
ab43f041c3
python: rename files
2022-01-28 11:00:17 +01:00
Rasmus Lerchedahl Petersen
4c3c4deb34
python: Move over query and tests
2022-01-28 09:19:11 +01:00
Rasmus Lerchedahl Petersen
a5bc5373d0
python: Rewrite path injection to use flow state
...
This removes the FP cause by chaining
This PR also removes `ChainedConfigs12.qll`,
as we hope to solve future problems via flow states.
2022-01-21 09:26:48 +01:00
Rasmus Wriedt Larsen
f53dce3a83
Python: Apply suggestions from code review
...
Co-authored-by: Taus <tausbn@github.com >
2022-01-20 14:20:15 +01:00
Rasmus Wriedt Larsen
e82e648ca1
Python: Remove usernames as sensitive source for cleartext queries
...
Closes #6363 , #6927 , #6726 , #7497 , #7116
2022-01-19 15:25:21 +01:00
Rasmus Wriedt Larsen
f3daff4e5a
Python: Add FP tests for cleartext logging
2022-01-19 15:13:06 +01:00
Rasmus Wriedt Larsen
3e1dcc3d11
Merge pull request #7518 from tausbn/python-extend-unreachable-statement-test
...
Python: Extend unreachable statement test
2022-01-06 14:07:29 +01:00
Taus
5d4db3af15
Python: Extend unreachable statement test
...
Adds a test demostrating the false positive observed by andersfugmann.
Note that this does not change the `.expected` file, and so the tests
will fail. This is expected.
2022-01-05 16:45:38 +00:00
Rasmus Wriedt Larsen
83f87f0272
Python: Adjust .expected based on new comment
...
That was changed in 9866214
2021-12-17 15:29:41 +01:00
yoff
9866214ebe
Update python/ql/test/query-tests/Security/CWE-918-ServerSideRequestForgery/full_partial_test.py
2021-12-17 14:26:43 +01:00
Rasmus Wriedt Larsen
1d00730753
Python: Allow http[s]:// prefix for SSRF
2021-12-17 00:27:18 +01:00
Rasmus Wriedt Larsen
8d9a797b75
Python: Add tricky .format SSRF tests
2021-12-17 00:24:51 +01:00
Rasmus Wriedt Larsen
6f297f4e9c
Python: Fix SSRF sanitizer tests
...
They were very misleading before, because a sanitizer that happened
early, would remove taint from the rest of the cases by use-use flow :|
2021-12-16 23:24:08 +01:00
Rasmus Wriedt Larsen
4b5599fe17
Python: Improve full/partial SSRF split
...
Now full-ssrf will only alert if **all** URL parts are fully
user-controlled.
2021-12-16 22:48:51 +01:00
Rasmus Wriedt Larsen
cb934e17b1
Python: Adjust SSRF location to request call
...
Since that might not be the same place where the vulnerable URL part is.
2021-12-16 22:48:51 +01:00
Rasmus Wriedt Larsen
b1bca85162
Python: Add interesting test-case
2021-12-16 22:48:51 +01:00
Rasmus Wriedt Larsen
1cc5e54357
Python: Add SSRF queries
...
I've added 2 queries:
- one that detects full SSRF, where an attacker can control the full URL,
which is always bad
- and one for partial SSRF, where an attacker can control parts of an
URL (such as the path, query parameters, or fragment), which is not a
big problem in many cases (but might still be exploitable)
full SSRF should run by default, and partial SSRF should not (but makes
it easy to see the other results).
Some elements of the full SSRF queries needs a bit more polishing, like
being able to detect `"https://" + user_input` is in fact controlling
the full URL.
2021-12-16 01:48:34 +01:00
Taus
7437cd4d85
Python: Fix syntax error locations
2021-12-07 16:51:33 +00:00
Nick Rolfe
05415768c9
Merge remote-tracking branch 'origin/main' into nickrolfe/regexp_g_anchor
2021-12-02 12:07:13 +00:00
yoff
4609b2060a
Merge pull request #7217 from RasmusWL/more-path-injection-fps
...
Python: Add `x in <var>` test for StringConstCompare
2021-12-02 12:35:33 +01:00
Taus
8cccee6eba
Merge pull request #6972 from yoff/python/promote-redos
...
Python: Promote ReDoS queries
2021-11-23 14:02:09 +01:00
Rasmus Wriedt Larsen
baafd9f8ba
Python: Add an other path injection FP
...
Along with the root cause, which is the `StringConstCompare`
BarrierGuard, that does only allows `in <iterable literal>` and not
`in <variable referencing iterable literal>`
2021-11-23 12:59:15 +01:00
Nick Rolfe
df6ba43cca
Python: treat \A, \Z, \b, \B as special chars, not escapes
2021-11-19 15:49:53 +00:00
Erik Krogh Kristensen
1cca377e7d
Merge pull request #6561 from erik-krogh/htmlReg
...
JS/Py/Ruby: add a bad-tag-filter query
2021-11-18 09:39:13 +01:00
Rasmus Wriedt Larsen
7c3b68b7f8
Merge pull request #7091 from RasmusWL/port-request-without-validation
...
Python: Port `py/request-without-cert-validation` to use API graphs
2021-11-15 13:51:57 +01:00
Rasmus Wriedt Larsen
985cd1ebdb
Python: Port py/request-without-cert-validation to use API graphs
2021-11-09 16:37:50 +01:00
Rasmus Wriedt Larsen
59581690fd
Python: Add py/request-without-cert-validation tests
2021-11-09 16:29:57 +01:00
Rasmus Wriedt Larsen
f70e4fea55
Python: Add interesting path-injection FP
2021-11-09 14:53:32 +01:00
Erik Krogh Kristensen
02f500b9c2
Merge branch 'main' into htmlReg
2021-11-04 12:58:42 +01:00
Rasmus Lerchedahl Petersen
8536f5f5a2
Python: remember to update refs...
2021-10-28 14:32:53 +02:00
Rasmus Wriedt Larsen
8c3349f40f
Python: Properly model flask.send_from_directory
...
To not include `filename` as path-injection sink.
2021-10-28 13:41:39 +02:00
Rasmus Wriedt Larsen
6648a695eb
Python: Add flask specific path-injection test
2021-10-28 13:34:18 +02:00
Erik Krogh Kristensen
44afa34e37
Merge branch 'main' of github.com:github/codeql into htmlReg
2021-10-26 14:46:27 +02:00
Rasmus Wriedt Larsen
8167e83ae5
Python: Fix tests
2021-10-20 17:58:03 +02:00