---
title: "CWE-918: Server-Side Request Forgery"
url: https://radicalnotion.ai/cwe/cwe-918
type: cwe
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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-918: Server-Side Request Forgery

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 4,026
- **Of those, in CISA KEV:** 25
- **New in 2026:** 2,204
- **CWE catalog version:** 4.21

## 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.

## Alternate terms

- **XSPA:** Cross Site Port Attack
- **SSRF:** Server-Side Request Forgery

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | - |

## Applicable platforms

**Technologies:** Web Based (Undetermined), AI/ML (Often), Web Server (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| 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. |

## Potential mitigations

### Implementation, Operation

If there is a known list of applications, IP, hostname, and/or domains to which the product is allowed to communicate, then use allowlists to ensure that outgoing requests are restricted to these known entities. The allowlists could be in the application code or possibly enforced by firewalls or network segmentation \[REF-1511\].

### Implementation, Operation

If the product is expected to be able to connect to arbitrary IP addresses or domains, consider using a denylist that includes private network addresses, internal domain names, etc. The denylist could be in the application code or possibly enforced by firewalls or network segmentation \[REF-1511\].

Effectiveness: Moderate. While denylists can often be bypassed (see CWE-184), this might be the strongest option available.

### Implementation (Input Validation)

Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

When constructing outgoing requests from input strings, use stringent allowlists that limit the character set based on the expected value of the parameter in the request. This will indirectly limit the scope of an attack, but this technique is less important than proper output encoding and escaping.

## Detection methods

### 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.)

Effectiveness: High

## Demonstrative examples

### Example 1

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

Bad code:

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

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

echo $response;
```

Good code:

```php
# 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 URLs
if (!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
```

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.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2026-33626 | SSRF in LLM toolkit accesses arbitrary URLs for images, as exploited in the wild in April 2026 to conduct port scanning \[REF-1519\] |
| CVE-2024-3095 | SSRF in LLM application development framework because the URL retriever allows connections to local addresses using a crafted Location header |
| 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. |
| CVE-2021-26855 | Server Side Request Forgery (SSRF) in mail server, as exploited in the wild per CISA KEV. |
| CVE-2021-21973 | Server Side Request Forgery in cloud platform, as exploited in the wild per CISA KEV. |
| 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). |
| CVE-2002-1484 | Web server allows attackers to request a URL from another server, including other ports, which allows proxied scanning. |
| CVE-2004-2061 | CGI script accepts and retrieves incoming URLs. |
| CVE-2010-1637 | Web-based mail program allows internal network scanning using a modified POP3 port number. |
| CVE-2009-0037 | URL-downloading library automatically follows redirects to file:// and scp:// URLs |

## Real CVEs with this weakness (sample of 12 of 4,026)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-83548 | SonicWall SMA1000 Appliances Server-Side Request Forgery Vulnerability | critical | 10.0 | - | Yes | 2026-09-01 |
| CVE-2026-15409 | SonicWall SMA1000 Appliances Server-Side Request Forgery Vulnerability | critical | 10.0 | - | Yes | 2026-07-14 |
| CVE-2021-34473 | Microsoft Exchange Server Remote Code Execution Vulnerability | critical | 10.0 | - | Yes | 2021-07-14 |
| CVE-2026-134624 | MailAssure / SpamExperts: Server-Side Request Forgery in relay LDAP synchronisation connection check | critical | 9.3 | - | Yes | 2026-11-22 |
| CVE-2026-64849 | MLflow: Unauthenticated full-read SSRF in webhook delivery: \_validate\_webhook\_url bypassed via unvalidated HTTP redirects (and DNS rebinding) | critical | 9.3 | - | Yes | 2026-08-17 |
| CVE-2021-22986 | F5 BIG-IP and BIG-IQ Centralized Management iControl REST Remote Code Execution Vulnerability | critical | 9.3 | - | Yes | 2021-03-31 |
| CVE-2021-26855 | Microsoft Exchange Server Remote Code Execution Vulnerability | critical | 9.3 | - | Yes | 2021-03-02 |
| CVE-2021-27103 | Accellion FTA Server-Side Request Forgery (SSRF) Vulnerability | critical | 9.3 | - | Yes | 2021-02-16 |
| CVE-2020-7796 | Synacor Zimbra Collaboration Suite (ZCS) Server-Side Request Forgery Vulnerability | critical | 9.3 | - | Yes | 2020-02-18 |
| CVE-2025-61884 | Oracle Configurator: Runtime UI - unauthorized data access | high | 8.7 | - | Yes | 2025-10-12 |
| CVE-2022-41040 | Microsoft Exchange Server Elevation of Privilege Vulnerability | high | 8.7 | - | Yes | 2022-10-03 |
| CVE-2021-22054 | Omnissa Workspace ONE Server-Side Request Forgery | high | 8.7 | - | Yes | 2021-12-17 |

## Related attack patterns (CAPEC)

- [CAPEC-664](https://radicalnotion.ai/capec/capec-664): Server Side Request Forgery

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-441](https://radicalnotion.ai/cwe/cwe-441) | Unintended Proxy or Intermediary |
| Parent | [CWE-610](https://radicalnotion.ai/cwe/cwe-610) | Externally Controlled Reference to a Resource in Another Sphere |

## Frequently asked questions

### What is CWE-918?

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.

### What CVEs are caused by CWE-918?

4,026 recorded CVEs are attributed to CWE-918, including CVE-2026-83548, CVE-2026-15409 and CVE-2021-34473. 25 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-918?

If there is a known list of applications, IP, hostname, and/or domains to which the product is allowed to communicate, then use allowlists to ensure that outgoing requests are restricted to these known entities. The allowlists could be in the application code or possibly enforced by firewalls or network segmentation.

### How is CWE-918 detected?

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.)

### What are the consequences of CWE-918?

Exploiting CWE-918 can lead to: Read Application Data, Execute Unauthorized Code or Commands, Bypass Protection Mechanism.

### Is CWE-918 actively exploited?

Yes. 25 CWE-918 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 4,026 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/918.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-918). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
