- 필수 기능
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- 디지털 경험
- 소프트웨어 제공
- 보안
- 로그 관리
- 관리
- 인프라스트럭처
- ci
- containers
- csm
- ndm
- otel_guides
- overview
- slos
- synthetics
- tests
- 워크플로
ID: csharp-security/request-length
Language: C#
Severity: Warning
Category: Security
Do not allow large requests in your controller. This may lead to many resource allocations and may be a vector of attack for Denial of Services attacks. Always keep the request size to a reasonable estimate.
max-size
: Maximum size for requests. Default: 10000000.public class MyController : Controller
{
[DisableRequestSizeLimit]
public IActionResult MyRequest()
{
Console.WriteLine("inside controller");
}
}
public class MyController : Controller
{
[RequestSizeLimit(12000000)]
public IActionResult PostRequest()
{
Console.WriteLine("inside controller");
}
}
public class MyController : Controller
{
[RequestSizeLimit(500000)] // request is lower than the max (10000000 bytes)
public IActionResult MyRequest()
{
Console.WriteLine("inside controller");
}
}
|
|
For more information, please read the Code Analysis documentation
Identify code vulnerabilities directly in yourVS Code editor
Identify code vulnerabilities directly inJetBrains products