Skip to content

Commit bb3e3a5

Browse files
author
Esben Sparre Andreasen
committed
JS: address doc review comments
1 parent 1bc73ab commit bb3e3a5

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

change-notes/1.20/analysis-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| **Query** | **Tags** | **Purpose** |
1212
|-----------------------------------------------|------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1313
| Double escaping or unescaping (`js/double-escaping`) | correctness, security, external/cwe/cwe-116 | Highlights potential double escaping or unescaping of special characters, indicating a possible violation of [CWE-116](https://cwe.mitre.org/data/definitions/116.html). Results are shown on LGTM by default. |
14-
| Incomplete regular expression for hostnames (`js/incomplete-hostname-regexp`) | correctness, security, external/cwe/cwe-020 | Highlights hostname sanitizers that are likely to be incomplete, indicating a violation of [CWE-020](https://cwe.mitre.org/data/definitions/20.html). Results shown on LGTM by default.|
14+
| Incomplete regular expression for hostnames (`js/incomplete-hostname-regexp`) | correctness, security, external/cwe/cwe-020 | Highlights hostname sanitizers that are likely to be incomplete, indicating a violation of [CWE-020](https://cwe.mitre.org/data/definitions/20.html). Results are shown on LGTM by default.|
1515
| Incomplete URL substring sanitization | correctness, security, external/cwe/cwe-020 | Highlights URL sanitizers that are likely to be incomplete, indicating a violation of [CWE-020](https://cwe.mitre.org/data/definitions/20.html). Results shown on LGTM by default. |
1616
| Incorrect suffix check (`js/incorrect-suffix-check`) | correctness, security, external/cwe/cwe-020 | Highlights error-prone suffix checks based on `indexOf`, indicating a potential violation of [CWE-20](https://cwe.mitre.org/data/definitions/20.html). Results are shown on LGTM by default. |
1717
| Useless comparison test (`js/useless-comparison-test`) | correctness | Highlights code that is unreachable due to a numeric comparison that is always true or always false. Results are shown on LGTM by default. |

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
Even if the check is not used in a security-critical
2323
context, the incomplete check may still cause undesirable behaviors
24-
when the check succeeds accidentally.
24+
when it accidentally succeeds.
2525

2626
</p>
2727
</overview>
@@ -55,6 +55,9 @@
5555
<code>example.com</code>, effectively allowing the redirect to go to
5656
an attacker-controlled domain such as <code>wwwXexample.com</code>.
5757

58+
<p>
59+
</p>
60+
5861
Address this vulnerability by escaping <code>.</code>
5962
appropriately: <code>let regex = /(www|beta|)\.example\.com/</code>.
6063

javascript/ql/src/Security/CWE-020/IncompleteHostnameRegExp.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Incomplete regular expression for hostnames
3-
* @description Matching a URL or hostname against a regular expression that contains an unescaped dot as part of the hostname might match more than expected.
3+
* @description Matching a URL or hostname against a regular expression that contains an unescaped dot as part of the hostname might match more hostnames than expected.
44
* @kind problem
55
* @problem.severity warning
66
* @precision high

0 commit comments

Comments
 (0)