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.

Resultant

XSPA
Cross Site Port Attack

SSRF
Server-Side Request Forgery

Architecture and Design

Implementation

Confidentiality
Read Application Data

Integrity
Execute Unauthorized Code or Commands

Access Control
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.

Automated Static Analysis
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.)
High

This code intends to receive a URL from a user, access the URL, and return the results to the user.

$url = $_GET['url'];# User-controlled input

# Fetch the content of the provided URL
$response = file_get_contents($url);
echo $response;

The given PHP code is vulnerable to Server-Side Request Forgery (SSRF) because it directly accepts a user-supplied URL from the $_GET['url'] parameter and fetches its content using file_get_contents(), without any validation or restrictions. This allows an attacker to request internal or restricted resources within the server's network, such as internal admin panels, cloud metadata endpoints, or local services running on localhost.

# Define allowed URLs (or domains)$allowed_urls = ['https://example.com/data.json','https://api.example.com/info',];# Get the user-provided URL$url = $_GET['url'] ?? '';# Validate against allowed URLsif (!in_array($url, $allowed_urls)) {http_response_code(400);echo "Invalid or unauthorized URL.";exit;}# Fetch content safely$response = @file_get_contents($url);if ($response === false) {http_response_code(500);echo "Failed to fetch content.";exit;}echo htmlspecialchars($response);# Escape output for safety

CVE-2024-3095
SSRF in LLM application development framework because the URL retriever allows connections to local addresses using a crafted Location header
https://www.cve.org/CVERecord?id=CVE-2024-3095

CVE-2023-32786
Chain: LLM integration framework has prompt injection
(CWE-1427) that allows an attacker to force the service to retrieve
data from an arbitrary URL, essentially providing SSRF (CWE-918) and
potentially injecting content into downstream tasks.
https://www.cve.org/CVERecord?id=CVE-2023-32786

CVE-2021-26855
Server Side Request Forgery (SSRF) in mail server, as exploited in the wild per CISA KEV.
https://www.cve.org/CVERecord?id=CVE-2021-26855

CVE-2021-21973
Server Side Request Forgery in cloud platform, as exploited in the wild per CISA KEV.
https://www.cve.org/CVERecord?id=CVE-2021-21973

CVE-2016-4029
Chain: incorrect validation of intended decimal-based IP address format (CWE-1286) enables parsing of octal or hexadecimal formats (CWE-1389), allowing bypass of an SSRF protection mechanism (CWE-918).
https://www.cve.org/CVERecord?id=CVE-2016-4029

CVE-2002-1484
Web server allows attackers to request a URL from another server, including other ports, which allows proxied scanning.
https://www.cve.org/CVERecord?id=CVE-2002-1484

CVE-2004-2061
CGI script accepts and retrieves incoming URLs.
https://www.cve.org/CVERecord?id=CVE-2004-2061

CVE-2010-1637
Web-based mail program allows internal network scanning using a modified POP3 port number.
https://www.cve.org/CVERecord?id=CVE-2010-1637

CVE-2009-0037
URL-downloading library automatically follows redirects to file:// and scp:// URLs
https://www.cve.org/CVERecord?id=CVE-2009-0037

Allowed
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

CWE-918 (SSRF) and CWE-611 (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.

CWE Content Team
MITRE
2013-02-17
2.4
2013-02-21

CWE Content Team
MITRE
2015-12-07
updated Relationships

CWE Content Team
MITRE
2017-01-19
updated Relationships

CWE Content Team
MITRE
2017-11-08
updated Applicable_Platforms, References

CWE Content Team
MITRE
2018-03-27
updated References

CWE Content Team
MITRE
2019-06-20
updated Relationships

CWE Content Team
MITRE
2020-02-24
updated Applicable_Platforms, Relationships

CWE Content Team
MITRE
2021-07-20
updated References, Related_Attack_Patterns, Relationships

CWE Content Team
MITRE
2021-10-28
updated Relationships

CWE Content Team
MITRE
2022-06-28
updated Observed_Examples, Relationships

CWE Content Team
MITRE
2022-10-13
updated Observed_Examples

CWE Content Team
MITRE
2023-04-27
updated Detection_Factors, References, Relationships

CWE Content Team
MITRE
2023-06-29
updated Mapping_Notes, Relationships

CWE Content Team
MITRE
2024-11-19
4.16
2024-11-19
updated Alternate_Terms, Common_Consequences, Description, Diagram, Observed_Examples, Relationships

CWE Content Team
MITRE
2025-09-09
4.18
2025-09-09
updated Applicable_Platforms, Observed_Examples, References

CWE Content Team
MITRE
2025-12-11
4.19
2025-12-11
updated Applicable_Platforms, Demonstrative_Examples, References, Relationships, Weakness_Ordinalities

Abhi Balakrishnan
2024-02-29
4.16
2024-11-19
Provided diagram to improve CWE usability

GitHub user ctflearner
2025-02-08
4.19
2025-12-11
Provided a PHP-based demonstrative example