Skip to content

Commit 6ddbed7

Browse files
committed
Python: Minor tweaks to qldoc and release note.
1 parent 88d8cb5 commit 6ddbed7

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

change-notes/1.20/analysis-python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Removes false positives seen when using Python 3.6, but not when using earlier v
1414
| **Query** | **Tags** | **Purpose** |
1515
|-----------------------------|-----------|--------------------------------------------------------------------|
1616
| Default version of SSL/TLS may be insecure (`py/insecure-default-protocol`) | security, external/cwe/cwe-327 | Finds instances where an insecure default protocol may be used. Results are shown on LGTM by default. |
17-
| Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Finds instances where a known insecure protocol has been specified. Results are shown on LGTM by default. |
18-
| Incomplete regular expression for hostnames (`py/incomplete-hostname-regexp`) | security, external/cwe/cwe-020 | Finds instances where a hostname is incompletely sanitized due to enescaped character in a regular expression. Results are shown on LGTM by default. |
17+
| Incomplete regular expression for hostnames (`py/incomplete-hostname-regexp`) | security, external/cwe/cwe-020 | Finds instances where a hostname is incompletely sanitized because a regular expression contains an unescaped character. Results are shown on LGTM by default. |
1918
| Incomplete URL substring sanitization (`py/incomplete-url-substring-sanitization`) | security, external/cwe/cwe-020 | Finds instances where a URL is incompletely sanitized due to insufficient checks. Results are shown on LGTM by default. |
19+
| Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Finds instances where a known insecure protocol has been specified. Results are shown on LGTM by default. |
2020

2121
## Changes to existing queries
2222

python/ql/src/Security/CWE-020/IncompleteHostnameRegExp.qhelp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@
5656

5757
</p>
5858
<p>
59-
This vulnerability is addressed in the <code>safe</code> check, which
60-
escapes the <code>.</code> and will reject <code>wwwXexample.com</code>.
61-
59+
The <code>safe</code> check closes this vulnerability by escaping the <code>.</code>
60+
so that URLs of the form <code>wwwXexample.com</code> are rejected.
6261
</p>
6362

6463
</example>

python/ql/src/Security/CWE-020/examples/IncompleteUrlSubstringSanitization.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33

44
app = Flask(__name__)
55

6+
# Not safe, as "evil-example.net/example.com" would be accepted
7+
68
@app.route('/some/path/bad1')
79
def unsafe1(request):
810
target = request.args.get('target', '')
911
if "example.com" in target:
1012
return redirect(target)
1113

14+
# Not safe, as "benign-looking-prefix-example.com" would be accepted
15+
1216
@app.route('/some/path/bad2')
1317
def unsafe2(request):
1418
target = request.args.get('target', '')

0 commit comments

Comments
 (0)