Skip to content

Commit 7c4275a

Browse files
author
Max Schaefer
committed
Address review comments.
1 parent dc8be7b commit 7c4275a

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

csharp/ql/src/Security Features/CWE-079/XSS.qhelp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ without properly sanitizing the input first, allows for a cross-site scripting v
1313

1414
<p>
1515
To guard against cross-site scripting, consider using a library providing suitable encoding
16-
functionality, such as the <code>System.Net.WebUtility</code> class or the <code>AntiXSS</code> NuGet package,
17-
to sanitize the untrusted input before writing it to the page.
16+
functionality, such as the <code>System.Net.WebUtility</code> class to sanitize the untrusted input before writing it to the page.
1817
The references also mention other possible solutions.
1918
</p>
2019

@@ -25,15 +24,11 @@ The references also mention other possible solutions.
2524
The following example shows the page parameter being written directly to the server error page,
2625
leaving the website vulnerable to cross-site scripting.
2726
</p>
28-
<sample src="XSS.cs" />
27+
<sample src="XSSBad.cs" />
2928
<p>
3029
Sanitizing the user-controlled data using <code>WebUtility.HtmlEncode</code> method prevents the vulnerability:
3130
</p>
3231
<sample src="XSSGood.cs" />
33-
<p>
34-
Alternatively, the <code>AntiXSS</code> NuGet package can be used to sanitize the user-controlled data:
35-
</p>
36-
<sample src="XSSGood2.cs" />
3732

3833
</example>
3934
<references>
@@ -47,10 +42,6 @@ OWASP:
4742
<li>
4843
Wikipedia: <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">Cross-site scripting</a>.
4944
</li>
50-
<li>
51-
AntiXSS: <a href="https://www.nuget.org/packages/AntiXss">AntiXSS NuGet package</a>.
52-
</li>
53-
5445

5546
</references>
5647
</qhelp>

csharp/ql/src/Security Features/CWE-079/XSSGood2.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)