Where URLs Become Weapons: Automated Discovery of SSRF Vulnerabilities in Web Applications
Enze Wang, Jianjun Chen, Wei Xie, Chuhan Wang, Yifei Gao, Zhenhua Wang
IEEE Symposium on Security and Privacy 2024 · Day 1 · Continental Ballroom 4
Overview
This presentation, "Where URLs Become Weapons: Automated Discovery of SSRF Vulnerabilities in Web Applications," delivered by Enze Wang from the National University of Defense Technology and collaborators, unveils a novel framework designed to systematically identify Server-Side Request Forgery (SSRF) vulnerabilities. SSRF is a critical web security flaw, consistently listed among the OWASP Top 10, that allows attackers to coerce a server into making arbitrary requests to internal network resources or other external services on the attacker's behalf. Despite its severe implications, the discovery of new SSRF vulnerabilities has historically relied on manual, inefficient, and incomplete testing methods, leaving a significant attack surface exposed.

Key moments
- 0:00 Introduction to SSRF vulnerabilities and problem statement
- 2:00 Identifying three main challenges in SSRF vulnerability discovery
- 4:00 Introducing SSRFuzz, a three-stage automated fuzzing framework
- 6:00 Detailed explanation of the dynamic taint inference module
- 8:00 Key insight: sanitizers and string similarity for vulnerability detection
- 9:00 Impressive evaluation results: new sinks, CVEs, and high-risk findings
- 10:00 Performance comparison: SSRFuzz outperforms state-of-the-art tools significantly
Where URLs Become Weapons: Automated Discovery of SSRF Vulnerabilities in Web Applications
Speakers: Enze Wang, Jianjun Chen, Wei Xie, Chuhan Wang, Yifei Gao, Zhenhua Wang
Conference: IEEE S&P
YouTube: https://www.youtube.com/watch?v=fn9XNzqxwA
Overview
This presentation, "Where URLs Become Weapons: Automated Discovery of SSRF Vulnerabilities in Web Applications," delivered by Enze Wang from the National University of Defense Technology and collaborators, unveils a novel framework designed to systematically identify Server-Side Request Forgery (SSRF) vulnerabilities. SSRF is a critical web security flaw, consistently listed among the OWASP Top 10, that allows attackers to coerce a server into making arbitrary requests to internal network resources or other external services on the attacker's behalf. Despite its severe implications, the discovery of new SSRF vulnerabilities has historically relied on manual, inefficient, and incomplete testing methods, leaving a significant attack surface exposed.
The core contribution of this work is SSRfuzz, a three-stage fuzzing framework that combines dynamic taint analysis with mutation-based fuzzing. This innovative approach addresses fundamental challenges in SSRF detection: comprehensively identifying all potential "sinks" (functions capable of making server-side requests), efficiently focusing fuzzing efforts, and generating sophisticated payloads capable of bypassing common sanitization mechanisms. By automating these processes, SSRfuzz significantly enhances the accuracy and efficiency of SSRF vulnerability discovery, revealing a substantial number of previously undetected flaws.
The research not only highlights the pervasive nature and high security threat of SSRF vulnerabilities but also provides a powerful tool to combat them. The findings underscore a critical gap in web application development practices, particularly concerning the understanding and implementation of effective sanitization. The work serves as a crucial call to action for the security community and developers to adopt more robust defensive strategies against this persistent and dangerous class of vulnerabilities.
Background
▶ Watch: Introduction to SSRF vulnerabilities and problem statement (0:00)
Server-Side Request Forgery (SSRF) is a web security vulnerability where an attacker can induce a server-side application to make an HTTP request to an arbitrary domain of the attacker's choosing. In a typical attack scenario, an attacker crafts an HTTP request containing a parameter that points to a sensitive internal resource, such as /etc/passwd, or an internal network service. The vulnerable web server then parses this parameter, initiates a request to the specified internal location, and, if successful, returns the content or response to the attacker. This allows an attacker to bypass firewalls, access internal systems, perform port scanning, or even exfiltrate sensitive data from the local server or internal network.
The pervasive nature of SSRF vulnerabilities stems from the common web application practice of fetching resources from external URLs or internal paths based on user-supplied input. While this functionality can be benign and necessary for many applications (e.g., fetching profile pictures from social media, integrating with third-party APIs), it becomes a severe security risk when input is not adequately validated and sanitized.
Previous studies and tools for detecting SSRF vulnerabilities have faced significant limitations. Existing methods primarily relied on scanning for known SSRF "sinks"—specific functions within a programming language or framework that are capable of making server-side requests. However, the set of known sinks has historically been incomplete. For instance, out of the 2,111 functions available in PHP7, only a fraction possess server-side request capabilities, and identifying all of them without a dedicated oracle is a daunting task. Furthermore, discovering new SSRF vulnerabilities beyond those triggered by known sinks often necessitated laborious and error-prone manual testing, a method that is both inefficient and highly susceptible to human oversight, leading to many vulnerabilities remaining undetected.
The researchers identified three primary challenges that hindered comprehensive and automated SSRF discovery:
- Designing an effective oracle for SSRF sink identification: Without a definitive mechanism to identify all functions capable of performing server-side requests, the scope of vulnerability detection remains limited. The sheer number of functions in modern web development languages (e.g., 2,111 in PHP7) makes manual enumeration impractical.
- Performing targeted fuzzing for SSR functionality: Web applications are complex, featuring numerous functionalities like messaging, avatar uploads, and account management. Fuzzing every input field across all features is computationally expensive and inefficient, unnecessarily expanding the input space. A method was needed to focus fuzzing efforts specifically on paths likely to lead to SSRF.
- Generating effective payloads to trigger SSRF vulnerabilities: A successful SSRF payload must adhere to URL structure rules while simultaneously bypassing potential string filtering or sanitization checks implemented by the target web application. The absence of an automated payload generator capable of crafting such sophisticated, URL-semantic, and bypass-oriented payloads presented a significant hurdle to automating the discovery of novel SSRF flaws.
These challenges collectively highlighted the need for a more systematic, efficient, and automated approach to uncover the full spectrum of SSRF vulnerabilities in modern web applications.
Key Findings
▶ Watch: Introducing SSRFuzz, a three-stage automated fuzzing framework (4:00)
The research presented by Enze Wang et al. introduces SSRfuzz, a groundbreaking three-stage fuzzing framework designed to overcome the limitations of prior SSRF detection methods. The key findings demonstrate SSRfuzz's superior capability in identifying new vulnerabilities, its efficiency, and its ability to bypass sophisticated defense mechanisms.
Firstly, a critical contribution of SSRfuzz is the comprehensive identification of SSRF sinks. By designing a novel SSRF Oracle, the framework successfully identified 86 distinct sink functions out of the 2,111 functions documented in the PHP manual that possess server-side request capabilities. This is a significant expansion of the known attack surface, as SSRfuzz not only identified all previously known SSRF sinks but also discovered an additional 73 new ones. This enhanced understanding of potential SSRF points forms the bedrock for more thorough vulnerability detection.
Leveraging this expanded knowledge of sinks, SSRfuzz proved remarkably effective in real-world scenarios. The tool was deployed against 27 web applications, leading to the discovery of 25 new vulnerabilities. The severity of these findings is underscored by the fact that the researchers successfully obtained 16 CVE numbers for these newly identified flaws. Furthermore, the National Vulnerability Database (NVD) evaluated 13 of these publicly disclosed vulnerabilities using the Common Vulnerability Scoring System (CVSS), rating all of them as either critical or high-risk security issues. This unequivocally highlights the severe potential threat posed by the vulnerabilities uncovered by SSRfuzz.
Beyond its efficacy in finding new vulnerabilities, SSRfuzz also demonstrated exceptional performance in terms of efficiency. Comparative analysis against state-of-the-art tools revealed that SSRfuzz is, on average, 90.3% more efficient than Burp Suite and 70.4% more efficient than SSRFmap. Despite this substantial increase in efficiency, SSRfuzz did not compromise on coverage, instead finding significantly more vulnerabilities. In a controlled test set, SSRfuzz identified 28 vulnerabilities, while both Burp Suite and SSRFmap only found 6 vulnerabilities each. This demonstrates a clear advantage in both speed and depth of discovery.
Finally, a compelling case study involving Wonder CMS showcased SSRfuzz's ability to generate novel payloads and bypass developer-implemented defense mechanisms. Wonder CMS had a defense mechanism designed to verify if a user's URL pointed to github.com by checking for the string https://github.com within the input. SSRfuzz successfully crafted a payload that included these keywords after a hashtag symbol (#) in the URL (e.g., http://1.0.1.0/#https://github.com), effectively bypassing the developer's check and scanning the internal server 1.0.1.0. This finding not only exposed a clear gap in developers' understanding of SSRF bypass techniques but also validated SSRfuzz's sophisticated payload generation capabilities. These key findings collectively establish SSRfuzz as a powerful, efficient, and highly effective tool for automated SSRF vulnerability discovery, setting a new benchmark in the field.
Technical Deep Dive
▶ Watch: Detailed explanation of the dynamic taint inference module (6:00)
SSRfuzz operates as a sophisticated three-stage fuzzing framework designed to systematically identify and exploit SSRF vulnerabilities. The framework's core innovation lies in its combination of dynamic taint analysis with mutation-based fuzzing, allowing it to efficiently explore program execution flows related to server-side requests and generate effective bypass payloads.
The three essential modules of SSRfuzz are:
- Sync Identification Phase: This phase focuses on creating a comprehensive list of potential SSRF sinks.
- Inference Phase: Here, dynamic taint analysis is used to identify execution paths where user input might flow into identified sinks.
- Fuzzing Phase: In this final stage, payloads are generated and sent to trigger and verify SSRF vulnerabilities.
Sync Identification Phase
The initial challenge in SSRF detection is knowing where to look. Modern web application frameworks and languages contain thousands of functions, but only a subset are capable of making server-side requests. To address this, SSRfuzz introduced the SSRF Oracle. This oracle was meticulously designed based on the definition of SSRF vulnerabilities and applied to the PHP manual. Through this process, SSRfuzz successfully identified 86 distinct SSRF sink functions out of the 2,111 functions available in PHP7. These sinks represent the critical points in a program where an attacker-controlled URL could lead to an unintended server-side request. The discovery of 73 new sinks, in addition to all previously known ones, highlights the oracle's effectiveness and the significant expansion of the known SSRF attack surface.
Inference Phase: Dynamic Taint Inference Module
Once the SSRF sinks are identified, the dynamic taint inference module takes over. This module has two core functions:
- Hooking Sinks: During the initialization of the web application, all identified SSRF sinks are "hooked." This process is performed only once before the application begins execution, allowing SSRfuzz to monitor calls to these critical functions.
- Tracking Tainted Input: The module tracks user-supplied input by marking it with a taint tag. As the program executes, SSRfuzz monitors the propagation of this taint tag through the application's internal data flow. If the taint tag successfully flows from an input source (e.g., a URL parameter) into one of the hooked SSRF sinks, it indicates a potential SSRF flow. This flow represents an execution path where attacker-controlled data could influence a server-side request.
Consider an example: if a parameter peur (taint source) receives an input value, it's marked with a taint tag. If this value is subsequently passed to a hooked sink like curl_exec, the taint tag follows this execution path, and the dynamic taint inference module records this as an SSRF flow. This targeted approach efficiently narrows down the vast input space, focusing fuzzing efforts only on features and parameters relevant to SSRF.
However, the presence of sanitizers in web applications complicates this. An SSRF flow doesn't automatically guarantee a vulnerability, as sanitizers are designed to filter or modify user input to prevent security issues. They might add, remove, or replace parts of a string. To account for this, SSRfuzz employs a crucial insight: if a sanitizer is ineffective, the string value from the taint source and the value reaching the taint sink will remain very similar or even identical.
To filter out non-vulnerable flows caused by effective sanitization, SSRfuzz implements a two-stage string similarity matching algorithm:
- Stage One: String Matching: A preliminary check for direct string equality or simple substring presence.
- Stage Two: String Similarity Comparison: For flows that pass the first stage, a more robust comparison is performed using the Levenshtein distance. This metric quantifies the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. By comparing the Levenshtein distance between the original tainted input and the string value that eventually reaches the sink, SSRfuzz can effectively eliminate flows where significant modifications by a sanitizer would prevent an SSRF exploit, thereby avoiding unnecessary fuzzing. This balances speed and accuracy, ensuring that only truly promising SSRF flows are passed to the next stage.
Fuzzing Phase
The final stage of SSRfuzz is the fuzzing phase, which consists of two interconnected modules: the payload generator and the vulnerability detector.
The payload generator is responsible for creating sophisticated payloads. It leverages new mutation strategies to generate strings that not only adhere to URL structure rules but are also specifically designed to bypass common sanitization checks. This is crucial because simple sanitizers often look for specific keywords or patterns, which can be circumvented by techniques like URL encoding, using non-standard ports, or embedding keywords in unexpected parts of the URL (e.g., after a fragment identifier like #).
The vulnerability detector then takes these generated payloads and sends them to the identified SSRF flows. It incorporates six distinct detection strategies to accurately verify if an SSRF vulnerability has been triggered. These strategies might include monitoring for specific HTTP response codes, analyzing server-side errors, observing changes in network traffic (e.g., requests to an attacker-controlled server), or detecting specific content returned from internal resources. If a vulnerability is confirmed, SSRfuzz automatically generates a Proof of Concept (POC), providing concrete evidence of the exploit.
By integrating these three phases, SSRfuzz systematically identifies potential SSRF vulnerabilities, intelligently filters out false positives, and generates effective exploits, marking a significant leap forward in automated web security testing.
Demo / Proof of Concept
▶ Watch: Impressive evaluation results: new sinks, CVEs, and high-risk findings (9:00)
The efficacy and sophistication of SSRfuzz were vividly demonstrated through a compelling case study involving Wonder CMS. This particular example highlighted not only the tool's ability to discover novel vulnerabilities but also its capacity to circumvent developer-implemented defense mechanisms that might appear robust on the surface.
In Wonder CMS, the developers had implemented a defense mechanism intended to prevent SSRF attacks by verifying that a user-supplied URL pointed specifically to the GitHub website. Their approach involved checking if the string https://github.com was included within the user input. The rationale behind this check was presumably to ensure that any server-side requests initiated based on user input were restricted to a trusted, external domain, thereby preventing access to internal resources or arbitrary external sites.
However, SSRfuzz proved this defense mechanism to be insufficient. Leveraging its advanced payload generation capabilities, SSRfuzz automatically created a specially crafted payload that bypassed this specific string filter. The payload cleverly included the required keywords (https://github.com) but placed them after the hashtag symbol (#) in the URL. For instance, a payload might look something like http://1.0.1.0/#https://github.com.
The key to this bypass lies in how web servers and browsers typically handle the fragment identifier (the part of a URL starting with #). The fragment identifier is usually processed client-side by the browser and is not sent to the server as part of the HTTP request. Therefore, when the Wonder CMS server received the request, its string matching logic would likely not find https://github.com in the relevant part of the URL that the server-side request function would process, thus failing to trigger the defense. However, the server-side request function, if vulnerable, would still process the initial part of the URL (e.g., http://1.0.1.0/) and make a request to the attacker's intended target, which in this demonstration was an internal server at 1.0.1.0.
The outcome of this demonstration was unequivocal: SSRfuzz successfully exploited the vulnerability, allowing it to scan the internal server 1.0.1.0. This case had two critical implications:
- Developer Understanding Gap: It underscored a clear deficiency in web application developers' understanding of SSRF vulnerabilities and the nuances of URL parsing. Simple string inclusion checks are often inadequate against sophisticated bypass techniques, as attackers can leverage URL components (like the fragment identifier) or various encoding methods to circumvent such filters.
- SSRfuzz's Payload Generation Prowess: It showcased SSRfuzz's exceptional ability to generate novel and effective payloads that exploit these subtle misunderstandings and bypass seemingly robust defense mechanisms. This highlights the tool's capacity to go beyond known attack patterns and uncover more sophisticated, previously undetected SSRF flaws.
This proof-of-concept serves as a powerful testament to SSRfuzz's capabilities and reinforces the necessity of adopting more comprehensive and context-aware URL validation and sanitization strategies.
Defensive Implications
▶ Watch: Performance comparison: SSRFuzz outperforms state-of-the-art tools significantly (10:00)
The findings presented by Enze Wang et al. and the capabilities of SSRfuzz carry significant defensive implications for web application developers, security architects, and penetration testers. The pervasive nature of SSRF and the demonstrated ease with which even seemingly robust defenses can be bypassed necessitate a re-evaluation of current security practices.
Firstly, the most crucial implication is the urgent need for improved developer education and awareness regarding SSRF vulnerabilities. The Wonder CMS case study clearly illustrated a gap in understanding how URL parsing works and how simple string-based sanitization can be trivially bypassed. Developers must be educated on the full spectrum of SSRF attack vectors, including various encoding schemes, non-standard ports, DNS rebinding, and the often-misunderstood role of URL components like the fragment identifier (#).
Secondly, applications should implement robust and comprehensive URL parsing and validation. Relying on simple string checks (e.g., if "github.com" in url) is insufficient. Instead, validation should involve:
- Whitelisting: The strongest defense is to maintain a strict whitelist of allowed domains, IP addresses, and URL schemes that the server is permitted to interact with. Any request to a URL not on this whitelist should be blocked.
- Protocol Validation: Explicitly permit only necessary protocols (e.g.,
http,https) and disallow dangerous ones likefile://,gopher://,dict://, orftp://unless absolutely required. - Host and Port Validation: After parsing the URL, strictly validate the resolved host. Check if the resolved IP address falls within internal, private, or loopback IP ranges (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.1). Disallow requests to these ranges. Similarly, restrict requests to non-standard or sensitive ports.
- URL Canonicalization: Before any validation, ensure the URL is canonicalized to prevent bypasses through various encoding or obfuscation techniques. This means resolving redirects and normalizing the URL format.
Thirdly, avoid directly using user-supplied URLs in server-side requests whenever possible. If fetching external resources is essential, consider alternative architectures that do not expose the server's internal network to untrusted input. For instance, delegate fetching to a dedicated, isolated service with extremely strict egress filtering.
Fourthly, implement network segmentation and egress filtering. Servers that make external requests should be placed in a demilitarized zone (DMZ) with tightly controlled outbound firewall rules. Only allow traffic to specific, whitelisted external IP addresses and ports. This limits the blast radius of a successful SSRF attack, preventing it from reaching internal critical systems.
Fifthly, regularly scan applications with advanced SSRF detection tools like SSRfuzz. The fact that SSRfuzz identified 73 new sinks and numerous high-risk vulnerabilities underscores that many existing applications likely harbor undetected SSRF flaws. Integrating such automated tools into the CI/CD pipeline and conducting periodic security assessments is crucial for proactive defense.
Finally, while not explicitly mentioned, logging and monitoring of outbound server-side requests can help detect anomalous behavior that might indicate an SSRF attack in progress. Alerts should be triggered for requests to unusual domains, IP addresses, or internal network ranges.
By adopting these comprehensive defensive measures, organizations can significantly reduce their exposure to SSRF vulnerabilities and mitigate the severe risks they pose.
Key Takeaways
- SSRF Remains a Critical and Underestimated Threat: Server-Side Request Forgery is consistently ranked among the top web threats, yet developers often lack a comprehensive understanding of its nuances and effective mitigation strategies, leading to easily bypassable defenses.
- Existing Detection Methods are Incomplete and Inefficient: Traditional SSRF scanning tools and manual testing methods are limited by an incomplete knowledge of potential "sinks" (functions capable of making server-side requests) and struggle with the vast input space, leaving many vulnerabilities undiscovered.
- SSRfuzz Revolutionizes SSRF Discovery: The SSRfuzz framework systematically identifies new SSRF sinks and vulnerabilities by combining dynamic taint analysis with mutation-based fuzzing, addressing the core challenges of sink identification, targeted fuzzing, and payload generation.
- Superior Performance and Efficacy: SSRfuzz significantly outperforms state-of-the-art tools, being 90.3% more efficient than Burp Suite and 70.4% more efficient than SSRFmap, while simultaneously discovering a much higher number of critical and high-risk vulnerabilities (28 vs. 6 in comparative tests).
- Simple Sanitization is Insufficient: The Wonder CMS case clearly demonstrates that basic string-based input filtering is inadequate against sophisticated SSRF payloads that leverage URL components like the fragment identifier (
#) or various encoding techniques. - Comprehensive URL Validation is Imperative: Developers must adopt robust URL parsing, validation, and sanitization practices, including strict whitelisting of allowed domains/protocols, validation of resolved IP addresses against internal ranges, and thorough understanding of how different URL components are handled by servers.
About the Speaker(s)
The primary presenter for this work was Enze Wang, affiliated with the National University of Defense Technology University. The research itself was a collaborative effort involving experts from the National University of Defense Technology, Tsinghua University, ZGC Lab, and Nanyang Technological University. The transcript does not provide specific titles or additional biographical details for Enze Wang or the other named collaborators (Jianjun Chen, Wei Xie, Chuhan Wang, Yifei Gao, and Zhenhua Wang), beyond their institutional affiliations. Their work, as presented, clearly demonstrates expertise in web security, vulnerability research, and automated analysis techniques.
Reviews
Dr. Zero (Offensive Security Researcher) — MUST SEE
This work introduces SSRfuzz, a critical advancement in automated SSRF vulnerability discovery. Its novel three-stage framework, leveraging an SSRF Oracle and dynamic taint analysis with Levenshtein distance filtering, identified 73 new PHP sinks and 25 new vulnerabilities, earning 16 CVEs. This research significantly outperforms existing tools, offering a powerful, efficient, and much-needed solution to a persistent and dangerous class of web security flaws.
Heather Calloway (CISO) — STRONG ACCEPT
This research on SSRfuzz effectively exposes the pervasive and critical nature of SSRF vulnerabilities, demonstrating a significant gap in both current detection methods and developer understanding of robust sanitization. The tool's ability to uncover numerous high-risk flaws and bypass common defenses necessitates a fundamental shift in application security programs, focusing on developer education and comprehensive URL validation.
→ Top-rated talks at IEEE Symposium on Security and Privacy 2024