SSRF vs. Developers: A Study of SSRF-Defenses in PHP Applications

Authors: 

Malte Wessels and Simon Koch, Technische Universität Braunschweig; Giancarlo Pellegrino, CISPA Helmholtz Center for Information Security; Martin Johns, Technische Universität Braunschweig

Abstract: 

Server-side requests (SSR) are a potent and important tool for modern web applications, as they enable features such as link preview and web hooks. Unfortunately, naive usage of SSR opens the underlying application up to Server-Side Request Forgery – an underappreciated vulnerability risk. To shed light on this vulnerability class, we conduct an in-depth analysis of known exploitation methods as well as defenses and mitigations across PHP. We then proceed to study the prevalence of the vulnerability and defenses across 27,078 open-source PHP applications. For this we perform an initial data flow analysis, identifying attacker-controlled inputs into known SSR functions, followed up by a manual analysis of our results to gain a detailed understanding of the involved vulnerabilities and present defenses. Our results show that defenses are sparse. The hypermajority of our 237 detected data flows are vulnerable. Only two analyzed applications implement safe SSR features.

Since known defenses are not used and detected attacker-controlled flows are almost always vulnerable, we can only conclude that developers are still unaware of SSR abuses and the need to defend against them. Consequently, SSRF is a present and underappreciated danger in modern web applications.

Open Access Media

USENIX is committed to Open Access to the research presented at our events. Papers and proceedings are freely available to everyone once the event begins. Any video, audio, and/or slides that are posted after the event are also free and open to everyone. Support USENIX and our commitment to Open Access.

BibTeX
@inproceedings {299559,
author = {Malte Wessels and Simon Koch and Giancarlo Pellegrino and Martin Johns},
title = {{SSRF} vs. Developers: A Study of {SSRF-Defenses} in {PHP} Applications},
booktitle = {33rd USENIX Security Symposium (USENIX Security 24)},
year = {2024},
isbn = {978-1-939133-44-1},
address = {Philadelphia, PA},
pages = {6777--6794},
url = {https://www.usenix.org/conference/usenixsecurity24/presentation/wessels},
publisher = {USENIX Association},
month = aug
}

Presentation Video