Server-Side Request Forgery (SSRF)

Incomplete Base
Structure: Simple
Description

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
Common Consequences 3
Scope: Confidentiality

Impact: Read Application Data

Scope: Integrity

Impact: Execute Unauthorized Code or Commands

Scope: Access Control

Impact: Bypass Protection Mechanism

By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.

Detection Methods 1
Automated Static AnalysisHigh
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Observed Examples 9
CVE-2024-3095SSRF in LLM application development framework because the URL retriever allows connections to local addresses using a crafted Location header
CVE-2023-32786Chain: LLM integration framework has prompt injection (Improper Neutralization of Input Used for LLM Prompting) that allows an attacker to force the service to retrieve data from an arbitrary URL, essentially providing SSRF (Server-Side Request Forgery (SSRF)) and potentially injecting content into downstream tasks.
CVE-2021-26855Server Side Request Forgery (SSRF) in mail server, as exploited in the wild per CISA KEV.
CVE-2021-21973Server Side Request Forgery in cloud platform, as exploited in the wild per CISA KEV.
CVE-2016-4029Chain: incorrect validation of intended decimal-based IP address format (Improper Validation of Syntactic Correctness of Input) enables parsing of octal or hexadecimal formats (Incorrect Parsing of Numbers with Different Radices), allowing bypass of an SSRF protection mechanism (Server-Side Request Forgery (SSRF)).
CVE-2002-1484Web server allows attackers to request a URL from another server, including other ports, which allows proxied scanning.
CVE-2004-2061CGI script accepts and retrieves incoming URLs.
CVE-2010-1637Web-based mail program allows internal network scanning using a modified POP3 port number.
CVE-2009-0037URL-downloading library automatically follows redirects to file:// and scp:// URLs
References 8
SSRF vs. Business-critical applications: XXE tunneling in SAP
Alexander Polyakov and Dmitry Chastukhin
26-07-2012
ID: REF-913
SSRF vs. Business-critical Applications. Part 1: XXE Tunnelling in SAP NetWeaver
Alexander Polyakov, Dmitry Chastukhin, and Alexey Tyurin
ID: REF-914
Cross Site Port Attacks - XSPA - Part 1
Riyaz Ahemed Walikar
07-11-2012
ID: REF-915
Cross Site Port Attacks - XSPA - Part 2
Riyaz Ahemed Walikar
13-11-2012
ID: REF-916
Cross Site Port Attacks - XSPA - Part 3
Riyaz Ahemed Walikar
14-11-2012
ID: REF-917
SSRF attacks and sockets: smorgasbord of vulnerabilities
Vladimir Vorontsov and Alexander Golovko
ID: REF-918
Web Portals: Gateway To Information, Or A Hole In Our Perimeter Defenses
Deral Heiland
02-2008
ID: REF-920
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Technologies:
AI/ML : UndeterminedWeb Server : Undetermined
Modes of Introduction
Architecture and Design
Implementation
Alternate Terms

XSPA

Cross Site Port Attack

SSRF

Server-Side Request Forgery
Notes
RelationshipServer-Side Request Forgery (SSRF) (SSRF) and Improper Restriction of XML External Entity Reference (XXE) are closely related, because they both involve web-related technologies and can launch outbound requests to unexpected destinations. However, XXE can be performed client-side, or in other contexts in which the software is not acting directly as a server, so the "Server" portion of the SSRF acronym does not necessarily apply.