Exploiting CORS Misconfiguration Vulnerabilities on Web Servers

Simon Saliba
The Startup
Published in
6 min readFeb 6, 2021

--

In this article, I walk you through a number of CORS misconfiguration vulnerabilities that can be found on servers. I explain what makes some of these misconfigurations exploitable and how to detect them easily. In addition to that, I show you how we can easily write exploits for every one of these vulnerabilities that can get us Private API Keys or sensitive user data. The goal of this article is to make you aware of the dangers of CORS misconfiguration and give you tools to mitigate them.

API Access Restriction

CORS vulnerabilities are amongst the lowest hanging fruits for all security experts and bounty hunters, and counterintuitively amongst the most ignored sets of web vulnerabilities. CORS vulnerabilities come from the misconfiguration of the CORS protocol on web servers.

To understand CORS vulnerabilities, you need to have a basic understanding of what the CORS protocol is. This protocol built on top of HTTP allows server APIs to be accessed from a different origin or domain in a controlled way. For example, when YouTube retrieves your Google account data, it certainly uses CORS since youtube.com is sending requests to google.com (which is another origin). Normally, without CORS, this shouldn’t be allowed due to the Same Origin Policy or SOP that helps prevent cross-site vulnerabilities. To understand the inner workings of…

--

--

Simon Saliba
The Startup

Software Engineer, Entrepreneur and Writer. MSc. @ Mines Paris. Passionate about web development and security. Sometimes try to maintain healthy habits.