So today we'll be talking about examining access control vulnerabilities in GraphQL and REST API as well and this will be a case, a field case study on data exposure. So we'll be talking about this dating app called Fieldy and how the access controls in the REST API and GraphQL API impacted this app. So who am I? Senior Pentester at 4Bridge, accreditation in Pentesting, DevSecOps and GCP security and I've been working in the past in the banking and gambling industry especially. I have more than ten years of experience in security, especially Pentesting. So what is this talk about? This talk is about the importance of access controls. And according to us, top ten API, it is on the first place known as BOLA category, broken object level authorization. And for web apps, it is also on first place known as broken access controls category in 2021. So as we can see for API and web apps, it is on the first place, the access controls issue. Okay. Let's see what is Fieldy? Our target for research for the security of the API regarding access controls. So this dating app Fieldy launched in 2014 under the name of Trendr. As the name implies, Trendr, it was focused solely on threesomes. In 2016 because of a naming conflict, Tinder Trendr, they changed their name to Fieldy and they became more open to the idea of dating. So Fieldy is a dating app just like Tinder, Bumble and others where you can filter by distance, by age, by gender. There are more than ten genders, couples and by location. If you buy premium membership and you are a premium user, you can also search by the type of kink you are interested in, three ways, group scenarios or the type of relationship you are interested in. On Android, it has more than one million downloads. So this is about Fieldy. Now let's see how this mobile app looks like. So we have four menus, four main menus. The first one, discover profile menus where you get the name of the photos, the name, how far that person is and where he's active, a short bio and what the person is interested in. The second menu, who liked your menu, this is the view as a basic user. All you can see is the name and the blurred photos. The third menu, messages, where you chat with the people you matched with. And the fourth menu, my profile, where you upload your photos, edit your biography and you can buy some premium membership. So this is how the Fieldy app looks like. Now let's see what we will be talking about today regarding API security. So I discovered eight vulnerabilities in this dating app, all of them related to access control issues. We will be taking them one by one and discuss each of them. The first one is part of the broken object property level authorization and the other seven are part of the BOLA category. What's the difference between these two? The BOLA category refers to unauthorized access to a whole user, to a whole object, whereas the BOLA category refers to unauthorized access to a specific property within the whole allowed object. Okay. Let's take them one by one and see how to reproduce them and what's the impact for all these API issues. First one, disclosure of profile information to non-premium users. So as I said, we go to the who liked you menu, we see as a basic user we only see the name. Everything else is blurred. So as a basic user we don't see anything. However, if we use a proxy tool such as burp, we intercept this request and we check the response, we will see a GraphQL request with the operation name likes query and in the response we will see details about these people that liked us. In this case we see imaginary name Sam. Interaction status, they liked us. We didn't like Sam yet. The status is active. So Sam is active. It's not a majestic meaning premium user. And we see a photo section. So if we copy the first photo of this user Sam and we paste it in the browser, we will get this photo of user Sam which belongs to this first photo blurred from user Sam. So as a basic user without paying for premium subscription, we managed to get more information than probably a premium user could get. Okay. So this was first vulnerability, disclosure of profile information to non-premium user. Another interesting field here for us that we can get is stream user ID which is unique to every user. So this is for user Sam and we will use this stream user ID value in order to build upon the next vulnerability. So vulnerability number two, read other people's messages. In order to do this, we will need the stream user ID from the previous vulnerability. To reproduce this issue, we go to the discover profiles menu. We intercept the GraphQL request which will be with operation name discover profiles and we will copy a random stream user ID, in this case ending with B4F which belongs to user Claw, this stream user ID. So now to read the messages of user Claw, we go in the app to the messages menu. We intercept the request to the end point slash channels and from this request we only leave the parameter members in and the stream user ID of our victim user called Claw and in the response we will find the messages of user Claw. If we search by text, we will see the first message saying hi, Claw. And in total, if we search by text, there will be 92 matches sent and received by our victim user Claw. Okay. Now that we can read the messages of specific users, when we read the messages, we will discover in those messages that there are attachments. You can send in the app multiple attachments such as photos and videos and the photos can be replayable or time limited and the videos can be replayable or time limited, play once only. So we have four types of attachments. Let's take them one by one and see how we can reproduce this issue. So to give you the high level overview, first the photo gets for replayable photos. The photo first gets uploaded on a third party domain. Then will be made available from two different end points for the sender and for the receiver to slash photo ID. In order to exploit it, we go in the opposite way from the bottom and we copy this, we leak this photo ID, we build these two URLs for a sender or receiver and because the back end doesn't even check the sender grid or the receiver grid, in this case we can just use an X or any letter and the back end will just validate for the photo ID and return the photo. And then we will have as an attacker to leak this URL. So this is the high level overview from the bottom to the top from the attacker's perspective. And it's the same, the high level overview for the time limited photos. First a valid user uploads it on a third party and then it will be made available to two different end points, sender grid and receiver grid. And after ten seconds this end point will be deleted and we will have to abuse and create this URL and then as an attacker we will have to leak this URL in order to get it unauthenticated. So now let's reproduce the issue and see exactly how we managed to exploit this. So uploading replayable photos. First request, let's do this as a valid user. There will be a GraphQL request with operation name called Cloudinary Generate Upload Credentials. It will generate some credentials for us, which will be used in a subsequent request where we upload the photo with those credentials. And then in a third request, I believe this request will make our photo available to the other two end points. And then it will paste the photo ID in the chat. So let's do this as an attacker. We log in as an attacker. We use the stream user ID of our victim to read their messages and we see in the attachment section the photo ID that we want to leak from our victim. And we see that it is of type image and it is replayable. So in order to leak this photo ending in FF4, we will have to build the URL, FF4, and I said they do not even check who sent it or who receives it. So an X could work. And then it will just return the photo without checking properly the end point if it's the sender or the receiver. However, we will need to be authenticated. So now that we got the photo as an attacker authenticated, let's see how we leak the unauthenticated URL. As part of the functionality of the application, there is an end point with V1 in front of it to this photo ID which actually leaks us the URL to the third party domain where we can access the photo unauthenticated. And this is what we did. And we have access to a photo unauthenticated on the third party domain from my desk office. So that was just abusing their functionality. Okay. Type 2, uploading type limited photos. So there are two main differences from the previous process. First we send an extra parameter saying visibility milliseconds, 15,000 milliseconds meaning 15 seconds. And then in order to leak the photo in order of the previous X, we will need the sender's profile grid to build the URL and leak the photo. Okay. Let's reproduce again the issue. We upload the photo. We pass the extra parameter, visibility milliseconds, 15,000. Now we read the chat as the attacker and we see an attachment section saying photo ID ending in E49, playable duration 15 seconds and replay mode view once only. So we copy this E49 photo ID. And if we paste it and build the URL with let's say the receiver photo ID, because the receiver already saw the photo, it will say attachment has expired. So here we will have to use the sender's profile ID. So in order to leak the photo, we will need the sender's profile ID and this will always return the photo to authenticated users. Then afterwards in order to leak it unauthenticated, we just prepend V1 in front of the URL and this will leak our E49 photo from the third party domain, in this case cloudinary.com. And this is the photo unauthenticated. Okay. This was for the photos. Let's see what's the process for videos. For videos it's simpler. We just upload the video and we will get the URL from a third party domain. The URL will contain base line U0026, so we will have to change that for the ampersand sign. And this URL will be sent in the chat, of course. Then the attacker, we read the messages of our victim. As seen here for using our victim stream user ID. We see the attachment section saying that the attachment is of type video, the URL of the video where we have to copy it and exchange a backslash U0026 for the ampersand sign and that the video is replayable. So we copy this URL, put the ampersand sign where it's needed, and we will get a video unauthenticated from my desk office. So this was for videos replayable. And for videos once only, it will be similar, just that there is an extra parameter saying replay mode view once, duration zero, as seen in the response. We read it, read our victim's messages as the attacker. We do the we exchange the swap the U0026 for the ampersand sign and again we get access unauthenticated to the videos that delete themselves. Okay. This is before and after the receiver sees the video once. So this is when you get a video. It says tap to view. And after you see the video, it will say video expired. However, all the videos are public online unauthenticated. Okay. Just to do a short recap what happened. So in 2014, the app launched under the name of Trendr. In 2024, at the end of the year, we published this. And this specific vulnerability shows that all photos and videos were available online without authentication. And on Android Play Store, the app has more than 1 million downloads. Now all the issues are fixed. Okay. Let's continue. Vulnerability number four, delete, recover and edit other people's messages. So we discovered that we can recover other people's messages that were deleted in a chat. In addition, not only you can delete them, but you can edit and recover or delete them. Let's reproduce the issue. So the end point will be slash messages slash message ID. The methods will be delete and put. Okay. Let's reproduce the issue, leave a message to someone such as got any plans for tomorrow? And we will see the message ID will be ending in 880. We go to the end point. We delete the message. So delete method on this message ID, 880. And it will show 880 got any plans for tomorrow, meaning that it worked. So now if an attacker, we want to read the messages, this message of our victim, we put the stream user ID of our victim and it will say that the message ID, 880, this message was deleted. So as expected, the app so far is working okay. But now if we as an attacker, we apply the same method, delete, on this exact same message ID, 880, we got back the original message, got any plans for tomorrow, just by deleting it one more time. Okay. Now let's try to edit someone else's message. We send the message. My phone number is 123. And it will say my phone number is 123 for the message ID, 72. We read the messages of our victim. We see this message ID, 72. The victim will receive a notification from user D, my phone number is 123. However, if as an attacker, we apply the put method on this message ID, 72, saying my new phone number is 456, so completely something else, then this will be reflected in the response. And now when the victim clicks on the previous notification, it will see the new message. My new phone number is 456, saying below edited. However, the victim cannot know who edited that message, if it was the original sender or someone else. So it has no knowledge regarding that. Might have been the original sender. Okay, vulnerability number 5, update someone else's profile information. So you can update someone else's profile information including name, sexuality, age, et cetera. The end point is slash GraphQL with operation name profile update. Let's try this. Let's try to update our own profile first. So we are logged in as profile ID 91F, as shown in this header. We update our own biography saying ABCD and then in our ID field, we change, we swap our profile ID with that of a random user, 29C. And we will see in the response saying 200 okay, profile ID 29C, biography has been updated to ABCD. So that worked without an issue showing another access control missing. Now another interesting vulnerability is get the like from any profile. So as details, you could send likes from profile number 2 to profile number 3 while being logged in as profile number 1. The vulnerable end point is slash GraphQL with operation name profile like. So let's reproduce the issue. We are logged in as profile 29C and we send a normal like from user ourself 29C to user our test account 91F. And it will say sent. As expected, it worked okay. However, if we swap to send a like from user 91F to ourselves, it will say you cannot like a profile you own. So let's try to send from a random user to another random user to see if it works. And this is what we did. We are logged in as 29C and we send a like from 63 to 91F and it will say stay to send. So that worked to control the like. And now let's investigate who is this user 63. We make a GraphQL request with the operation name profile query to query this user 63 to see who just liked us. And what we see is imagine name Annie, gender woman, age 26. And if we check our mobile app and we go to who liked us, we will see Annie and I blurred Annie's face. Because I have a premium subscription, I can see who liked me. So this issue shows another access control missing. Vulnerability number 7, send messages in other people's chats. Vulnerable end point slash channel slash messaging slash channel ID slash message. We read our victim's messages and we find the channel ID ending in 0BD. We send a message to this end point to this channel ID 0BD. Hello from the attacker. And the victim will receive a notification from user B, which is the attacker. And in this chat is between user D and Bogdan. And the notification comes from a third party user B. However, because in the app it allows you to change your name, these are not unique so you can even impersonate one of the counterparts in the chat. So it worked to send a message in other people's chat. And the last issue, view other people's messages, end point slash GraphQL, operation name chat list query. We can query our own matches. And if we search by imaginary name, we see that we have a total of three matches on our own account. However, if we swap the profile ID with that of a random user, let's say 91F, and we search by imaginary name, we see that this account has 45 matches. So this is another access control issue that is an access control that is missing. Remediation for developers. Implement authorization checks between users. This must be on the backend and not frontend. Implement user levels. And based on these user levels, implement access controls between them. For DevSecOps people, integrate CICD tools in the pipeline. However, for this specific category of issues, it is very difficult to validate which profile ID is valid, which one is not, and is being abused. So this is very challenging to find such sort of issues. For CISOs, do data mapping, identify personal data that your organization collects, including where it's located, and introduce measures to protect this data. For example, Uber was fined for GDPR violation for sending driver's license from EU to US, and TikTok was fined as well for GDPR issues, breaches, for sending European user data to China. Regarding remediation, we informed the field regarding these issues, and after six months, all the issues have been patched. And immediately afterwards, the blog was published. The research is fully available on our blog post. There has been a Guardian article on this issue as well. And the slides will be published on our GitHub. Now a short video in case... okay, it's not available anymore. And Q&A, if you have any in case there is any. If not, I will... one minute maximum. Yes, please. I cannot hear you, sorry. That is a very good question, and it is very challenging to do that. Because, for example, let's take this issue, the other people's matches. Here is a request to check my own matches, which returns a response. Then I swap this profile ID, and for a different profile ID, and it returns someone else's matches. How do you identify in this response what's different from the other response? Because it returns matches. So it's... you need someone's intuition to realize that you should not have access to someone else's response. So at the moment, I'm not aware of such a tool that can make such a comparison. In case anyone knows, please let me know. I'd be curious to find out.