Skip to content

Commit aafae24

Browse files
committed
update qhelp
1 parent 8d556ed commit aafae24

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
<overview>
77
<p>
8-
Parsing general HTML using regular expressions is impossible, however it is possible to match
9-
single HTML tags. However, if the regexp is not written well it might be easy
8+
It is possible to match some single HTML tags using regular expressions (parsing general HTML using
9+
regular expressions is impossible). However, if the regexp is not written well it might be easy
1010
to circumvent the regexp, which can lead to XSS or other security issues.
1111
</p>
1212
<p>
@@ -25,14 +25,13 @@ likely to handle corner cases correctly than a custom implementation.
2525

2626
<example>
2727
<p>
28-
For example, assume we want to write a function that filters out all <code>&lt;script&gt;</code> tags.
29-
Such a function might be written like below:
28+
The following example attempts to filters out all <code>&lt;script&gt;</code> tags.
3029
</p>
3130

3231
<sample src="examples/BadTagFilter.js" />
3332

3433
<p>
35-
This sanitizer does not filter out all <code>&lt;script&gt;</code> tags.
34+
The above sanitizer does not filter out all <code>&lt;script&gt;</code> tags.
3635
Browsers will not only accept <code>&lt;/script&gt;</code> as script end tags, but also tags such as <code>&lt;/script foo="bar"&gt;</code> even though it is a parser error.
3736
This means that an attack string such as <code>&lt;script&gt;alert(1)&lt;/script foo="bar"&gt;</code> will not be filtered by
3837
the function, but <code>alert(1)</code> will be executed by a browser if the string is rendered as HTML.

python/ql/src/Security/CWE-116/BadTagFilter.qhelp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
<overview>
77
<p>
8-
Parsing general HTML using regular expressions is impossible, however it is possible to match
9-
single HTML tags. However, if the regexp is not written well it might be easy
8+
It is possible to match some single HTML tags using regular expressions (parsing general HTML using
9+
regular expressions is impossible). However, if the regexp is not written well it might be easy
1010
to circumvent the regexp, which can lead to XSS or other security issues.
1111
</p>
1212
<p>
@@ -25,14 +25,13 @@ likely to handle corner cases correctly than a custom implementation.
2525

2626
<example>
2727
<p>
28-
For example, assume we want to write a function that filters out all <code>&lt;script&gt;</code> tags.
29-
Such a function might be written like below:
28+
The following example attempts to filters out all <code>&lt;script&gt;</code> tags.
3029
</p>
3130

3231
<sample src="examples/BadTagFilter.py" />
3332

3433
<p>
35-
This sanitizer does not filter out all <code>&lt;script&gt;</code> tags.
34+
The above sanitizer does not filter out all <code>&lt;script&gt;</code> tags.
3635
Browsers will not only accept <code>&lt;/script&gt;</code> as script end tags, but also tags such as <code>&lt;/script foo="bar"&gt;</code> even though it is a parser error.
3736
This means that an attack string such as <code>&lt;script&gt;alert(1)&lt;/script foo="bar"&gt;</code> will not be filtered by
3837
the function, but <code>alert(1)</code> will be executed by a browser if the string is rendered as HTML.

0 commit comments

Comments
 (0)