Server-side request forgery via user-controlled URL
ID |
vbnet.channel.server_side_request_forgery |
Severity |
critical |
Remediation Complexity |
medium |
Remediation Risk |
medium |
Remediation Effort |
medium |
Resource |
Channel |
Language |
VB.NET |
Description
User-controlled input flows into the URL of a server-side HTTP request, which may allow server-side request forgery (SSRF) against internal services or cloud metadata endpoints. Validate the destination against an allow-list of trusted hosts before issuing the request.
Rationale
User-controlled input flows into the URL of a server-side HTTP request, which may allow server-side request forgery (SSRF) against internal services or cloud metadata endpoints. Validate the destination against an allow-list of trusted hosts before issuing the request.
The following code illustrates a vulnerable pattern detected by this rule:
Public Sub WebRequestFromQueryString(ByVal Request As HttpRequest)
Dim url As String = Request.QueryString("url")
' VULNERABLE: Server-side request forgery via user-controlled URL
Dim req = WebRequest.Create(url)
End Sub
Remediation
Follow secure coding practices and review the references below for detailed remediation guidance.