You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: javascript/ql/src/Security/CWE-116/IncompleteMultiCharacterSanitization.qhelp
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
<p>
8
8
Sanitizing untrusted input is a common technique for preventing injection attacks and other security
9
9
vulnerabilities. Regular expressions are often used to perform this sanitization. However, when the
10
-
regex matches multiple consecutive characters, applying a regular expression replacement just once
10
+
regular expression matches multiple consecutive characters, replacing it just once
11
11
can result in the unsafe text re-appearing in the sanitized input.
12
12
</p>
13
13
<p>
@@ -25,7 +25,7 @@ possible. These libraries are more likely to handle corner cases and ensure effe
25
25
26
26
<p>
27
27
If a library is not an option, you can consider alternative strategies to fix the issue. For example,
28
-
applying the regular expression replacement recursively until a fixpoint is reached or to rewrite the regular
28
+
applying the regular expression replacement repeatedly until no more replacements can be performed or to rewrite the regular
29
29
expression to match single characters instead of the entire unsafe text.
30
30
</p>
31
31
</recommendation>
@@ -45,8 +45,8 @@ which still contains an HTML comment.
45
45
</p>
46
46
47
47
<p>
48
-
One possible fix for this issue is to apply the regular expression replacement recursively until a fixpoint
49
-
is reached. This ensures that the unsafe text does not re-appear in the sanitized input, effectively
48
+
One possible fix for this issue is to apply the regular expression replacement recursively until no
49
+
more replacements can be performed. This ensures that the unsafe text does not re-appear in the sanitized input, effectively
50
50
removing all instances of the targeted pattern:
51
51
</p>
52
52
@@ -90,7 +90,7 @@ function removeAllHtmlTags(input) {
90
90
91
91
<example>
92
92
<p>
93
-
Lastly, consider a path sanitizer using the regex <code>/\.\.\//</code>:
93
+
Lastly, consider a path sanitizer using the regular expression <code>/\.\.\//</code>:
94
94
</p>
95
95
96
96
<samplelanguage="javascript">
@@ -119,6 +119,6 @@ function sanitizePath(input) {
119
119
120
120
<references>
121
121
<li>OWASP Top 10: <ahref="https://www.owasp.org/index.php/Top_10-2017_A1-Injection">A1 Injection</a>.</li>
122
-
<li>Stackoverflow: <ahref="https://stackoverflow.com/questions/6659351/removing-all-script-tags-from-html-with-js-regular-expression">Removing all script tags from HTML with JS regular expression</a>.</li>
122
+
<li>Stack Overflow: <ahref="https://stackoverflow.com/questions/6659351/removing-all-script-tags-from-html-with-js-regular-expression">Removing all script tags from HTML with JS regular expression</a>.</li>
Copy file name to clipboardExpand all lines: ruby/ql/src/queries/security/cwe-116/IncompleteMultiCharacterSanitization.qhelp
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
<p>
8
8
Sanitizing untrusted input is a common technique for preventing injection attacks and other security
9
9
vulnerabilities. Regular expressions are often used to perform this sanitization. However, when the
10
-
regex matches multiple consecutive characters, applying a regular expression replacement just once
10
+
regular expression matches multiple consecutive characters, replacing it just once
11
11
can result in the unsafe text re-appearing in the sanitized input.
12
12
</p>
13
13
<p>
@@ -25,7 +25,7 @@ possible. These libraries are more likely to handle corner cases and ensure effe
25
25
26
26
<p>
27
27
If a library is not an option, you can consider alternative strategies to fix the issue. For example,
28
-
applying the regular expression replacement recursively until a fixpoint is reached or to rewrite the regular
28
+
applying the regular expression replacement repeatedly until no more replacements can be performed or to rewrite the regular
29
29
expression to match single characters instead of the entire unsafe text.
30
30
</p>
31
31
</recommendation>
@@ -45,8 +45,8 @@ which still contains an HTML comment.
45
45
</p>
46
46
47
47
<p>
48
-
One possible fix for this issue is to apply the regular expression replacement recursively until a fixpoint
49
-
is reached. This ensures that the unsafe text does not re-appear in the sanitized input, effectively
48
+
One possible fix for this issue is to apply the regular expression replacement recursively until no
49
+
more replacements can be performed. This ensures that the unsafe text does not re-appear in the sanitized input, effectively
50
50
removing all instances of the targeted pattern:
51
51
</p>
52
52
@@ -90,7 +90,7 @@ end
90
90
91
91
<example>
92
92
<p>
93
-
Lastly, consider a path sanitizer using the regex <code>/\.\.\//</code>:
93
+
Lastly, consider a path sanitizer using the regular expression <code>/\.\.\//</code>:
94
94
</p>
95
95
96
96
<samplelanguage="ruby">
@@ -119,6 +119,6 @@ end
119
119
120
120
<references>
121
121
<li>OWASP Top 10: <ahref="https://www.owasp.org/index.php/Top_10-2017_A1-Injection">A1 Injection</a>.</li>
122
-
<li>Stackoverflow: <ahref="https://stackoverflow.com/questions/6659351/removing-all-script-tags-from-html-with-js-regular-expression">Removing all script tags from HTML with JS regular expression</a>.</li>
122
+
<li>Stack Overflow: <ahref="https://stackoverflow.com/questions/6659351/removing-all-script-tags-from-html-with-js-regular-expression">Removing all script tags from HTML with JS regular expression</a>.</li>
0 commit comments