File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
javascript/ql/src/Security/CWE-116 Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 23
23
<recommendation >
24
24
<p >
25
25
26
- Use a ( well-tested) sanitization library if at all
26
+ Use a well-tested sanitization library if at all
27
27
possible, and avoid modifying sanitized values further before treating
28
28
them as HTML.
29
29
36
36
37
37
The following function transforms a self-closing HTML tag
38
38
to a pair of open/close tags. It does so for all non-<code >img</code >
39
- and non-<code >area</code > tags using a regular expression with two
39
+ and non-<code >area</code > tags, by using a regular expression with two
40
40
capture groups. The first capture group corresponds to the name of the
41
- tag, and the second capture group corresponds to the content of
42
- the tag.
41
+ tag, and the second capture group to the content of the tag.
43
42
44
43
</p >
45
44
56
55
<p >
57
56
58
57
However, the function is not safe. As an example, consider
59
- the following string which does not result in an alert when a
60
- browser treats it as HTML:
58
+ the following string:
59
+
61
60
62
61
</p >
63
62
You can’t perform that action at this time.
0 commit comments