start	end	text
0	9880	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.
9880	21200	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.
21680	23120	So who am I?
23220	35600	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.
35600	39400	I have more than ten years of experience in security, especially Pentesting.
39600	41680	So what is this talk about?
41700	45200	This talk is about the importance of access controls.
45820	55900	And according to us, top ten API, it is on the first place known as BOLA category, broken object level authorization.
55960	64920	And for web apps, it is also on first place known as broken access controls category in 2021.
65300	72680	So as we can see for API and web apps, it is on the first place, the access controls issue.
72680	73080	Okay.
73080	75000	Let's see what is Fieldy?
75000	82080	Our target for research for the security of the API regarding access controls.
82080	87280	So this dating app Fieldy launched in 2014 under the name of Trendr.
87280	93840	As the name implies, Trendr, it was focused solely on threesomes.
94300	103280	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.
103280	111120	So Fieldy is a dating app just like Tinder, Bumble and others where you can filter by distance, by age, by gender.
111120	115220	There are more than ten genders, couples and by location.
115480	125440	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.
125480	128680	On Android, it has more than one million downloads.
129040	130640	So this is about Fieldy.
130640	133200	Now let's see how this mobile app looks like.
133360	135500	So we have four menus, four main menus.
135500	149320	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.
149560	154360	The second menu, who liked your menu, this is the view as a basic user.
154360	157300	All you can see is the name and the blurred photos.
158080	164060	The third menu, messages, where you chat with the people you matched with.
164060	173520	And the fourth menu, my profile, where you upload your photos, edit your biography and you can buy some premium membership.
173520	176260	So this is how the Fieldy app looks like.
176680	180900	Now let's see what we will be talking about today regarding API security.
180920	189820	So I discovered eight vulnerabilities in this dating app, all of them related to access control issues.
189820	194380	We will be taking them one by one and discuss each of them.
194380	202740	The first one is part of the broken object property level authorization and the other seven are part of the BOLA category.
203120	205120	What's the difference between these two?
206420	225060	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.
225420	225800	Okay.
225800	232540	Let's take them one by one and see how to reproduce them and what's the impact for all these API issues.
232540	237300	First one, disclosure of profile information to non-premium users.
237300	243800	So as I said, we go to the who liked you menu, we see as a basic user we only see the name.
243880	245660	Everything else is blurred.
246040	248280	So as a basic user we don't see anything.
248280	271280	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.
271280	274720	In this case we see imaginary name Sam.
275120	277300	Interaction status, they liked us.
277300	279060	We didn't like Sam yet.
279060	280800	The status is active.
280800	282980	So Sam is active.
282980	287340	It's not a majestic meaning premium user.
287720	290200	And we see a photo section.
290360	305000	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.
305000	314320	So as a basic user without paying for premium subscription, we managed to get more information than probably a premium user could get.
315000	315300	Okay.
315300	322740	So this was first vulnerability, disclosure of profile information to non-premium user.
322740	330540	Another interesting field here for us that we can get is stream user ID which is unique to every user.
330840	338800	So this is for user Sam and we will use this stream user ID value in order to build upon the next vulnerability.
339420	343020	So vulnerability number two, read other people's messages.
343260	347820	In order to do this, we will need the stream user ID from the previous vulnerability.
349760	354300	To reproduce this issue, we go to the discover profiles menu.
354300	373280	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.
373280	381920	So now to read the messages of user Claw, we go in the app to the messages menu.
381920	399680	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.
399680	403860	If we search by text, we will see the first message saying hi, Claw.
404420	413960	And in total, if we search by text, there will be 92 matches sent and received by our victim user Claw.
414520	415380	Okay.
415380	426380	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.
426640	440260	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.
440300	442260	So we have four types of attachments.
442260	445760	Let's take them one by one and see how we can reproduce this issue.
446220	453060	So to give you the high level overview, first the photo gets for replayable photos.
453160	457960	The photo first gets uploaded on a third party domain.
457960	467160	Then will be made available from two different end points for the sender and for the receiver to slash photo ID.
469040	494740	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.
495160	498900	And then we will have as an attacker to leak this URL.
499160	505660	So this is the high level overview from the bottom to the top from the attacker's perspective.
505660	510680	And it's the same, the high level overview for the time limited photos.
510980	521380	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.
521460	533900	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.
533900	538260	So now let's reproduce the issue and see exactly how we managed to exploit this.
539400	542520	So uploading replayable photos.
543180	546080	First request, let's do this as a valid user.
546080	555360	There will be a GraphQL request with operation name called Cloudinary Generate Upload Credentials.
555500	567500	It will generate some credentials for us, which will be used in a subsequent request where we upload the photo with those credentials.
568640	581080	And then in a third request, I believe this request will make our photo available to the other two end points.
581960	587060	And then it will paste the photo ID in the chat.
588180	592400	So let's do this as an attacker.
592540	594200	We log in as an attacker.
594200	608320	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.
608320	611960	And we see that it is of type image and it is replayable.
611980	625780	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.
625780	627560	So an X could work.
627580	636720	And then it will just return the photo without checking properly the end point if it's the sender or the receiver.
636800	638780	However, we will need to be authenticated.
638780	645280	So now that we got the photo as an attacker authenticated, let's see how we leak the unauthenticated URL.
646240	662640	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.
662640	664300	And this is what we did.
664300	672440	And we have access to a photo unauthenticated on the third party domain from my desk office.
673980	676680	So that was just abusing their functionality.
677460	678280	Okay.
678280	682280	Type 2, uploading type limited photos.
682280	686280	So there are two main differences from the previous process.
686320	693960	First we send an extra parameter saying visibility milliseconds, 15,000 milliseconds meaning 15 seconds.
694000	705600	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.
705800	706340	Okay.
706340	707980	Let's reproduce again the issue.
707980	709880	We upload the photo.
712000	717020	We pass the extra parameter, visibility milliseconds, 15,000.
718260	732360	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.
732360	735460	So we copy this E49 photo ID.
736600	749720	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.
749720	757900	So here we will have to use the sender's profile ID.
758000	767980	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.
769300	788660	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.
788920	792020	And this is the photo unauthenticated.
793320	794020	Okay.
794020	795260	This was for the photos.
795260	796920	Let's see what's the process for videos.
796920	799160	For videos it's simpler.
799980	806420	We just upload the video and we will get the URL from a third party domain.
807800	815000	The URL will contain base line U0026, so we will have to change that for the ampersand sign.
816360	819860	And this URL will be sent in the chat, of course.
820690	826160	Then the attacker, we read the messages of our victim.
826860	832100	As seen here for using our victim stream user ID.
832100	846420	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.
846420	857680	So we copy this URL, put the ampersand sign where it's needed, and we will get a video unauthenticated from my desk office.
857680	862280	So this was for videos replayable.
862280	875360	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.
875720	879440	We read it, read our victim's messages as the attacker.
879840	891780	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.
892880	893920	Okay.
894880	899940	This is before and after the receiver sees the video once.
899940	903780	So this is when you get a video.
903780	905060	It says tap to view.
905060	908240	And after you see the video, it will say video expired.
908240	912160	However, all the videos are public online unauthenticated.
913380	913960	Okay.
913960	916460	Just to do a short recap what happened.
916520	920480	So in 2014, the app launched under the name of Trendr.
920480	924580	In 2024, at the end of the year, we published this.
924580	932260	And this specific vulnerability shows that all photos and videos were available online without authentication.
932480	937220	And on Android Play Store, the app has more than 1 million downloads.
937220	939360	Now all the issues are fixed.
939360	939840	Okay.
939840	941680	Let's continue.
942300	946060	Vulnerability number four, delete, recover and edit other people's messages.
946060	951760	So we discovered that we can recover other people's messages that were deleted in a chat.
951760	959620	In addition, not only you can delete them, but you can edit and recover or delete them.
960100	961820	Let's reproduce the issue.
961820	965260	So the end point will be slash messages slash message ID.
965260	967980	The methods will be delete and put.
968440	968920	Okay.
968920	975200	Let's reproduce the issue, leave a message to someone such as got any plans for tomorrow?
975240	979620	And we will see the message ID will be ending in 880.
980700	982980	We go to the end point.
982980	984380	We delete the message.
984380	987540	So delete method on this message ID, 880.
988000	994100	And it will show 880 got any plans for tomorrow, meaning that it worked.
994200	1007880	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.
1007880	1011280	So as expected, the app so far is working okay.
1011280	1025320	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.
1026380	1027140	Okay.
1027200	1030800	Now let's try to edit someone else's message.
1030800	1032360	We send the message.
1032360	1034180	My phone number is 123.
1034700	1039560	And it will say my phone number is 123 for the message ID, 72.
1039980	1042380	We read the messages of our victim.
1043320	1046180	We see this message ID, 72.
1046720	1052880	The victim will receive a notification from user D, my phone number is 123.
1053080	1066140	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.
1066420	1072000	And now when the victim clicks on the previous notification, it will see the new message.
1072000	1076120	My new phone number is 456, saying below edited.
1076160	1083300	However, the victim cannot know who edited that message, if it was the original sender or someone else.
1083300	1087080	So it has no knowledge regarding that.
1087080	1089360	Might have been the original sender.
1089840	1094380	Okay, vulnerability number 5, update someone else's profile information.
1094380	1099460	So you can update someone else's profile information including name, sexuality, age, et cetera.
1099640	1104040	The end point is slash GraphQL with operation name profile update.
1105460	1106940	Let's try this.
1106940	1110120	Let's try to update our own profile first.
1110120	1114700	So we are logged in as profile ID 91F, as shown in this header.
1114920	1128340	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.
1128340	1137320	And we will see in the response saying 200 okay, profile ID 29C, biography has been updated to ABCD.
1137320	1142220	So that worked without an issue showing another access control missing.
1142840	1148600	Now another interesting vulnerability is get the like from any profile.
1149260	1156260	So as details, you could send likes from profile number 2 to profile number 3 while being logged in as profile number 1.
1156260	1161200	The vulnerable end point is slash GraphQL with operation name profile like.
1161200	1163120	So let's reproduce the issue.
1163120	1174660	We are logged in as profile 29C and we send a normal like from user ourself 29C to user our test account 91F.
1174660	1175820	And it will say sent.
1175820	1178140	As expected, it worked okay.
1178480	1191020	However, if we swap to send a like from user 91F to ourselves, it will say you cannot like a profile you own.
1191400	1198600	So let's try to send from a random user to another random user to see if it works.
1198940	1200040	And this is what we did.
1200040	1206680	We are logged in as 29C and we send a like from 63 to 91F and it will say stay to send.
1206680	1210740	So that worked to control the like.
1210740	1213860	And now let's investigate who is this user 63.
1214980	1224220	We make a GraphQL request with the operation name profile query to query this user 63 to see who just liked us.
1224240	1231600	And what we see is imagine name Annie, gender woman, age 26.
1231640	1239660	And if we check our mobile app and we go to who liked us, we will see Annie and I blurred Annie's face.
1239660	1243800	Because I have a premium subscription, I can see who liked me.
1243800	1247460	So this issue shows another access control missing.
1247520	1251560	Vulnerability number 7, send messages in other people's chats.
1251760	1255860	Vulnerable end point slash channel slash messaging slash channel ID slash message.
1256600	1265080	We read our victim's messages and we find the channel ID ending in 0BD.
1265080	1269760	We send a message to this end point to this channel ID 0BD.
1269760	1271360	Hello from the attacker.
1272040	1277840	And the victim will receive a notification from user B, which is the attacker.
1278020	1282200	And in this chat is between user D and Bogdan.
1282200	1286760	And the notification comes from a third party user B.
1286760	1296780	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.
1296800	1300180	So it worked to send a message in other people's chat.
1300540	1307280	And the last issue, view other people's messages, end point slash GraphQL, operation name chat list query.
1308980	1314080	We can query our own matches.
1314080	1319640	And if we search by imaginary name, we see that we have a total of three matches on our own account.
1319640	1330380	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.
1330480	1336180	So this is another access control issue that is an access control that is missing.
1336180	1338340	Remediation for developers.
1338340	1342800	Implement authorization checks between users.
1342800	1345860	This must be on the backend and not frontend.
1346000	1347640	Implement user levels.
1347640	1351740	And based on these user levels, implement access controls between them.
1351740	1355780	For DevSecOps people, integrate CICD tools in the pipeline.
1355780	1367580	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.
1367580	1373300	So this is very challenging to find such sort of issues.
1374000	1388420	For CISOs, do data mapping, identify personal data that your organization collects, including where it's located, and introduce measures to protect this data.
1388420	1408280	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.
1409500	1418960	Regarding remediation, we informed the field regarding these issues, and after six months, all the issues have been patched.
1419040	1422220	And immediately afterwards, the blog was published.
1423080	1428060	The research is fully available on our blog post.
1428180	1432980	There has been a Guardian article on this issue as well.
1432980	1435760	And the slides will be published on our GitHub.
1436880	1441440	Now a short video in case... okay, it's not available anymore.
1442920	1445780	And Q&A, if you have any in case there is any.
1445780	1449320	If not, I will... one minute maximum.
1449840	1450920	Yes, please.
1456120	1457960	I cannot hear you, sorry.
1462500	1467820	That is a very good question, and it is very challenging to do that.
1467820	1472000	Because, for example, let's take this issue, the other people's matches.
1472400	1479320	Here is a request to check my own matches, which returns a response.
1479320	1486080	Then I swap this profile ID, and for a different profile ID, and it returns someone else's matches.
1486080	1492920	How do you identify in this response what's different from the other response?
1492920	1494760	Because it returns matches.
1494760	1502000	So it's... you need someone's intuition to realize that you should not have access to someone else's response.
1502000	1506940	So at the moment, I'm not aware of such a tool that can make such a comparison.
1507200	1509780	In case anyone knows, please let me know.
1509780	1511240	I'd be curious to find out.
