start	end	text
0	10560	All right, it is my fantastic opportunity to introduce Ravid and Jay talking about Bolobuster.
12520	20780	All right, all right, check, check. Everybody hear me? Okay, great. So good morning,
20780	26220	everybody, and thanks for joining. We are really excited to present in the AppSec
26220	34080	Village, and today we are going to talk about Bolobuster, our methodology that we developed
34800	45120	in order to automate detection at scale using LLMs. But first, let's introduce ourselves.
45120	51880	So my name is Ravid. I'm a security researcher at Palo Alto Networks. I expertise in the
51880	59080	WAAS field, which is web application and API security, mainly. And in my free time,
59080	66580	I enjoy watching football games, traveling the world, and I take care of my dog, Maple.
70210	75310	Hi, my name is Jay. I am a security researcher with Palo Alto Networks, and my research has
75310	80810	been focusing on identifying the threat and risk in the cloud environment, and recently
80810	85250	I have shifted my research focus towards generative AI, in particular looking into
85250	92970	the potentially adversarial use of generative AI. When I'm not working, I spend most of
92970	99490	time with my hyperactive twin boys. They behave just like minions and head off to the parent
99490	104350	there with young kids. I know how difficult it is to take care of young kids when working.
104350	110730	And I'm also a cat lover, so I also spend a lot of time scrolling through funny cat
110730	121950	videos when I'm not working or working. Great, so let's go over the agenda for today.
121950	129050	So we are going to cover the concept of BOLA. We will show you our methodology of automating
129050	134970	BOLA hunting using LLMs. You are going to see a real BOLA testing that is part of our
135330	142630	methodology. And finally, you will see how we hunted down 17 new BOLA vulnerabilities
143750	154570	in one of the most popular open source projects out there. So broken object level authorization
154570	163910	or short for BOLA. So our motivation for the research was pretty huge, I would say. For
163910	171410	those of you who are not familiar with BOLA, it is ranked at the top risk at the OWASP
171410	178890	API top ten. And it is also the fourth most reported vulnerability in HackerOne. So it's
178890	185950	really popular and it's really severe. And yet, there is no automation tool that can
185950	193890	actually and reliably detect BOLA at scale. So all of this was a big reason for us to
193890	203350	try to solve basically an unsolved issue today. And let's understand first what is
203350	210710	exactly BOLA. So if you take a look at this example, we have a patient, we have a clinic
210710	217510	application and we have a patient that can query his visit ID and get his doctor notes.
217610	222990	Pretty straight forward. But what would happen if this patient would decide to act maliciously
222990	229810	and try to fetch another visit ID that does not belong to him? If he would be able to
229810	235730	do it, it means that the back end will have an authorization issue and this is basically
235910	245450	a BOLA. So in a straight forward way, if I can delete or modify let's say Jay's comment
245450	251410	from Twitter or Instagram, this is a clear BOLA because I shouldn't have the permission
251410	258690	to access, modify or delete another user object that does not belong to me. And the consequences
258690	264290	can be huge. It can start from data leaks to data manipulation and even the full account
264290	274710	takeover as we will see today. We faced many challenges when we tried to automate the process
274710	281890	of BOLA detection. The first was the complex authorization mechanism. So application these
281890	288370	days actually has typically multiple users with multiple roles with multiple resources.
288830	294890	So it's very difficult to say which user can do what. Which user is allowed to do which
294890	304310	action exactly. And this really can get complex. Also applications are stateful today. So each
304310	311330	action you make or each API call you make can affect the state of the application. And
311330	318570	basically each endpoint is dependent on one another. So imagine you try to delete a comment
318570	324750	from an article or a post. So first you would need to create this post and create a comment
324750	329470	for this post and only then you will be able to delete this comment. So they are dependent
329470	336550	on each other. You cannot isolate one of them. And the execution order is really important
336550	345370	in order to not have any technical issue. So it is a big challenge to understand that
345370	354690	these endpoint dependencies actually. Also BOLA doesn't have a there is a lack of vulnerability
354690	362850	indicator basically. So unlike XSS or SQL injection which is pretty straightforward to recognize
362850	369730	the pattern of the payload, BOLA is a logical error. So it's not really malicious by definition.
369910	378650	So it's hard to analyze and understand whether it is a BOLA or not. And lastly the context.
378790	384430	So we try to understand which endpoint in the application and which parameter contains
384430	392230	sensitive data. And it's not that easy to understand it. And also to understand what
392230	397730	is the impact actually of each action that we can take in the application. So all of
397730	404830	this was pretty big challenges that we faced during the process.
409790	414110	Thanks, Ravi, for covering the background. I hope everyone understands why automating
414110	423910	data BOLA detection is difficult. So it was only two years ago that we realized that AI
423910	429270	may be able to give this problem a glimpse of hopes. Because of the recent advancement
429270	435550	of AI, we were provided with new tools to solve the problem that were not possible to
435550	444410	solve in the past. And also in particular, our challenge of extracting context and logic
444410	450750	information from textual data aligns well with the capabilities of large language model.
450750	456230	So that's the start of our journey in using AI to solve BOLA detection.
456950	463170	Here is a high-level overview of our methodology. The only required input of our methodology
463170	471530	is an OpenAPI spec or a Swagger spec. The first stage, identify the endpoint that can
471530	478910	be vulnerable to BOLA. Not every endpoint can be vulnerable to BOLA. We used AI to help
478910	485810	analyze every endpoint and its parameters to determine, to select a subset of endpoints
485810	494870	as our target. This step helped us narrow down our target endpoint and avoid wasting
494870	502270	time on the endpoints that are not at risk. We call this endpoint a potentially vulnerable
502270	509910	endpoint, short for PVE, or target endpoint. We will refer to this endpoint as target endpoint
509910	516010	or PVE in the rest of the talk. The next stage, uncover the dependency relationship
516010	522910	between endpoints. Modern web applications are complex. Typically, one endpoint depending
522910	529550	on many others. For example, in order to test an endpoint that updates an invoice, you first
529550	536050	need to call the endpoint that creates the invoice. And in order to create an invoice,
536050	541350	you first need to call the endpoint that creates the transactions that can be included in the
541350	548550	endpoint. As a result, it is crucial to understand the endpoint that my target endpoint depends
548550	555310	on before I can accurately test it. With the endpoint dependency relationship, identify
555310	563370	the next stage, calculate the execution path to each target endpoint, and create a test
563370	570450	plan for each target endpoint. The next stage then transforms the test plan
570450	577370	into multiple executable bash scripts using large language model. There may be one or
577370	584530	multiple execution paths to each target endpoint, and we aim to cover as many paths as possible.
584530	592710	Finally, we set up a target API server and run all the test script generated in the previous
592710	600130	step. The process of user registration, user login, and token refresh have all been automated.
600130	606070	And we also use AI to help analyze the response and logs produced during the test.
610360	615440	Let's dive into a little bit more detail in each stage. In the first stage, we try to
615440	620100	identify the endpoint with input parameters that reference private, sensitive, or confidential
621040	627700	information. These are the endpoints that we target. These are our target endpoints.
628220	634160	For example, let's look at the first endpoint. The username here indicates that the endpoint
634160	640260	may reference two data associated with the individual. If this endpoint is vulnerable
640260	649240	to BOLA, an attacker may be able to reset another user's password. Similarly, if the
649240	658320	second endpoint input user email is vulnerable to BOLA, an attacker may be able to change
658320	668040	another user's email. Traditionally, pentesters manually look for this endpoint and their
668040	675640	parameters to determine their target endpoint. This process is slow and cumbersome, especially
675640	683060	for very large applications with hundreds of endpoints. So we use AI's capabilities
683060	688860	of reasoning and understanding text to automate this step.
689340	698020	Here is a snippet of our prompt that shows how we teach AI to recognize parameters that
698040	707920	may reference two sensitive data. Essentially, we instruct AI a set of rules and examples.
708680	715500	At the end, AI returns us the endpoint and parameters that meet any of the condition
715500	723820	that we provided. The next stage uncovers the dependency relationship between endpoints.
723820	731680	As I mentioned, due to the complexity of modern web application, each API call may change
731680	741100	the state of the application and affect the outcome of other API endpoints. As a result,
741100	746860	it is crucial to identify their dependency relationship before we can test them.
747930	753340	In this diagram, we call the endpoint on the right as consumers and the endpoint on the
753340	761240	left as producers. Producer endpoints output the values that consumer endpoints need as
761240	769940	input. Again, producer endpoints output the values that consumer endpoints use as input.
769940	775740	This is one of the most important concepts in our research, in our methodology. Let's
775740	783320	look at this endpoint as an example, delete user. In order to correctly test this endpoint
783340	792060	we need to feed it with an existing username. If we feed it with a random variable, a random
792060	798120	username, this endpoint will always, the API call will always fail and give us meaningless
798120	805360	result. That's why we need to identify its producers. In this case, this consumer endpoint
805360	812600	has four producers and each of them can output the existing username that endpoint can use.
813540	822980	Here is a snippet of the prompt that we use to teach AI how to recognize dependency relationship.
824000	831160	I want to emphasize that also we can use heuristic algorithm to match the output parameter name
831160	839700	of an endpoint with the input parameter name of a consumer. This heuristic algorithm is
839700	846720	not reliable. The reason is that developers sometimes use different parameter names to
846720	854740	reference the same data object within the system. Developers may also use the same parameter
854740	861960	names to reference different data object across the system. That's why we use a combination
861960	869680	of heuristic and AI to uncover the dependency relationship. We need AI to analyze each parameter
870460	877540	endpoint's functionality in order to reestablish their dependency relationship based on their
877540	887400	functionalities. Once we have the, using the dependency relationship uncovered in the previous
887400	895620	stage, this stage build up a dependency tree for each potentially vulnerable endpoint.
895620	905400	In this dependency tree, the root node represent our, one of our target endpoint, or PVE. And
905400	913700	any two directly connected nodes in a tree represent a consumer and producer relationship
913700	922440	in which consumer, the parent node is a consumer and the child node is a producer. Let's use
922440	930600	the upper half of a tree as an example. In this case, endpoint is a producer of PVE.
930700	937540	Endpoint output the value that PVE need as an input. And endpoint one itself also has
937540	944760	two producer, endpoint three and four, which produce the output that endpoint one need
944760	952380	as the input. Finally, in the next stage, we turn, we calculate
952440	963300	the execution path to each potentially vulnerable endpoint. So in the dependency tree, a path
963300	973340	from the leaf node to the root node represent an execution path. This is a reverse tree
973340	979300	traversal. So the path is actually from the leaf node to the root node instead of from
979300	985240	the root node to the leaf node. And let's plug in some real endpoint to see how we
985240	991920	do the calculation. In this example, the target endpoint is delete comment. And this endpoint
992780	1002040	has two producers, get comment and post comment. And these two producers in turn also each
1002040	1009280	has two producer. So at the end, there are four execution paths that can all reach the
1009860	1019500	target endpoint delete comment. In the last stage, we then turn each execution path into
1019500	1028180	an executable bash script using large language model and run the script to actually send
1028180	1035660	HTTP request to the target endpoint. The process is more complicated than just generating
1035660	1041240	and sending the request as Ravid will explain in the next few slides.
1044220	1052700	Great. Thank you Jay for the overview of our methodology. And before we can see actually a real
1052700	1060140	BOLA test and view our BOLA that we found, let's see the prerequisites that we have before we
1060140	1067480	can create an actual test. So we use LLMs again to create the user registration process
1067500	1074580	and to collect the login data of the application. So basically we generate user LLM, generate
1074580	1080000	user credentials that meets the criteria in terms of the, for example, password complexity
1080000	1088820	and ATC. And we execute the user registration process and we fetch the login data from the
1088820	1097480	spec. So this is crucial in order to then log in the users of the specific test and get a
1098260	1104040	valid and unique token for each one of them. This information will be stored in a dedicated
1104040	1112960	file so we will have an easy access and usage. Then we will want to isolate the test data.
1113740	1120040	So if you ever saw a swagger or open API spec file, you know that it can be huge. It can
1120040	1125300	be thousand lines of code, especially for the biggest, for the bigger applications.
1125300	1133360	And we want to isolate only the data that is needed for the specific test. So Jay mentioned
1133360	1138020	that we have a consumer and producers in each test so we would like to have only the data
1138020	1145500	which is relevant to these endpoints. So we will create a new file, we will feed it to
1145500	1155120	AI and it will save us about 90 to 95 percent of the spec. So we do it for efficiency to
1155120	1160520	ensure that LLM will get only the accurate data that it actually needs for each test
1160520	1172310	creation. And for cost, we want to have as lowest tokens as we can. And finally, we're
1172310	1179210	creating the test script and it will be saved as an executable bash script. You can see
1179210	1187750	an example of a very simple consumer and producer. We have a put user password and a get user
1187750	1194150	to get the user name. This kind of test will be saved in a put get directory. Put would
1194150	1201410	be the parent, get would be the child. And the test generation actually runs asynchronously
1201410	1209190	in order to save time. And right now we averaged a 1.5 second for each test. And we have a
1209210	1218050	1.5 second for each test creation. Right, so the final step would be to actually run
1218050	1224990	the test script in the application. So we have an execution order and our main goal
1224990	1231870	is to avoid any chance that a test would fail due to technical reasons. So we want the test
1231870	1238830	to fail only if the PVE is not vulnerable to BOLA. It should be. So we will first run
1238830	1243370	the test that populate data and resources to the application before we can fetch them.
1245110	1249830	And also we will try to push and delete, to push update and delete operation to the end
1249830	1255210	so we won't experience a scenario where we delete a user or delete a resource and then
1255210	1262290	try to fetch it. So again, the main reason for this is not to have technical issues in
1262290	1272530	the test that will make it fail eventually. So right after we finished our, preparing
1272530	1280210	our methodology, we wanted to evaluate our BOLA buster actually and see the results.
1280570	1286910	So what we did is we took the, maybe the best API fuzzer, which is open source right now,
1286910	1295130	which is Ressler. Ressler is a Microsoft developed API fuzzer. You can find it on GitHub. And
1295130	1301730	its goal is to automate the process of API testing and to find vulnerabilities, like
1301730	1309020	our goal. So what we did is we took three open source applications which are deliberately
1309470	1316030	vulnerable to the OWASP API top ten. We took Vampy, Capital and Crappy. You can see from
1316030	1323810	the table that they have unknown BOLAs. And we started to test our tool against Ressler.
1325370	1333690	As you can see, Ressler could not identify any BOLA of these applications and it made
1333930	1342030	a pretty big number of API calls. Thousands and even hundreds of thousands. Then we tested
1342030	1348450	our tool, again the same application, and the results were amazing. I hope you can see,
1348450	1354170	we found all the BOLAs in each one of the applications and we made significantly lower
1354170	1361230	API calls. So eventually we made less than one percent of the calls that Ressler made.
1361790	1371510	So this is a crucial part. It proved our efficiency and we didn't make the application load too
1371510	1381810	much. Finally we wanted to have a 100 percent true positive rate. So our goal was to find
1381810	1388730	any BOLA if it exists in the application. We did have some false positives, you can't
1388730	1397390	avoid it, but again our main goal was to focus on the true positive rate which was 100 percent.
1400200	1407120	Now we can take a look on a real scenario for a BOLA test. So we have this high level example
1407120	1414180	where first Alice create an article, then Alice create a comment for this article, and then
1414180	1422340	Bob will try to delete Alice's comment which is the PVE. So first Alice and Bob will log
1422340	1429220	into the system, they will get a unique token which will be saved. Alice will create a new
1429220	1436040	article in the system, we will save the article title. We will do the same with the comment,
1436040	1442840	so Alice will create a comment, we will save the comment ID, and finally the PVE, the maliciously
1442840	1449860	Bob will try to attempt to delete Alice's comment. And this scenario can have two results.
1450520	1457200	If it will be successful we will have a potentially BOLA for this endpoint, or if the application
1457200	1467620	can defend BOLA as well, so it will be forbidden. Let's see the actual snippet of our code. So
1467620	1475160	first of all we will create a unique random string each time, so we will be able to create
1475160	1483960	an article for multiple tests without getting an error that it already exists. So as you
1483960	1491720	can see we make a POST request to slash API slash articles, you can see that we use user
1491720	1501740	A token which reference to Alice, and we use the article title as a random string. We will
1501740	1512540	save the slide which is in this case the article title. Next Alice will create a comment, so
1512540	1518580	what's special about this is that if you take a look at the actual endpoint, you can see
1518580	1527640	that we dynamically use SLAG. So we saved this parameter from the previous request, and then
1527640	1534140	we dynamically use it. So now we can reference to it as a, we can know that this resource
1534140	1542520	actually belongs to Alice. Again, we save the comment ID, and then finally we use the
1542540	1551560	PVE, the delete operation. You can see again that we use SLAG and comment ID that belongs
1551560	1558880	to Alice. And the main difference, now we use the user B token, so now we can identify
1558880	1565520	that this request is made by Bob and not Alice. And lastly we will check if the test passed.
1566300	1571620	Now I want to emphasize that actually every boiler test that we make is, if you think
1571620	1577680	about it, is malicious by definition. The last request, the PVE, will always, we will
1577680	1584680	try to perform an action that you shouldn't be able to perform, right? Bob shouldn't be
1584680	1591620	able to delete Alice's comment. So in case it is successful, we can mark this test as
1591620	1598720	at least potentially vulnerable to boiler before we can make further analysis and verification
1598720	1604220	let's say in the application context. So you just need to understand that every boiler
1604220	1613630	test is malicious by definition. So let's see how we actually hunted some boilers in
1613990	1624060	the wild. We have a quick demo of showing the running of the tool. So this is a Python
1624060	1632780	based and it will, I hope you can see, it's testing each API endpoint and in case the result is
1632800	1641800	successful, it will mark it with boiler found and the actual API endpoint. After this we
1641800	1647000	will take the list and we'll further analyze it and try to understand if this is a real
1647000	1656400	boiler or not. So all of these applications, it has something in common. We found boilers in
1656400	1664240	it. So first of all, Harbor. It is a cloud native container registry. It is basically a
1664260	1671380	equivalent to Docker Hub, which I'm sure most of you are familiar with. It is a CNCF graduated
1671380	1680660	project, so it's been in the wild for a while. It has around 2 million downloads these days
1681420	1689360	and we actually found, this year we found a new boiler, which we will talk in a bit. And
1689360	1695620	next up, Grafana. It's a data visualization and monitoring tool. Very, very popular. It's
1695620	1705280	being used by 20 million users actually these days. And we also found a new boiler there. And
1705280	1713520	lastly we have Easy Appointments, which is an open source tool. It has almost 200,000 downloads
1713520	1724020	and we actually have been able to find 15 new boiler vulnerabilities there. A little bit. The
1724020	1732060	most amazing thing about it is actually that 7 of them are critical. So they got a CVSS of 9.9
1732060	1739160	which actually allows a low privilege user to gain admin access. Remember we talked about
1739160	1749220	compromise, so we have a full application compromise in this case. Let's talk about Arbor
1749220	1758660	vulnerability. It's pretty interesting. So Arbor has projects in it. You can have roles, so you
1758660	1766580	can be an admin, a maintainer, a developer or a guest. Basically we found the vulnerable
1766580	1772880	feature to be the project configuration metadata. So I hope you can see the attributes there for
1772880	1779900	the configuration. Basically an admin can change the project to be private, public, it can
1779900	1788860	implement some image vulnerability scanning and have more power. So Arbor claimed that in the
1788860	1794560	official documentation that only the admin project should be able to create and modify this kind
1794560	1804760	of configurations. Which makes sense. And actually we found out that an unauthorized user can do
1804760	1811300	the same operation. So we tried to play with the roles of the project and we saw that the
1811300	1818060	maintainer for example could not make any change via the UI. So this is a maintainer login which
1818060	1827260	is grayed out, you cannot modify it. But maintainer can actually create, delete and modify
1827260	1835180	these attributes via the API. So there is a big discrepancy between the UI and the API behavior.
1835580	1843540	And this vulnerability actually create an extent in the maintainer privileges. So now a maliciously
1843540	1850660	maintainer could be able to make a private project public, deploy unverified images and actually
1850660	1858580	control every configuration that you can control in a project. And as you can imagine the
1858580	1866600	consequences can be pretty high. So we can compromise the whole integrity of a project and actually
1866600	1877840	the security posture. So Harbo verified, that's it, okay. So just would say that Harbo
1877840	1884840	identified this vulnerability and you can find it in their security advisory. We got a CVE and you can
1884840	1890320	check out our blog about it when we technically talk about how we found this.
1890320	1900840	Okay, thanks. I will just use the last 30 seconds to share the most important lessons we learned
1900840	1907580	from working with AI. First, AI isn't always the best solution. Problems with existing heuristic
1907580	1913220	solutions should not be solved by AI like sorting, finding trees or solving equations. Those
1913220	1919700	problems have existing optimal solutions and always use heuristic rather than AI. Second, don't
1919700	1926220	trust, always validate. Blindly trusting the output of AI can be very, very dangerous. So always
1926220	1932800	validate the output of AI before using them or passing them to the next stage. Finally, makes AI's
1932800	1941460	jobs easier. Treat AI like a very capable junior worker who can do simple tasks exceptionally well,
1941460	1947360	but can start making mistakes when the job becomes more complex. So when working with AI, it is
1947360	1956260	always a good idea, good strategy to use divide and conquer to simplify its task. Thank you so much.
