Skip to content

Server-Side Request Forgery (SSRF)

Description

This application allows user-controlled URLs to be passed directly to HTTP client libraries, which can result in Server-Side Request Forgery (SSRF). SSRF refers to an attack where the attacker can abuse functionality on the server to force it to make requests to other internal systems within your infrastructure that are not directly exposed to the internet.

Examples

Insecure Code

javascript
axios.get(userInput)

Secure Code

javascript
var whitelist = ["https://example.com", "https://example.com/sample"]; if(whitelist.includes(userInput)){ axios.get(userInput) }

Remediation

Use hardcoded HTTP request calls or a whitelisting object to check whether the user input is trying to access allowed resources or not.

Rule Details

FieldValue
IDCODE-0410
CategoryInjection
SeverityCRITICAL
CWECWE-918
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
TagsSSRF, Server-Side Request Forgery
OWASPA1:2017-Injection, A03:2021-Injection