Skip to content

Commit 3e2b812

Browse files
committed
apply suggestions from review
1 parent bea4162 commit 3e2b812

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

javascript/ql/src/Security/CWE-116/IncompleteMultiCharacterSanitization.qhelp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<p>
88
Sanitizing untrusted input is a common technique for preventing injection attacks and other security
99
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
1111
can result in the unsafe text re-appearing in the sanitized input.
1212
</p>
1313
<p>
@@ -25,7 +25,7 @@ possible. These libraries are more likely to handle corner cases and ensure effe
2525

2626
<p>
2727
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
2929
expression to match single characters instead of the entire unsafe text.
3030
</p>
3131
</recommendation>
@@ -45,8 +45,8 @@ which still contains an HTML comment.
4545
</p>
4646

4747
<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
5050
removing all instances of the targeted pattern:
5151
</p>
5252

@@ -90,7 +90,7 @@ function removeAllHtmlTags(input) {
9090

9191
<example>
9292
<p>
93-
Lastly, consider a path sanitizer using the regex <code>/\.\.\//</code>:
93+
Lastly, consider a path sanitizer using the regular expression <code>/\.\.\//</code>:
9494
</p>
9595

9696
<sample language="javascript">
@@ -119,6 +119,6 @@ function sanitizePath(input) {
119119

120120
<references>
121121
<li>OWASP Top 10: <a href="https://www.owasp.org/index.php/Top_10-2017_A1-Injection">A1 Injection</a>.</li>
122-
<li>Stackoverflow: <a href="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: <a href="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>
123123
</references>
124124
</qhelp>

ruby/ql/src/queries/security/cwe-116/IncompleteMultiCharacterSanitization.qhelp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<p>
88
Sanitizing untrusted input is a common technique for preventing injection attacks and other security
99
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
1111
can result in the unsafe text re-appearing in the sanitized input.
1212
</p>
1313
<p>
@@ -25,7 +25,7 @@ possible. These libraries are more likely to handle corner cases and ensure effe
2525

2626
<p>
2727
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
2929
expression to match single characters instead of the entire unsafe text.
3030
</p>
3131
</recommendation>
@@ -45,8 +45,8 @@ which still contains an HTML comment.
4545
</p>
4646

4747
<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
5050
removing all instances of the targeted pattern:
5151
</p>
5252

@@ -90,7 +90,7 @@ end
9090

9191
<example>
9292
<p>
93-
Lastly, consider a path sanitizer using the regex <code>/\.\.\//</code>:
93+
Lastly, consider a path sanitizer using the regular expression <code>/\.\.\//</code>:
9494
</p>
9595

9696
<sample language="ruby">
@@ -119,6 +119,6 @@ end
119119

120120
<references>
121121
<li>OWASP Top 10: <a href="https://www.owasp.org/index.php/Top_10-2017_A1-Injection">A1 Injection</a>.</li>
122-
<li>Stackoverflow: <a href="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: <a href="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>
123123
</references>
124124
</qhelp>

0 commit comments

Comments
 (0)