start	end	text
0	1460	Okay, hello everyone.
1460	3200	Thank you for being here.
3560	8260	My name is Cyrus Parzian and I am an AI retimer at one of the largest U.S.
8260	9660	healthcare companies.
10900	12780	Okay, can you hear me better?
13660	15620	Okay, my name is Cyrus Parzian.
15620	17620	I'm an AI retimer at one of the largest U.S.
17620	18980	healthcare companies.
18980	25720	Just a disclaimer, what I will be sharing today is my personal view and opinion and does not reflect my employer.
26660	39380	So I've been in offensive security, especially in the areas of phishing, creating and modifying payloads, and finding new ways to bypass an AV and EDR for the last 10 years or so.
39520	44120	And about last year, we actually started our own dedicated AI retiming.
44280	52200	And I've been focusing a lot on prompt injection and different ways to bypass healthcare chatbots or different type of chatbots.
52200	59560	But one area I think that might not get enough attention is the supply chain risk attacks in AI and large language models.
60300	62840	So today we're gonna talk about that.
63140	74480	Also, as part of my presentation, I will be mentioning a few well-known and top-tier tools and platforms, but the main goal is to stay vigilant and raise awareness.
76740	82640	So first, I'm not the first person to actually talk about Pickle Falls and the danger of them.
82640	92620	Back in Black Hat 2011, Marco first talked about Pickle Falls and highlighted the security issues with Pickle Falls.
92880	98240	And then in DEF CON Theory, Jonathan talked about how you could actually backdoor Pickle Falls.
98240	104400	And today we're gonna talk about the dangers of Pickle Falls in the age of AI.
104900	113520	So in this demo, I just show you real quick how you can actually turn an object into a Pickle file.
113520	115480	It's a very simple method.
115580	122000	And then next, we're gonna look into how you can actually create a malicious Pickle, which is, again, very simple.
122000	134980	In this example, we're just gonna basically pop up a calculator and then we have our load.pickle, which is just gonna load our Pickle Fall and then just gonna pop up a calculator.
134980	137640	So that really what the demo is.
137640	145220	But really what Pickle is, Pickle is a way or usually default way in Python to serialize and deserialize objects.
145480	155740	Think of it as a way that Python, Pickle turns objects into byte stream and then when we load it, it turns it back into objects.
155740	161860	And one of the main issues with it is that it can execute code when it's loaded.
162260	181680	And Pickle Falls usually have the extension Pickle or .pkl, but not every, but some files could actually not have the extension Pickle or .pkl and they still be a Pickle Fall because what really matters is the content of the file, not what really is the extension.
181680	188880	And that's one of the security issues is that you can't really rely on the extension to actually run that.
189920	195800	So let's think about how an attacker would go and actually try to use this vulnerability.
195980	214980	So they may go and download a model file from a website such as Hugging Face or GitHub, and they could go and create a model or a chatbot themselves as well, but we attackers like to use name camouflage so whenever we can use the popularity and the familiarity of people with another model or chatbot,
214980	216800	we're gonna focus on that.
216840	223100	And then after we downloaded that chatbot, for example, we're gonna try to insert our malicious code inside that chatbot.
223100	228440	And then we're gonna republish the model file to a website such as Hugging Face or GitHub.
228440	232400	And then we're gonna, at that point, we really have two options.
232400	238040	We could just sit back and relax and see who's gonna download our model or chatbot and run it.
238040	253440	Or if you're trying to actually go after a specific environment or target, we might make a very enticing phishing ruse and send that to them and entice that, in this case, probably most likely a developer to download our chatbot and run it.
254600	260320	So when I wanted to do that, I really didn't trust a lot of chatbots that were on Hugging Face.
260320	262900	So I just decided to create my own chatbot.
263080	264800	This is not a Rack chatbot.
264800	273440	Rack chatbots are chatbots that you have a data set, you have basically some data that you go create embedding of it, you set in a vector database.
273640	280120	This chatbot just relies on Flan-T5 small model, which is a model that you can run in most CPUs.
280120	282980	And that's why I actually chose that.
282980	288020	And there's another thing as well, is the Pickle Fall.
288020	295120	The Pickle Falls have a set of questions and answers that we're relying on in here to help our chatbot to answer it.
295120	299200	So I might go ask a question, what are the symptoms of the flu?
299200	306240	And you see the answers, because our Flan-T5 small model is so small that it actually repeats the word fever.
306300	320840	Another note here is that if you look at, in the Hugging Face, next to our Pickle Fall, there's a white square that says Pickle, and if you click on that, it says that Hugging Face scanners didn't find any issues with the Pickle Fall.
320840	328460	So there's no problematic problem with this chatbot, but here is the modification version of it.
328460	331040	And in this version, we went and made two changes.
331040	336000	First to the Python Fall, which is the main fall we have here, and also to our Pickle Fall.
336460	342040	And if you notice here, there is a change to our white square, and now it has turned into orange.
342040	351720	And if you actually click on it, you see that Hugging Face mentioning that the reverse shell fix function that we're mentioning here might be the issue.
351740	361180	But one note is, I think when I actually uploaded this, it took a week or two weeks for Hugging Face scanners to have enough time to actually load that.
361400	368700	And when they did, you have to actually go and click on that orange square to see the problem.
369420	375140	Now let's take a look at what we changed about our Python Healthcare chatbot.
375140	381160	We added the function, reverse shell fix function, which is a very simple function.
381160	384120	I call back to a server and port address.
384120	387700	Now if you want, you can set up a content delivery network or a CDN.
387780	392120	And in our Pickle Fall, which I said, we have a set of questions and answers.
392420	396800	At the end, we have a callback to war zero, which is our reverse shell fix function.
396800	405960	So what really happens here, when the chatbot loads the Pickle Fall, it actually calls back to that reverse shell fix function, which gives us a shell.
406620	416220	One of the greatest tools out there is Fickling for basically analyzing, creating Pickle Falls, and also check the safety of Pickle Falls.
416240	428760	So in here, I used Fickling first in the above screenshot to analyze the, this keeps going, to analyze the Pickle Fall and the modified version of the Pickle Fall.
428760	445400	So as you can see here, in the previous version of the Pickle Fall, we only have the set of questions and answers, but in the modified version of the Pickle Fall, we have added a new question and answer, which is the stealth payload, and also the war zero,
445400	448000	which calls back to reverse shell fix function.
448560	468380	In the bottom screenshot, you see that I actually check the safety of the modified Pickle Fall using Fickling, and as you notice, it exactly points out the issue with the Pickle Fall, which is the war zero and reverse shell fix function, and says this fall could maybe malicious.
468880	474060	But not every open source or actually commercial tool is gonna point that out.
474060	482000	So on the right side of the screen, I have two very well-known open source tools for scanning Pickle Falls.
482000	487060	I use them, and as you notice, they actually not point out any problems with that Pickle Fall.
487240	505640	And I actually created this chatbot in February of this year, and when I ran it against most AV and EDRs, they did not detect any issues with it, and one of the very well-known commercial tools for scanning Pickle Falls said, this attack may be a little bit complex because it's using the Pickle Fall and also Python together,
505640	508960	so they hope that they can actually detect it in the future.
510480	521320	After I created this chatbot, I notified Microsoft about it, so starting April this year, if you try to actually download this...
521960	524880	Sorry, this keeps going to the next slide.
524880	541320	But starting this April, if you try to actually download the healthcare chatbot, you notice that it would say virus detected, and if somehow you had an option to actually try to run the chatbot, it would say this is a reversal Trojan and would not allow you to do that.
542160	544980	Now let's take a look at a different demo.
544980	560040	In this demo, I'm gonna put all the reversal fix function and also the call to that function in a single Pickle Fall, and we're gonna just try to run it as an example to see if you're actually able to bypass Microsoft Defender Endpoint.
560040	565340	And I bring up Microsoft Defender Endpoint EDR because it's one of the greatest EDRs out there.
565340	576660	And as you can see here, using our one-liner, we can actually bypass Microsoft Defender Endpoint and it does not raise any flags or issues.
576660	581960	And I was able actually to install Microsoft Defender Endpoint trial in here without any issues.
582600	584820	Next, we're gonna look at ONNX.
584820	593360	ONNX is a deep learning model that's used for actually converting a framework to another framework.
593360	598320	So you might have a PyTorch model that you're trying to change it to TensorFlow.
598920	609480	You're doing the same thing that we did in Pickle Fall, but we're just gonna use a one-liner to see if we're actually, in this time, we can actually bypass Microsoft Defender Endpoint.
609540	621040	And as you can see here as well, we get a callback to our command and control, which is just a very simple Python server, but I was just curious if that would actually bypass Microsoft Defender Endpoint as well.
621180	627600	And if we go to the protection history, we don't see any signs of our malware being detected.
627600	631920	And in the virus and protection settings, everything is good as well.
632440	634760	So now let's take a look at the code.
635000	647960	In our Pickle version, we just go define the reverse shell payload, we encode it in a Base64, we create a malicious class for that, and then we just dump the Pickle Fall.
647960	660280	And very similar in the ONNX version, we define the reverse shell payload, we encode it with Base64, and we create a ONNX model, and then we embed our payload and we save it.
660280	665420	So that's a very easy way that we could actually compare those two together.
666400	668260	Now let's put everything together.
668260	675940	We've gone to the ONNX, now we want to take a look at what happens if we actually try to inset that ONNX as part of our healthcare chatbot.
675940	686380	Because what I want you to think about at this point, that healthcare chatbot is just a loader that we try to load various Python modules that may allow us to run code.
686380	705420	So in here, we're just going to try to create our ONNX malicious file, and then using ONNX.load in our healthcare chatbot, we're going to load that malicious ONNX, and we're going to use Flan-T5 model, similar as before, to run that code.
706020	710260	Sorry, it seems we are running at issue, okay.
711360	734040	Okay, in here, as you can see, we're going to run the Flan-T5, we're going to run our healthcare chatbot using Stemlet, and, apologies for some reason, and then in here, as you can see, we are running the healthcare chatbot, we are waiting to load our ONNX model in the background.
734580	736460	I have to load this.
738180	739980	Yeah, we're waiting for it here.
740260	758280	And as you can see, we get a callback to our command and control, and now chatbot is functional, the developer or whoever is using the chatbot may just click on it, they get answers to their questions without any issues, and we as attackers got an access to their machine without them knowing that.
759040	765420	So, this was just some theories of, we're doing it in a lab, but does this attack actually happens in real world?
765440	770560	And there are multiple cases of that over this year and last year that has happened.
770560	779240	One case was in February, Hugging Face found multiple malicious pickle falls on their website.
779700	798600	Another developer in Disney actually gave access to their machine voluntarily because of AI Trojan horse, and the hackers were actually able to download 1.1 terabyte of data, and there was a malicious case of PyPy when they actually put some pickle falls there as well.
798600	801220	So, still a big issue.
802440	812140	So I talked about healthcare chatbot and how we could actually use that to make it a loader for various Python modules.
812200	818460	In here, I created four other different versions as well and uploaded to Hugging Face.
818500	823900	In the case of Egg, Egg is a, think of it like a zip file for Python packages.
823900	829720	So I went and created a version that only specifically focuses on egg files.
829980	833180	Then I created a Cloud Pickle version.
833180	842000	Cloud Pickle, think of it still pickle, but it has extended functionality for other type of file types that you may wanna do.
842100	850860	Joblib is another one that you only use to save models, but under the hood it actually has pickle.
850860	855020	And then lastly is Feather, which I call it Fast CSV.
855300	859740	So those are like all of the four type of healthcare chatbot I created.
859740	867440	And as you notice, two of those are actually being detected by Hugging Face, but two of them are not being detected.
867440	873780	And that really, the issue is that some of them could easily bypass Hugging Face security.
874420	884820	In the next two slides, what I really wanna point out here is that there are a lot of Python modules that some of them are being used in LLMs.
884820	890900	So Pickle is one that being used in LLMs, Cloud Pickle is another one, and we mentioned ONNX.
891020	901240	But because of the prevalence of Python in large language models and in the AI workflow and pipeline, attackers don't necessarily need to go and use them.
901240	909000	They could go and choose to use other Python modules such as Egg, such as Feather that we mentioned.
909000	922900	So those are some of the notes that we wanna look into because we may go and just focus on the AI pipeline and just the modules that being used in AI pipeline, but we may miss the other important ones as well.
923820	926020	Lastly, this is our last demo.
926020	931900	In all of the previous demos I showed you, you actually needed to have Python installed on the machine.
931900	937320	But using PyInstaller, you actually can turn your ONNX file into an EXE.
937320	948680	So in here, I just turn our ONNX file that I showed you into an EXE, and we are able to get a callback to our command and control center here without any issues.
948940	956880	And I'm actually, I'm gonna go as far as trying to scan this EXE with Microsoft Defender Endpoint, which usually they don't suggest you do that.
956880	966060	But as you can see, we were able to actually bypass Microsoft Defender Endpoint without any issues using the ONNX EXE.
966780	973760	Next, let's take a look at the Microsoft console and see what's the artifact look like for the EXE that we just ran.
973760	979540	As you can see, VirusTotal gives our EXE a score of zero out of zero.
979540	984900	And if you look, there is no sign of malicious activity as part of our EXE.
984900	994300	So there are a lot of other models, there are other Python modules that you can go and try to turn them into EXE using PyInstaller.
994560	998780	And that would absolutely bypass a lot of AV and EDRs.
998780	1009080	And that's one of the issues I had when I was doing full-time red teaming is that we had to spend days, weeks, or months trying to find a new payload that would bypass AV and EDR.
1009080	1015080	But apparently, if you actually focus on a lot of these Python modules, you're able to do that.
1015980	1019080	Okay, what is the mitigation or recommendations?
1019280	1023460	Well, probably the main thing is do not run untrusted code.
1023460	1026220	So if you don't trust it, do not run it.
1026220	1036440	And if you want to think about from the developer's side of view, they trust the websites that they're downloading that to detect this type of activity.
1036440	1044660	And after they download it, they trust the AV and EDR to actually basically detect any type of malicious activity.
1044660	1046900	But in this case, it doesn't happen.
1046900	1062860	So another thing that you might want to focus on is restricting access to websites such as GitHub and Hugging Face for most of the users in the environment because it is so easy to actually download the type of, this type of healthcare chatbots that in the background,
1062860	1066260	they may actually give access to the machine, to the attacker.
1066800	1069260	And why traditional security fails?
1069260	1081340	Well, traditional security fails because the reality is a lot of AV and EDRs are not looking into the supply chain risk attacks with AI and ML file formats.
1081420	1089480	And it is not an easy job to actually try to, you know, go and patch the issues and the securities with those.
1089480	1100360	So in a, for example, an example for a HTA file or a JavaScript file, it is very easy to go and block or detect a .HTA or JavaScript.
1100360	1108420	But as we showed, a Pico file, if it doesn't have the .pko pickle, still could be a secure risk but we wouldn't know that.
1108620	1113620	So those are some of the things that I think could be great to implement.
1113620	1118000	With that, thank you for your attention and I hope you found this informative.
1118000	1118360	Thank you.
