2021-02-10 17:04:49 +01:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
|
|
|
|
== Sensitive Code Example
|
|
|
|
|
2023-08-28 09:47:38 +02:00
|
|
|
[source,vbnet]
|
2021-02-10 17:04:49 +01:00
|
|
|
----
|
|
|
|
Imports Microsoft.AspNetCore.Mvc
|
|
|
|
|
|
|
|
Public Class MyController
|
|
|
|
Inherits Controller
|
|
|
|
|
|
|
|
<HttpPost>
|
|
|
|
<DisableRequestSizeLimit> ' Sensitive: No size limit
|
2023-10-18 09:28:02 +02:00
|
|
|
<RequestSizeLimit(10485760)> ' Sensitive: 10485760 B = 10240 KB = 10 MB is more than the recommended limit of 8MB
|
2021-02-10 17:04:49 +01:00
|
|
|
Public Function PostRequest(Model model) As IActionResult
|
|
|
|
' ...
|
|
|
|
End Function
|
|
|
|
|
|
|
|
<HttpPost>
|
2023-10-18 09:28:02 +02:00
|
|
|
<RequestFormLimits(MultipartBodyLengthLimit = 10485760)> ' Sensitive: 10485760 B = 10240 KB = 10 MB is more than the recommended limit of 8MB
|
2021-02-10 17:04:49 +01:00
|
|
|
Public Function MultipartFormRequest(Model model) As IActionResult
|
|
|
|
' ...
|
|
|
|
End Function
|
|
|
|
|
|
|
|
End Class
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,vbnet]
|
2021-02-10 17:04:49 +01:00
|
|
|
----
|
|
|
|
Imports Microsoft.AspNetCore.Mvc
|
|
|
|
|
|
|
|
Public Class MyController
|
|
|
|
Inherits Controller
|
|
|
|
|
|
|
|
<HttpPost>
|
2023-10-18 09:28:02 +02:00
|
|
|
<RequestSizeLimit(8388608)> ' Compliant: 8388608 B = 8192 KB = 8 MB
|
2021-02-10 17:04:49 +01:00
|
|
|
Public Function PostRequest(Model model) As IActionResult
|
|
|
|
' ...
|
|
|
|
End Function
|
|
|
|
|
|
|
|
<HttpPost>
|
2023-10-18 09:28:02 +02:00
|
|
|
<RequestFormLimits(MultipartBodyLengthLimit = 8388608)> ' Compliant: 8388608 B = 8192 KB = 8 MB
|
2021-02-10 17:04:49 +01:00
|
|
|
Public Function MultipartFormRequest(Model model) AS IActionResult
|
|
|
|
' ...
|
|
|
|
End Function
|
|
|
|
|
|
|
|
End Class
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
2023-05-25 14:18:12 +02:00
|
|
|
=== Parameters
|
|
|
|
|
|
|
|
.fileUploadSizeLimit
|
|
|
|
****
|
|
|
|
_integer_
|
|
|
|
|
|
|
|
----
|
2023-10-18 09:28:02 +02:00
|
|
|
8388608
|
2023-05-25 14:18:12 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
The maximum size of HTTP requests handling file uploads (in bytes)
|
|
|
|
****
|
|
|
|
|
2021-09-20 15:38:42 +02:00
|
|
|
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2023-06-22 10:38:01 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|