
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
112 lines
2.0 KiB
Plaintext
112 lines
2.0 KiB
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
At Controller level:
|
|
|
|
----
|
|
<ValidateInput(False)>
|
|
Public Function Welcome(Name As String) As ActionResult
|
|
...
|
|
End Function
|
|
----
|
|
|
|
At application level, configured in the Web.config file:
|
|
|
|
----
|
|
<configuration>
|
|
<system.web>
|
|
<pages validateRequest="false" />
|
|
...
|
|
<httpRuntime requestValidationMode="0.0" />
|
|
</system.web>
|
|
</configuration>
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
At Controller level:
|
|
|
|
[source,vbnet]
|
|
----
|
|
<ValidateInput(True)>
|
|
Public Function Welcome(Name As String) As ActionResult
|
|
...
|
|
End Function
|
|
----
|
|
or
|
|
|
|
[source,vbnet]
|
|
----
|
|
Public Function Welcome(Name As String) As ActionResult
|
|
...
|
|
End Function
|
|
----
|
|
|
|
At application level, configured in the Web.config file:
|
|
|
|
[source,vbnet]
|
|
----
|
|
<configuration>
|
|
<system.web>
|
|
<pages validateRequest="true" />
|
|
...
|
|
<httpRuntime requestValidationMode="4.5" />
|
|
</system.web>
|
|
</configuration>
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 15 Jan 2021, 18:31:49 Andrei Epure wrote:
|
|
== Sensitive Code Example
|
|
|
|
At application level, configured in the Web.config file:
|
|
|
|
----
|
|
<configuration>
|
|
<system.web>
|
|
<pages validateRequest="false" />
|
|
...
|
|
<httpRuntime requestValidationMode="0.0" />
|
|
</system.web>
|
|
</configuration>
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
At application level, configured in the Web.config file:
|
|
|
|
[source,vbnet]
|
|
----
|
|
<configuration>
|
|
<system.web>
|
|
<pages validateRequest="true" />
|
|
...
|
|
<!-- see https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.requestvalidationmode?view=netframework-4.8 -->
|
|
<httpRuntime requestValidationMode="4.5" />
|
|
</system.web>
|
|
</configuration>
|
|
----
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|