CWE-918: Server-Side Request Forgery (SSRF)
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
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.
常见后果
影响范围: 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
观察示例
参考: 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
引入模式
| 阶段 | 说明 |
|---|---|
| Architecture and Design | - |
| Implementation | - |