-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathASPNetRequestValidationMode.qhelp
More file actions
87 lines (67 loc) · 1.7 KB
/
ASPNetRequestValidationMode.qhelp
File metadata and controls
87 lines (67 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE qhelp PUBLIC "-//Semmle//qhelp//EN" "qhelp.dtd">
<qhelp>
<overview>
<p>
The
<code>requestValidationMode</code>
attribute in ASP.NET is used to configure
built-in validations to
protect applications against code injections. Downgrading or
disabling
this configuration is not recommended. The default value 4.5
is
the only recommended value as previous versions only
test a subset
of
requests.
</p>
</overview>
<recommendation>
<p>
Always set
<code>requestValidationMode</code>
to 4.5. (Default value)
</p>
</recommendation>
<example>
<p>
The following example shows the
<code>requestValidationMode</code>
attribute set to the value 4.0 which disables some protections and
ignores individual
<code>Page</code>
directives:
<code>
<httpRuntime requestValidationMode="4.0" />
</code>
</p>
<p>
If the value is set to 2.0, request validation is enabled for pages
but not for all requests:
</p>
<code>
<httpRuntime requestValidationMode="2.0" />
</code>
<p>
If the value is set to 0, request validation is completely disabled
(Only recognized in ASP.NET 4.6 and later):
</p>
<code>
<httpRuntime requestValidationMode="0.0" />
</code>
</example>
<references>
<li>
Microsoft:
<a
href="https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.httpruntimesection.requestvalidationmode?view=netframework-4.8">requestValidationMode configuration to protect against code
injection attacks</a>
.
</li>
<li>
OWASP:
<a
href="https://www.owasp.org/index.php/ASP.NET_Request_Validation">ASP.NET Request Validation on OWASP</a>
</li>
</references>
</qhelp>