19 lines
372 B
Plaintext
19 lines
372 B
Plaintext
![]() |
include::../description.adoc[]
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
string name = Request.QueryString["name"];
|
||
|
Response.Write("Hello " + name); // Noncompliant
|
||
|
----
|
||
|
|
||
|
== Compliant Solution
|
||
|
|
||
|
----
|
||
|
string name = Request.QueryString["name"];
|
||
|
name = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(name, true);
|
||
|
Response.Write("Hello " + name);
|
||
|
----
|
||
|
|
||
|
include::../see.adoc[]
|