Skip to content

User Input Controls Remote URL Destination

Description

Detected user input flowing into the construction of a URL, which can lead to Server-Side Request Forgery (SSRF). Use allowlists for host validation to prevent this vulnerability.

Examples

Insecure Code

java
new URL(userInput);

Secure Code

java
if (allowlist.contains(url)) {
  new URL(url);
}

Remediation

Validate user input against an allowlist before constructing URLs.

Rule Details

FieldValue
IDCODE-0101
CategoryInjection
SeverityCRITICAL
CWECWE-918
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
Tagsssrf, server-side request forgery
OWASPA10:2021-Server-Side Request Forgery