Skip to content

Commit eed87b3

Browse files
alexrfordnickrolfe
andcommitted
Apply suggestions from code review
Co-authored-by: Nick Rolfe <nickrolfe@github.com>
1 parent 205b141 commit eed87b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ql/src/queries/security/cwe-079/ReflectedXSS.qhelp

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

66
<overview>
77
<p>
8-
Directly writing user input (for example, an HTTP request parameter) to a webpage
8+
Directly writing user input (for example, an HTTP request parameter) to a webpage,
99
without properly sanitizing the input first, allows for a cross-site scripting
1010
vulnerability.
1111
</p>
@@ -19,25 +19,25 @@
1919
</p>
2020

2121
<p>
22-
Care should be taken when using methods such as <code>html_safe</code> or
23-
<code>raw</code>. These methods can be used to output a string without escaping
24-
it. As such, they should only be used when the string has already been manually
22+
Take care when using methods such as <code>html_safe</code> or
23+
<code>raw</code>. They can be used to emit a string without escaping
24+
it, and should only be used when the string has already been manually
2525
escaped (for example, with the Rails <code>html_escape</code> method), or when
2626
the content is otherwise guaranteed to be safe (such as a hard-coded string).
2727
</p>
2828
</recommendation>
2929

3030
<example>
3131
<p>
32-
In the following example is safe because the
32+
The following example is safe because the
3333
<code>params[:user_name]</code> content within the output tags will be
34-
automatically HTML escaped before being output.
34+
HTML-escaped automatically before being emitted.
3535
</p>
3636
<sample src="examples/safe.html.erb" />
3737

3838
<p>
3939
However, the following example is unsafe because user-controlled input is
40-
output without escaping due to being marked as <code>html_safe</code>.
40+
output without escaping, since it is marked as <code>html_safe</code>.
4141
</p>
4242
<sample src="examples/reflective_xss.html.erb" />
4343
</example>

0 commit comments

Comments
 (0)