Problem Framing
Server-Side Request Forgery (SSRF) represents a class of vulnerabilities that allows an attacker to induce a server-side application to make unintended or malicious HTTP requests to an arbitrary domain of the attacker's choosing. This can range from internal network resource enumeration and exploitation to exfiltrating sensitive cloud credentials. The core problem stems from an application's inability to distinguish between a legitimate, trusted destination for a server-initiated request and a malicious one supplied by an attacker.
SSRF vulnerabilities are particularly insidious due to their potential to bypass network-level security controls such as firewalls and network segmentation. By tricking a server into making a request from within a trusted network boundary, an attacker can often access internal services, databases, or administrative interfaces that would otherwise be inaccessible from the external network. The impact can be severe, leading to unauthorized data access, system compromise, and lateral movement within an organization's infrastructure.
The landscape of SSRF is constantly evolving, driven by the increasing adoption of cloud-native architectures, microservices, and complex application frameworks. Cloud provider metadata services, such as AWS EC2 Instance Metadata Service (IMDS) and its equivalents in GCP and Azure, have become prime targets for SSRF exploitation, as they often provide temporary credentials for cloud resources that can grant broad access to sensitive data and services [1][2][3][4][5][6][7][8][9][10][11].
Modern applications often rely on numerous libraries and external services for functionality, introducing further complexity. Features like webhook integrations, PDF generation, image fetching, and external data imports that process user-supplied URLs are common vectors for SSRF. The attack surface expands with the use of AI agents and LLM-based systems, where the inherent need to fetch and process information from various sources can be exploited if not properly secured [12][13][14][15][16].
A significant challenge in detecting and preventing SSRF lies in the myriad ways attackers can bypass validation mechanisms. These include leveraging different URL schemes beyond HTTP/HTTPS, employing various IP address representations (decimal, octal, hexadecimal, IPv6), utilizing DNS rebinding techniques, exploiting discrepancies in URL parsing between different components, and chaining SSRF with other vulnerabilities like open redirects or XML External Entity (XXE) injections [17][18][19][20][21][22][23][24][25][26][27][28][29][30].
Core Mechanics
At its heart, SSRF is about manipulating a server's ability to initiate network requests. An attacker identifies an input point within an application that is used to construct or control a URL for a server-side request. The application then, without sufficient validation, uses this attacker-controlled URL to make a request to an external or internal resource.
The request flow typically looks like this:
- Attacker Input: The attacker provides a crafted URL or a component of a URL (e.g., hostname, path) through a vulnerable input field.
- Server-Side Processing: The application takes this input and uses it to construct a request to a target resource. This might involve fetching an image, making an API call, sending a webhook, rendering a PDF, or processing an XML entity.
- Unintended Destination: Instead of targeting a legitimate, expected resource, the server-side request is directed to an attacker-chosen destination.
- Exploitation: The attacker observes the outcome of the server's request. This could involve receiving sensitive data (credentials, internal files), scanning internal networks, triggering actions on internal services, or receiving confirmation of the request through out-of-band channels (in the case of blind SSRF).
SSRF vulnerabilities can be broadly categorized based on the visibility of the response to the attacker:
- Non-Blind SSRF: The application directly returns the response from the forged request to the attacker. This is the most straightforward to exploit as the attacker can immediately see the results of their request.
- Partial-Blind SSRF: The attacker does not receive the full response content but might infer success or failure from elements like HTTP status codes, error messages, or headers.
- Blind SSRF: The attacker receives no discernible response from the server regarding the forged request. Exploitation relies on out-of-band detection mechanisms, such as monitoring DNS lookups or HTTP callbacks to an attacker-controlled server, or inferring success through timing differences or side effects [31][32][33][34][35][36].
The protocols that can be abused are not limited to HTTP/HTTPS. Attackers often leverage other URL schemes that the underlying server or client libraries might support, such as:
file://: To read local files on the server. [25][27][37][28][38]gopher://: A versatile protocol that can be used to send arbitrary TCP data, allowing interaction with various services like Redis or Memcached, often leading to RCE. [25][27][28][39][40]dict://: Can be used to interact with Redis databases. [25][27][28]ldap://: For querying LDAP servers. [25][27][28]sftp://: For interacting with SFTP servers. [25][27][28]tftp://: For interacting with TFTP servers. [25][27][28]jar://: Used in Java applications. [27]netdoc://: Less common but can be exploited. [27]
The ability to reach internal IP address ranges (RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), localhost (127.0.0.1), and cloud metadata endpoints (e.g., 169.254.169.254 in AWS) are key objectives for attackers [20][24][41][42].
Notable Techniques
SSRF exploitation techniques are diverse and continuously evolving. Attackers exploit various misconfigurations and application logic flaws:
Cloud Metadata Services Abuse
Accessing cloud provider metadata services is a common and high-impact SSRF technique. These services, typically accessible via a special link-local IP address (e.g., 169.254.169.254 for AWS IMDS), expose temporary credentials, security tokens, and instance information. Stealing these credentials can grant attackers broad access to cloud resources like S3 buckets, RDS databases, and IAM roles [1][2][3][4][5][6][7][8][9][10][11][43][44][45][46][47].
Attackers often bypass IMDSv2's PUT-only requirement for credential requests by exploiting redirect logic or other HTTP manipulations to achieve credential exfiltration [48][49][50].
Bypassing IP Address and Host Restrictions
Many applications attempt to mitigate SSRF by blocking requests to internal IP addresses or specific hostnames. Attackers employ various techniques to circumvent these restrictions:
- DNS Rebinding: An attacker controls a domain that initially resolves to a safe, public IP address. After the application validates the hostname, the DNS record is rapidly changed to point to a malicious internal IP address, allowing the forged request to proceed [17][51][50][22][23][24][29].
- Alternative IP Representations: Using decimal, octal, hexadecimal, or IPv6-mapped IPv4 addresses can bypass naive IP address filters. For example, 127.0.0.1 can be represented as
017700000001(octal) or::ffff:127.0.0.1(IPv6) [19][52][28][38]. - Domain Redirects: Exploiting HTTP redirect mechanisms (e.g., 302, 307, 308) can be used to forward requests to an internal target after initial validation. This is particularly effective when the validation is performed on the initial URL, but the actual fetch follows the redirect without re-validation [12][53][54][21][50][24][55][56].
- URL Parsing Discrepancies: Different libraries or components may parse URLs differently. Exploiting these discrepancies, such as handling of fragments (
#), encoded characters, or specific delimiters, can lead to bypasses [53][21][24]. - Unicode and Special Characters: Manipulating URLs with Unicode characters or special characters can sometimes confuse parsers and bypass filters [57].
- Null Byte Truncation: Appending a null byte (
%00or\x00) can truncate string processing, allowing a malicious suffix to be appended to a seemingly safe URL [58].
Exploiting Specific Application Features
Many common application features can become SSRF vectors if they process user-supplied URLs without adequate validation:
- Webhooks: Applications that send webhooks to user-configured endpoints are prime targets. Validation might occur at configuration time but not during delivery, allowing redirects to internal or metadata endpoints [12].
- PDF Generators: Applications that convert HTML to PDF can be tricked into fetching external resources via CSS stylesheets or embedded HTML/JavaScript. This can be used to target cloud metadata services [13][59][60][61][62].
- Image Fetching/Uploads: Features that fetch images from a user-supplied URL (e.g., profile pictures, remote image previews) or handle image uploads with URL parameters can be exploited [44][63][64].
- XML Parsers (XXE): XML External Entity (XXE) vulnerabilities can be chained with SSRF by referencing an external HTTP URL in an entity declaration, forcing the XML parser to act as an HTTP client [18][65][66][37][67].
- AI Agents and LLM Pipelines: AI agents that fetch data from external sources, particularly in Retrieval Augmented Generation (RAG) pipelines, can be manipulated. If granted excessive network access without proper runtime validation, they can become SSRF vectors [68][14][15].
- Screenshot/Rendering Services: Features that generate screenshots or render web pages can be abused to trigger SSRF and capture internal data [69].
- Package Repositories: Features like VCS remote download requests in artifact repositories can be exploited [70].
- API Endpoints: Unauthenticated access to API endpoints that directly pass caller-controlled endpoints to HTTP request methods is a common vulnerability [71].
SSRF Chaining for RCE
SSRF alone can provide significant access, but it's often chained with other vulnerabilities to achieve Remote Code Execution (RCE). This can involve:
- Targeting Services with RCE Vulnerabilities: Using SSRF to send crafted requests to internal services that have known RCE vulnerabilities (e.g., Redis, Elasticsearch, specific administrative interfaces) [72][39][40].
- Exploiting File Write Vulnerabilities: If SSRF can lead to writing a malicious file to the server, combined with an arbitrary file write vulnerability, RCE can be achieved [73][74].
- Exploiting Deserialization Vulnerabilities: SSRF can be used to deliver malicious payloads to deserialization sinks.
- HTTP Request Smuggling: Techniques like HTTP/2 request smuggling can be combined with SSRF to poison request queues or bypass security controls, potentially leading to RCE [75][76][77].
Blind SSRF Exploitation
When direct responses are not visible, attackers use creative methods to confirm SSRF and extract information:
- Out-of-Band (OAST) Channels: Using tools like Burp Collaborator or Interactsh to monitor DNS lookups or HTTP callbacks to attacker-controlled domains [31][32][33][35][36].
- Timing-Based Attacks: Measuring the time it takes for a request to complete can reveal information about the target, especially when combined with sequential probing of internal IPs or ports [78].
- Error Messages and Status Codes: Partial responses can provide clues about the success of a request or the internal network structure.
Notable Techniques in Detail
Cloud Metadata Exfiltration Beyond IMDSv1
While IMDSv1 is widely understood as a target, attackers continue to find ways to access cloud metadata, even when IMDSv2 is in place. Techniques include exploiting redirect logic that might bypass IMDSv2's PUT-only requirement for token acquisition [48], or chaining SSRF vulnerabilities with other misconfigurations to bypass security controls [79]. The core principle remains: tricking the server into making a request to the metadata endpoint (169.254.169.254 for AWS) to retrieve temporary IAM credentials or other sensitive information [2][4][5][6][7][8][9][10][11][43][44][45][46][47].
HTTP/2 Request Smuggling
HTTP/2 introduced new complexities that can lead to request smuggling vulnerabilities. Exploiting HTTP/2 frame multiplexing or misconfigurations in H2C (HTTP/2 Cleartext) support can allow attackers to send SSRF payloads to internal services, bypassing perimeter defenses [80][76][77]. This can be combined with response queue poisoning to achieve RCE or bypass authentication.
PDF Generation and HTML/JavaScript Injection
The functionality of generating PDFs from HTML input is a recurring SSRF vector. By injecting HTML with external stylesheet references or JavaScript code that makes server-side requests, attackers can target internal resources or cloud metadata endpoints. The underlying rendering engine (e.g., headless Chromium) can be tricked into making these requests, with OOB callbacks often used for confirmation [13][59][60][61][81][62]. If the PDF generator runs in an un-sandboxed environment with root privileges, this can lead to RCE [82].
AI Agent and LLM Pipeline Exploitation
The increasing integration of AI agents and LLMs into applications presents new SSRF attack surfaces. When these agents require fetching data from various sources, if the underlying fetching mechanisms are not rigorously validated, they can be tricked into accessing internal networks or sensitive metadata. This pattern is observed in AI agents with excessive network access granted without runtime validation, or in LLM applications like RAG pipelines where user-provided prompts can influence data fetching [68][14][15]. ChatGPT's custom GPT actions have also been a target, allowing redirection to Azure IMDS or other internal endpoints [83][84][85][86][16][87][88][89][90][91].
XXE Beyond Basic XML Parsing
While XXE is a well-known vulnerability, its application in SSRF is still potent. Beyond standard XML documents, XXE can be found in Office Open XML parsers, SVG files, and other structured data formats. Leveraging XXE to trigger SSRF allows attackers to access internal services, read local files, and even exfiltrate cloud credentials [18][65][66][37][67][77].
Leveraging URL Parsing and Protocol Handlers
Attackers exploit the inherent complexity and potential inconsistencies in how different components parse URLs. This includes manipulating the order of operations, using different encodings, or exploiting parser differences between edge infrastructure (like load balancers or WAFs) and the application logic itself [53][21][24][28][30]. The abuse of less common protocol handlers like gopher:// is particularly powerful for interacting with arbitrary TCP services and often leads to RCE [25][27][28][39][40].
Notable Techniques in Practice
Portainer SSRF via URL Validation Bypass
In Portainer, a Docker management UI, an SSRF vulnerability (GHSA-wqqf-pwjh-2hm6) allowed signed-in users to fetch internal addresses or cloud metadata. The vulnerability exploited improper validation of user-supplied URLs, where the application might check for well-formedness but not adequately validate the destination, allowing it to reach internal services or metadata endpoints [92].
MLflow Webhook SSRF Leading to Cloud Credential Theft
MLflow's model registry webhook functionality was found to be vulnerable to SSRF (CVE-2026-64849). The issue stemmed from inadequate validation of webhook target URLs. While the configuration might impose some restrictions, the delivery mechanism did not re-validate the destination, allowing redirects to cloud metadata services like 169.254.169.254. This led to the retrieval of cloud tokens, actively exploited by ransomware gangs [12][93].
SonicWall SMA1000 SSRF Chains
SonicWall SMA1000 devices have been targeted by sophisticated SSRF exploitation chains. CVE-2026-15409 involved an unauthenticated SSRF that could be chained with other vulnerabilities to achieve Erlang RCE and subsequently steal credentials for Active Directory attacks [94]. A subsequent zero-day chain exploited similar architectural weaknesses, combining SSRF with command injection [95].
Next.js Middleware SSRF
Vulnerabilities in Next.js, such as CVE-2025-57822, have demonstrated SSRF stemming from improperly sanitized input in middleware, allowing attackers to forge requests. These issues can impact self-hosted Next.js applications and require specific version upgrades for remediation [96][97][98].
Axios Vulnerabilities (Header Injection, NO_PROXY Bypass)
The widely used Axios HTTP client library has had multiple SSRF-related vulnerabilities. CVE-2026-40175 involved header injection leading to SSRF and RCE through prototype pollution. CVE-2025-62718 exploited a NO_PROXY bypass, allowing SSRF to occur under specific network configurations [99][100]. These highlight the importance of securing dependencies and understanding their network behavior.
Craft CMS GraphQL SSRF Bypass
Craft CMS has seen SSRF vulnerabilities where GraphQL mutations could be manipulated. In one instance, CVE-2026-27127 involved bypassing SSRF protections by leveraging IPv6 resolution, allowing attackers to steal cloud metadata credentials. These exploits often hinge on subtle bypasses of validation logic [79][22].
Detection & Prevention
Effective SSRF defense requires a multi-layered approach, combining application-level validation with network controls and robust security practices.
Application-Level Defenses
- Strict Input Validation (Allowlisting): The most effective defense is to validate all user-supplied URLs against a strict allowlist of permitted domains, IPs, and URL schemes. Blocklisting is generally considered ineffective due to the sheer number of bypass techniques. [20][101][24][26][102][103][104][105][106]
- URL Canonicalization and Normalization: Before validation or use, normalize URLs to a consistent format to prevent bypasses based on encoding or parsing discrepancies.
- Disable Unused URL Schemes: Explicitly disallow potentially dangerous URL schemes (e.g.,
file://,gopher://,dict://) unless absolutely required for specific functionality. [25][27][107][28] - Validate and Pin Connections: Ensure that the IP address resolved from a validated hostname is the same one that the connection is made to. This helps mitigate DNS rebinding attacks. [51][50][22][23][24][29]
- Strict Validation of Redirects: Applications must re-validate any URL following an HTTP redirect. If the initial URL was validated, the redirected URL should also be checked against the allowlist. [12][53][21][50][24]
- Limit HTTP Methods: If a server-side request only needs to be a GET, ensure that other methods (like POST) are not inadvertently allowed when processing user-supplied URLs, especially when targeting cloud metadata services.
- Secure Dependencies: Regularly scan and update third-party libraries (e.g., Axios, request, URL parsers) for known SSRF vulnerabilities. [99][100][108][97]
- Disable XML External Entity Processing: For XML parsers, disable external entity resolution by default. [18][37][67]
- OAST Integration: Integrate Out-of-Band Application Security Testing (OAST) tools into the development and testing pipeline to detect blind SSRF vulnerabilities. [31][32][33][35][36]
Network-Level Defenses
- Egress Filtering: Implement strict firewall rules to control outbound traffic from servers. Only allow connections to known, necessary external IP ranges and ports. This can significantly limit the impact of an SSRF vulnerability. [109][110][111]
- Network Segmentation: Isolate sensitive internal services and metadata endpoints from the general server network.
- Restrict Access to Metadata Services: Configure cloud environments to enforce IMDSv2, which requires a token and HTTP PUT request for credential access, making it harder for basic SSRF exploitation. [112][113][114][46][47]
- DNS Pinning: Prevent rapid DNS record changes to mitigate DNS rebinding attacks. [51]
- WAF and Edge Security: While not a sole defense, Web Application Firewalls (WAFs) and other edge security solutions can help block known malicious patterns and IP addresses. However, attackers often find ways to bypass them. [114][10]
Development and Operational Practices
- Secure Coding Training: Educate developers about common SSRF attack vectors and secure coding practices.
- Static and Dynamic Analysis: Utilize SAST and DAST tools to identify SSRF vulnerabilities during development and testing. [115][116]
- API Security Practices: Implement robust API security, including authentication, authorization, and input validation for all endpoints that handle external data. [111]
- Continuous Monitoring and Alerting: Monitor outbound network traffic for suspicious patterns, such as connections to internal IPs, cloud metadata endpoints, or unusual protocols. [111]
Tooling
A variety of tools are available to aid in the detection, exploitation, and prevention of SSRF vulnerabilities:
- Burp Suite: An indispensable tool for manual testing, intercepting requests, sending payloads to Repeater, and using extensions like Collaborator for blind SSRF detection and IP address manipulation tools. [32][117][33][118][28][36][119][120][121]
- Nuclei: A fast and customizable vulnerability scanner that can be used with community-developed templates to discover SSRF vulnerabilities. [122][123][124]
- SSRFmap: An automated SSRF fuzzer and exploitation tool that can identify and exploit SSRF vulnerabilities, including port scanning, file reading, and reverse shell modules. [125][78][126]
- Gopherus: A tool for generating Gopher protocol links, useful for exploiting SSRF to achieve RCE by interacting with TCP services. [28][40]
- Interactsh/Burp Collaborator: Essential for detecting blind SSRF by providing an OAST server to monitor for external interactions. [31][32][35][36][127][124]
- DNS Rebinding Tools: Utilities like
rbndr.us,whonow,Singularity of Origin, anddrefautomate DNS rebinding attacks for SSRF bypass. [50][28][38] - ipfuscator: A tool for generating alternative IP address representations to bypass filters. [28][38]
- r3dir: A redirection service for bypassing SSRF filters. [54][28]
- Magoo: A Python tool for SSRF hunting and unauthorized port scanning. [128]
- surf: A tool for identifying viable SSRF candidates by sending HTTP requests and analyzing responses. [28][129]
- autoSSRF: A tool for identifying SSRF vulnerabilities with smart fuzzing and context-based dynamic payload generation, using interactsh for detection. [124]
- CNAPPgoat: A vulnerable-by-design deployment tool for experimenting with cloud SSRF scenarios. [130]
- Static Analysis Tools (SAST): Tools like Snyk Code or Semgrep can help identify SSRF-related code patterns. [115][131]
- Microsoft AntiSSRF: An open-source library for .NET and Node.js designed to prevent SSRF. [115][115]
- Drawbridge: A Python library offering drop-in SSRF protection for requests/httpx. [132]
Recent Developments
The SSRF landscape continues to evolve rapidly, with several notable trends emerging:
- Increased Exploitation in AI/LLM Ecosystems: As mentioned, AI agents and LLM applications are becoming significant targets due to their inherent need for external data fetching. Vulnerabilities in platforms like ChatGPT, AutoGPT, LMDeploy, and various RAG implementations have been disclosed and actively exploited [12][68][93][14][15][83][84][85][86][16][87][88][89][90][91].
- Sophisticated Cloud Metadata Abuse: Beyond basic IMDSv1 access, attackers are employing advanced techniques to bypass IMDSv2 protections and other cloud security controls, leading to full cloud account compromise [48][79][112][113][10][11][47].
- HTTP/2 and WebSocket Exploitation: New attack vectors are emerging by exploiting the complexities of HTTP/2 request smuggling and WebSocket Origin header validation, allowing SSRF payloads to bypass traditional security layers [80][133][76][77].
- Supply Chain Vulnerabilities: SSRF vulnerabilities in widely used libraries like Axios and NPM packages have significant downstream impact, affecting numerous applications. [99][100][52][134].
- Focus on Blind SSRF and OAST: The increasing effectiveness of blind SSRF exploitation has led to greater reliance on OAST tools for detection and confirmation.
- SSRF as a Prelude to RCE: The trend of chaining SSRF with other vulnerabilities to achieve Remote Code Execution is becoming more common, especially when targeting services with known RCE flaws or when combining SSRF with file write or deserialization vulnerabilities [94][95][73][74][72][39][40][135].
- Coordinated Exploitation Campaigns: Security researchers and threat intelligence providers have observed coordinated surges in SSRF exploitation by large numbers of IP addresses targeting multiple platforms simultaneously [136][137][138][139].
- SSRF in Infrastructure Appliances and Embedded Devices: SSRF vulnerabilities are not limited to web applications but also affect network infrastructure appliances and embedded devices, providing access to internal management interfaces or sensitive device configurations [94][95][73][140].
Where to Go Deeper
For practitioners seeking to deepen their understanding and practical skills in SSRF, the following resources and areas are recommended:
- OWASP SSRF Prevention Cheat Sheet: A foundational document outlining best practices for SSRF prevention at both application and network levels. [103][104]
- PortSwigger Web Security Academy: Offers excellent introductory and advanced labs on SSRF, covering various exploitation techniques and bypasses. [141][121]
- TryHackMe and Hack The Box: These platforms provide interactive labs and challenges specifically designed for practicing SSRF exploitation in realistic environments. [142][143]
- Bug Bounty Write-ups: Studying detailed write-ups from bug bounty hunters on platforms like Medium, HackerOne, or individual blogs provides invaluable insights into real-world SSRF discovery and exploitation techniques. [74][86][144][145][61][146][135]
- Vendor Security Advisories and CVE Details: Regularly reviewing security advisories from vendors and detailed CVE analyses (e.g., from Rapid7, Tenable, Snyk, and security research blogs) offers up-to-date information on specific SSRF vulnerabilities and their exploitation. [147][96][98][99][100][148][16][149][150][151][87][88][89][90][91][152][134]
- Tool Documentation and GitHub Repositories: Exploring the documentation and source code of SSRF-related tools like SSRFmap, Gopherus, See-SURF, and surf provides practical examples and understanding of their capabilities. [125][28][153][129][124][126]
- Cloud Security Documentation (AWS, GCP, Azure): Understanding how cloud metadata services function and how to secure them is crucial for preventing cloud-focused SSRF attacks. [112][43][130]
- Research Papers and Security Blogs: Following security researchers and blogs that focus on web application security, cloud security, and AI security will keep you abreast of the latest SSRF trends and bypass techniques. [17][53][49][154][21][50][155][24][132][156][157][158][15][7][159][160][161][83][65][85][162][163][52][8][164][165][166][117][167][9][168][25][26][169][27][170][37][11][171][107][102][118][34][172][28][173][104][174][175][57][176][177][29][178][35][145][44][41][60][72][128][45][179][180][181][36][42][123][69][182][183][184][185][186][16][149][187][150][46][188][189][136][190][137][138][139][191][105][192][119][151][193][55][67][78][63][47][106][194][195][196][197][198][199][200][61][201][202][80][133][130][120][203][146][81][153][129][124][204][205][126][206][87][30][207][88][89][90][91][152][134][143][62][208][209][210][211][121][39][38][40][56][212][76][77][135]