You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
protect applications against code injections. Downgrading or
13
+
disabling
14
+
this configuration is not recommended. The default value 4.5
15
+
is
16
+
the only recommended value as previous versions only
17
+
test a subset
18
+
of
19
+
requests.
20
+
</p>
21
+
22
+
</overview>
23
+
<recommendation>
24
+
25
+
<p>
26
+
Always set
27
+
<code>requestValidationMode</code>
28
+
to 4.5. (Default value)
29
+
</p>
30
+
31
+
</recommendation>
32
+
<example>
33
+
34
+
<p>
35
+
The following example shows the
36
+
<code>requestValidationMode</code>
37
+
attribute set to the value 4.0 which disables some protections and
38
+
ignores individual
39
+
<code>Page</code>
40
+
directives:
41
+
<code>
42
+
<httpRuntimerequestValidationMode="4.0" />
43
+
44
+
45
+
46
+
</code>
47
+
</p>
48
+
49
+
<p>
50
+
If the value is set to 2.0, request validation is enabled for pages
51
+
but not for all requests:
52
+
</p>
53
+
54
+
<code>
55
+
<httpRuntimerequestValidationMode="2.0" />
56
+
57
+
58
+
59
+
</code>
60
+
61
+
<p>
62
+
If the value is set to 0, request validation is completely disabled
63
+
(Only recognized in ASP.NET 4.6 and later):
64
+
</p>
65
+
66
+
<code>
67
+
<httpRuntimerequestValidationMode="0.0" />
68
+
69
+
70
+
71
+
</code>
72
+
</example>
73
+
<references>
74
+
75
+
<li>
76
+
Microsoft:
77
+
<a
78
+
href="https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.requestvalidationmode?view=netframework-4.8">requestValidationMode configuration to protect against code
79
+
injection attacks</a>
80
+
.
81
+
</li>
82
+
<li>
83
+
OWASP:
84
+
<a
85
+
href="https://www.owasp.org/index.php/ASP.NET_Request_Validation">ASP.NET Request Validation on OWASP</a>
0 commit comments