Skip to content

Commit 7cc3a5a

Browse files
committed
JS: qhelp fixups
1 parent 6919157 commit 7cc3a5a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
Sanitizing untrusted input for HTML meta-characters is an
1010
important technique for preventing cross-site scripting attacks. But
1111
even a sanitized input can be dangerous to use if it is modified
12-
further before it is parsed as HTML.
12+
further before a browser treats it as HTML.
1313

1414
A seemingly innocent transformation that expands a
15-
self-closing HTML tag from <code>&gt;div attr="{sanitized}"/&lt;</code>
16-
to <code>&gt;div attr="{sanitized}"&gt;&lt;/div&gt;</code> may
15+
self-closing HTML tag from <code>&lt;div attr="{sanitized}"/&gt;</code>
16+
to <code>&lt;div attr="{sanitized}"&gt;&lt;/div&gt;</code> may
1717
in fact cause cross-site scripting vulnerabilities.
1818

1919
</p>
@@ -24,7 +24,7 @@
2424
<p>
2525

2626
Use a (well-tested) sanitization library if at all
27-
possible, and avoid modifying sanitized values further before parsing
27+
possible, and avoid modifying sanitized values further before treating
2828
them as HTML.
2929

3030
</p>
@@ -49,15 +49,15 @@
4949

5050
While it is generally known regular expressions are
5151
ill-suited for parsing HTML, variants of this particular transformation
52-
pattern has long been considered safe.
52+
pattern have long been considered safe.
5353

5454
</p>
5555

5656
<p>
5757

5858
However, the function is not safe. As an example, consider
59-
the following string which does not result in an alert when it is
60-
treated as HTML:
59+
the following string which does not result in an alert when a
60+
browser treats it as HTML:
6161

6262
</p>
6363

@@ -66,8 +66,7 @@
6666
<p>
6767

6868
When the above function transforms the string, it becomes
69-
a string that results in an alert when it is treated as HTML by a
70-
modern browser:
69+
a string that results in an alert when a browser treats it as HTML.
7170

7271
</p>
7372

0 commit comments

Comments
 (0)