<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mikkel Leth on Medium]]></title>
        <description><![CDATA[Stories by Mikkel Leth on Medium]]></description>
        <link>https://medium.com/@mkleth10?source=rss-26117152fa25------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Mikkel Leth on Medium</title>
            <link>https://medium.com/@mkleth10?source=rss-26117152fa25------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 17:57:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mkleth10/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[API and Prejudice]]></title>
            <link>https://research.ifcr.dk/api-and-prejudice-81f7c3b4f5ed?source=rss-26117152fa25------2</link>
            <guid isPermaLink="false">https://medium.com/p/81f7c3b4f5ed</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[api-security]]></category>
            <dc:creator><![CDATA[Mikkel Leth]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 11:18:10 GMT</pubDate>
            <atom:updated>2025-06-20T07:31:42.381Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to the wild world of API vulnerabilities! In this blog post, we’re diving into the OWASP API Top 10<a href="https://owasp.org/API-Security/editions/2023/en/0x00-header/">¹</a> - specifically, the latest update from 2023 that freshened things up from the original 2019 list. And for those wondering, yes, OWASP has a Top 10 for APIs, not just the popular Top 10 for web applications.</p><p>We’re going to zero in on the authorization security risks that come in at 1, 3, and 5 on the list: broken object, function, and object property level authorization. Why these three, you ask? During a recent penetration test of an API-based web application, we stumbled across some interesting examples of these vulnerabilities — think password hashes and privilege escalation!</p><h4>API Vulnerabilities</h4><p>​In recent years, APIs have become prime targets for cyberattacks. Akamai’s research highlights a 49% growth in web attacks against applications and APIs in Q1 of 2024 compared to Q1 in 2023.<a href="https://www.akamai.com/newsroom/press-release/web-attacks-targeting-applications-and-apis-up-by-49-in-the-last-year">²</a> Additionally, a recent study found that 84% of security professionals experienced an API security incident in the last year, which is the third consecutive year of an increase in incidents.<a href="https://www.akamai.com/newsroom/press-release/new-study-finds-84-of-security-professionals-experienced-an-api-security-incident-in-the-past-year">³</a></p><p>These statistics highlight the critical need for robust API security measures. In the following sections, we’ll delve into three common API authorization vulnerabilities: BOLA, BOPLA, and BFLA. Understanding and handling these weaknesses is essential in keeping applications and data secure.</p><p><strong>Broken Object Level Authorization<br></strong>Broken Object Level Authorization or simply “BOLA”, is the number 1 security risk in the OWASP API Top 10. As OWASP describes:</p><blockquote>“Attackers can exploit API endpoints that are vulnerable to broken object-level authorization by manipulating the ID of an object that is sent within the request. Object IDs can be anything from sequential integers, UUIDs, or generic strings.”<a href="https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/">⁴</a></blockquote><p>Let’s break this down with a simple example. Imagine a user, with the ID ‘4’, accessing their profile page. Typically, a GET request like “/profile/4” is sent to the API to fetch that user’s information. But what if the user changes the request to “/profile/5”? If it is not part of the application’s functionality to allow users to view other users’ information, it should recognize that this request is unauthorized. Ideally, the application would then return ‘403 Forbidden’, indicating that the user is trying to access data they shouldn’t have permission to see. For those experienced in the world of web application penetration testing, this sounds strangely familiar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*5DmIg7-aPm8pnY2hUPqRgg.png" /></figure><p><strong>Broken Object Property Level Authorization<br></strong>Following BOLA, the next major authorization security risk in the OWASP API Top 10 is Broken Object Property Level Authorization, or “BOPLA,” which ranks as number 3. According to OWASP:</p><blockquote>“APIs tend to expose endpoints that return all object’s properties. This is particularly valid for REST APIs. For other protocols such as GraphQL, it may require crafted requests to specify which properties should be returned.”<a href="https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/">⁵</a></blockquote><p>BOPLA is a merge of two distinct security risks from the 2019 OWASP Top 10: Excessive Data Exposure and Mass Assignment.</p><p>Let’s revisit the earlier example where a user accesses their profile page by issuing a GET request to “/profile/4”. Suppose the profile page is designed to display only the username, full name, and email address of the user. Ideally, the API response should only include those specific properties of the user object. However, in some cases, the API might return every property of the user object, including sensitive information like a social security number or other details that aren’t needed by the application.</p><p>This security risk often arises because it’s convenient to return the entire object and then use client-side scripts to filter out the necessary information. But, as we’ll explore later, this approach can be dangerous. An attacker can easily intercept the traffic or communicate directly with the API to access the complete object, including sensitive information that should never have been exposed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*rsxNZ9j_nb3ZumhYVfuKHA.png" /></figure><p>Now, let’s consider the concept of Mass Assignment. It’s common for a user to modify certain properties, like their username, full name, or email address. When these changes are made, a POST request is sent to the API with the updated properties in the request body. However, in the case of Mass Assignment, an attacker could add an additional property — such as account-balance — and set its value to an arbitrary number. If the API isn’t properly secured, this could result in financial losses for the platform.</p><p><strong>Broken Function Level Authorization<br></strong>The last authorization security risk part of this blog post is the Broken Function Level Authorization, BFLA. And I promise this is the last part of this boring theory section. OWASP summarizes it clearly:</p><blockquote>“Exploitation requires the attacker to send legitimate API calls to an API endpoint that they should not have access to as anonymous users or regular, non-privileged users. Exposed endpoints will be easily exploited.”<a href="https://owasp.org/API-Security/editions/2023/en/0xa5-broken-function-level-authorization/">⁶</a></blockquote><p>As part of the application, some user administration functionality exists, where changes to the users of the application can be made, like a password reset. However, the user administration functionality is exclusively for administrators of the application.</p><p>But if the application is vulnerable to BFLA, a normal low-privileged user would be able to send a request to something like “/admin/user-administration” and make changes to a user, besides the ones possible in the users own profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*KniLetzTYkQZ4AHU1Fi8Sg.png" /></figure><h4>Warstory</h4><p>But now you might ask yourself — how bad can it really be? Sure, exposing a little too much information, like username or email addresses of other users, might seem like a minor issue. Is that not just a calculated risk? Or such a low-impact vulnerability that fixing it would be a waste of time?</p><p>To demonstrate just how serious these authorization flaws can be, I will walk you through a recent penetration test that perfectly showcased B*LA vulnerabilities — and how they can compound to create a much bigger security risk. The client in question shall remain anonymous, but I have to give them kudos for their quick mitigation efforts and excellent cooperation throughout the test.</p><p>The application in scope was a web application with the primary purpose being an educational platform. Low-privileged users could login, access learning materials, complete courses, see achievements like certifications and skills, follow along in a forum (where higher-privileged users could publish posts), and update their profile details such as email and name. High-privileged users had additional permissions like user management and course creation.</p><p>As a low-privileged user provided by the client, I began exploring the application while intercepting the traffic. With BOLA and IDOR in mind, one particular GET request caught my attention: <br>GET /api/userProfile/468996</p><p>At first glance, nothing seemed out of the ordinary — I was logged in as John Doe, who had the user ID 468996, so retrieving my own profile made sense. But what if I incremented that ID?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nmzY58-daMsIuKxdsifW0w.png" /></figure><p>Success! Instead of my own profile, I got the information of Jane Doe — a textbook case of a BOLA. On its own, this might not seem like a major security risk. After all, it’s just some basic user details. But this is not something you can access by clicking around in the UI. So, since the application wasn’t intentionally exposing this data, I flagged the request as something the client should take a closer look at.</p><p>As I continued exploring the application, I stumbled upon another interesting GET request: <br>GET /api/user_action_plan/468996</p><p>Naturally, I tried the same trick — incrementing the ID. As expected, the application returned Jane Doe’s action plan. But this time, it revealed a little too much.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NljeLgUYrN2CCaZpknhnlg.png" /></figure><p>A password hash! With tools like Burp Intruder and the predictability of user IDs, an attacker could quickly obtain a large number of password hashes and attempt to crack them offline. A great example of both BOLA and BOPLA.</p><p>So, is there more to uncover? To hit the jackpot on API authorization weaknesses, we still need a BFLA. Our hunt begins while browsing the forum, which results in the following request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Tr3KvkuB85Vv-hUsbUPqYQ.png" /></figure><p>Nothing unusual here — it simply returns the content of different posts. However, if we scroll down a bit, the response reveals something more interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_uoFIPEv6ygi-hoYPN88A.png" /></figure><p>In the response, there is a comments object, that includes details about the comment’s author. At first glance, you might argue that exposing the author’s last login timestamp is unnecessary. But it gets even more interesting when we consider one detail: low-privileged users are not supposed to see post comments at all when using the application’s UI. So why would the API return that information? Another example of BOPLA.</p><p>To help pave the way toward a BFLA, the response returns some more useful information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*pw1iGCU86-ZfMi1dkIZbDg.png" /></figure><p>It includes an userTypes object, revealing that the user type ‘Administrator’ has an ID of 8629.</p><p>Now, the question is — where can we modify our own user type ID? When updating profile details, such as last name, the application sends a POST request to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*LeTN_g4eP5F0iaz75ZwFuA.png" /></figure><p>Naturally, I tried replacing lastname with user_type_id and setting it to 8629. Unfortunately, no luck — the request returned an error. But was this the end of the road?</p><p>I’ll admit, the next step is a bit of a cheat, but for this test, I also had access to an administrative user. When testing web applications and APIs, it’s common practice to be provided with both a low-privileged and a high-privileged user account. This allows us to accurately map the application’s intended access controls and understand the differences in functionality between roles. By comparing the API requests and responses of each user type, we can spot inconsistencies, missing permission checks, and overexposed endpoints much more efficiently, thereby removing the art of guessing.</p><p>The admin account, in this case, had access to user management, where roles and permissions could be modified. When changing a user’s role, the application sent a POST request to: <br>POST /api2/v2/users/profile</p><p>The same as before, but with another property. The request included two properties: user_ids and permission_type_ids.</p><p>Aha! That meant the next step was clear: as the low-privileged user, I tried to send the following POST request to the same endpoint:</p><pre>{<br> “user_ids”: [<br>  468996<br> ],<br> “permission_type_ids”:[<br>  8629<br> ]<br>}</pre><p>Here, 468996 is the user ID of John Doe (the test account), and 8629 is the administrator role ID we discovered earlier. The response? Success! The privilege escalation worked — I had just upgraded my own account without the necessary permissions. A true BFLA in action!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*pQQCZ6Qp3xmH9HUTtESc8Q.png" /></figure><p>Unfortunately I can’t reveal too much from the actual website to confirm the privilege escalation, but after logging out and back in, the previously low-privileged user had full access to all administrative functionalities.</p><p>This perfectly illustrates how seemingly small API vulnerabilities can add up to more serious security risks.</p><h4>Conclusion</h4><p>While the vulnerabilities we explored in this blog post might seem like small, low-impact issues on the surface, they can quickly combine into much bigger risks if not addressed. By addressing BOLA, BOPLA, and BFLA vulnerabilities, you significantly improve your API’s security posture and protect sensitive user data from attackers. Never rely on client-side filtering to restrict access — if the API returns sensitive data, attackers can find it. Instead, enforce access controls server-side where they belong. And remember, always follow the principle of least privilege: your API should return only the strictly necessary data for the requested operation — nothing more.</p><p>So, whether you’re a developer, security expert, or just someone interested in how these vulnerabilities work, always keep in mind that a proactive approach is key.</p><p>Stay secure!</p><h4>References</h4><p>[1] — <a href="https://owasp.org/API-Security/editions/2023/en/0x00-header/">https://owasp.org/API-Security/editions/2023/en/0x00-header/</a><br>[2] — <a href="https://www.akamai.com/newsroom/press-release/web-attacks-targeting-applications-and-apis-up-by-49-in-the-last-year">https://www.akamai.com/newsroom/press-release/web-attacks-targeting-applications-and-apis-up-by-49-in-the-last-year</a><br>[3] — <a href="https://www.akamai.com/newsroom/press-release/new-study-finds-84-of-security-professionals-experienced-an-api-security-incident-in-the-past-year">https://www.akamai.com/newsroom/press-release/new-study-finds-84-of-security-professionals-experienced-an-api-security-incident-in-the-past-year</a><br>[4] — <a href="https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/">https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/</a><br>[5] — <a href="https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/">https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/</a><br>[6] — <a href="https://owasp.org/API-Security/editions/2023/en/0xa5-broken-function-level-authorization/">https://owasp.org/API-Security/editions/2023/en/0xa5-broken-function-level-authorization/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81f7c3b4f5ed" width="1" height="1" alt=""><hr><p><a href="https://research.ifcr.dk/api-and-prejudice-81f7c3b4f5ed">API and Prejudice</a> was originally published in <a href="https://research.ifcr.dk/">IFCR</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>