WEBVTT

00:00.000 --> 00:06.460
Start by saying thank you for our next speaker for all of his sleepless nights, whether he's paid for it or not.

00:06.460 --> 00:08.060
He's here to give this to all of you.

00:08.780 --> 00:09.820
Thank you.

00:18.080 --> 00:20.460
One, two, okay.

00:24.480 --> 00:25.500
Okay, it works.

00:25.500 --> 00:28.860
Clicker test, clicker test, clicker test.

00:28.860 --> 00:29.740
Our

00:33.700 --> 00:38.460
story begins on March 14th, 2025.

00:38.660 --> 00:40.080
At about 4 p.m.

00:40.080 --> 00:49.480
UTC, an attacker was able to compromise a popular GitHub actions repository called TJ actions change files.

00:50.740 --> 00:58.840
The attacker injected code to the repository that was printing all of the CI runner's secrets to the CI runner's logs.

01:00.100 --> 01:13.520
About 4 hours later, the first issue was created on GitHub, pointing out that something odd was going on in this repository and that consumers of it were getting their credentials leaked.

01:15.460 --> 01:20.020
The following days were a mess in the GitHub actions ecosystem.

01:20.960 --> 01:25.540
We had companies trying to warn users against using this action.

01:26.380 --> 01:36.120
We had CVEs being created and overall fear was sown among the GitHub actions users.

01:37.480 --> 01:44.260
Everybody posted about the leakage and the TJ actions was compromised.

01:45.720 --> 01:49.680
However, this was not the attack.

01:49.680 --> 01:52.120
The leakage was not the point of the attacker here.

01:52.160 --> 02:02.040
So, my name is Aviad and welcome to today's talk, Not Just a Pipeline Leak, Reconstructing the Real Attack Behind the TJ Actions Incident.

02:03.880 --> 02:10.120
Um, a word about myself , um, my name is Aviad Hachami, previously a security researcher at Power Auto Networks .

02:10.120 --> 02:19.320
Um, currently an eBPF engineer at Autigos.io and I'm interested in bug bounty, graph theory, lack of fermentation and other stuff.

02:20.180 --> 02:24.900
Um, right before I start, I'd like to say two things.

02:24.900 --> 02:28.920
First, um, parts of my family, my parents are here.

02:28.920 --> 02:31.460
So, they came all the way to DEF CON.

02:31.460 --> 02:32.440
Thank you.

02:33.300 --> 02:34.860
Here's the voice crack.

02:34.860 --> 02:37.120
Um, they came all the way to DEF CON.

02:37.120 --> 02:40.720
Last year they didn't believe I gave a talk here so they had to see it in their own eyes.

02:40.720 --> 02:42.120
Uh, thank you for coming.

02:43.160 --> 02:48.640
Um, this is exciting, I really appreciate it and I hope you'll last past for, uh, slide number four.

02:49.080 --> 02:53.240
Um, second, my wife and a group of my friends sit at my house now watching this.

02:53.240 --> 02:57.540
Um, here's a drinking game for you and for future YouTube, uh, viewers.

02:57.540 --> 02:59.820
Whenever I say TJ Actions, take a sip.

02:59.820 --> 03:01.600
I'm an alcoholic, trust me.

03:03.480 --> 03:04.400
Alright.

03:07.420 --> 03:09.180
Okay, focusing.

03:09.840 --> 03:10.580
Okay.

03:11.240 --> 03:18.200
So, as I just said at the time of this research, I was a security researcher at Palo Alto Networks but no more so I'm gonna read this one.

03:18.200 --> 03:25.020
Um, this represent, this presentation covers research performed by my colleagues and myself during my time of employment at Palo Alto Networks.

03:25.020 --> 03:30.700
I have since left the company and no longer work for Palo Alto Networks and therefore I'm not speaking on their behalf here today.

03:31.220 --> 03:36.640
Um, I would like to thank Palo Alto Networks for allowing me to research, to share this research with the community.

03:37.900 --> 03:38.700
Alright.

03:40.360 --> 03:41.000
Cool.

03:41.040 --> 03:42.920
Um, so what's in this talk?

03:42.920 --> 03:46.920
This talk is going to be a debug level walk through the TJ Actions incident.

03:46.920 --> 03:51.680
We will uncover the end to end attack flow and track the timeline of it.

03:52.300 --> 04:00.600
We will go over the TTPs the attacker employed and break them down in order to get a better understanding at our ecosystem and its vulnerabilities.

04:01.160 --> 04:09.920
We will then go over how we at Palo Alto Networks were able to trace and uncover the steps of this attacker, um, and what tools we've utilized to do so.

04:10.620 --> 04:20.620
Um, I'll then share some additional victims of this attacker and the impact and wrap it up with some mitigations and, uh, a brain teaser.

04:20.620 --> 04:23.760
Something I'd like to ask you all and share with you.

04:25.220 --> 04:34.220
So, as I said, uh, our story, the TJ Actions story takes place in the GitHub world, uh, where anyone can make their code accessible to others.

04:34.220 --> 04:40.340
We know this today as the open source community, um, which we learned to rely upon and trust.

04:40.340 --> 04:45.020
Uh, we trust it so much that we have complete ecosystems rely upon that.

04:45.020 --> 04:48.340
A quick and easy example is the Golang ecosystem, right?

04:48.800 --> 04:58.240
Um, and within GitHub exists the CICD offering called GitHub Actions, uh, which allows users to execute arbitrary code from other open source repositories.

04:58.440 --> 05:14.280
Um, in that context such repositories are called Actions and by referencing them in our CI pipeline we allow GitHub to execute the actor, the Actions code, uh, in our context, uh, and perform various tasks like build, lints, tests, you name it.

05:14.280 --> 05:31.640
Um, and if you're curious to know how many engineers and developers, uh, actually rely on running arbitrary repositories code in their pipelines, then a recent paper showed GitHub Actions is said to be used by at least 33% of the market.

05:31.700 --> 05:39.560
Um, I did see some papers stating more than 50% but it seemed a bit like non-realistic so I went with a more conservative paper.

05:41.180 --> 05:52.100
And throughout the years, we as a community , we developed a habit of assuming that if something is accessible to us, um, and it's accessible to the masses, uh, we can rely upon it.

05:52.100 --> 05:59.260
We call it highly eyeballed, uh, well opinionated , we give it names, but basically it's accessible to the masses so we trust it.

05:59.640 --> 06:05.060
We actually trust it with our most sensitive processes like building our product.

06:05.980 --> 06:08.540
And attackers know that fact too.

06:08.680 --> 06:14.080
And when such a trust contract is breached, we get the following news.

06:14.900 --> 06:20.240
23,000 project getting their credentials leaked to random people online.

06:20.460 --> 06:26.440
And while this is a severe thing, I agree, um, I just said a moment ago that this was not it.

06:26.440 --> 06:27.940
This was not the attack.

06:27.940 --> 06:33.980
And in reality, this was just the tip of the iceberg, um, the nuke, if you will say, at the end of the line.

06:34.400 --> 06:36.700
So let's start breaking down this attack.

06:38.400 --> 06:43.080
When we initially faced the attack, we were met with the following scenario.

06:44.120 --> 06:49.760
We had an attacker that somehow compromised the TJ Actions changed files repository.

06:50.540 --> 06:57.940
And this repository is actually, happens to be a popular GitHub Action that was used by many GitHub Actions users in their workflows.

06:58.820 --> 07:04.460
Um, and during the time of this event, whomever used this, uh, action got their credentials leaked.

07:04.540 --> 07:05.720
Pretty simple.

07:06.960 --> 07:25.120
When I say, by the way, a workflow, uh, that was used by many, then it implies you had or other had, uh, others had, um, this type of, uh, workflow definition in their repository, um, either public, private, you name it, um, and you were basically referencing the repo TJ Actions explicitly like we see here.

07:25.120 --> 07:32.120
And if you see it references, uh, V39, so it implies I want this repo at git tag V39.

07:32.120 --> 07:33.280
That's basically it.

07:33.600 --> 07:43.180
Um, when you have that in your pipeline, you basically tell, you say, hi GitHub Actions, run the code in this repository, in this repository in my context.

07:43.180 --> 07:43.980
Right?

07:45.560 --> 07:56.100
That said, um, after the initial, uh, uh, facing, two weeks after, we were, we were able to draw this diagram.

07:57.020 --> 08:06.180
Um, this was created by my team and, and myself and it's a much more complex diagram and contains many more steps than what we initially thought happened.

08:06.760 --> 08:11.420
I probably look like this with the slides behind me, with everything with all the arrows.

08:11.420 --> 08:20.300
So, instead of where we started this quest, uh, which is from the highlighted part of this diagram, in this talk we will actually start from the beginning.

08:20.900 --> 08:23.540
We, we will start from the attacker's position.

08:23.560 --> 08:35.880
By doing so, I'll be able to explain the TTPs in a constructive and progressive way and we'll be able to draw the complete events timeline in a coherent and continuous way and I hope things will make sense.

08:36.340 --> 08:44.160
Uh, once done, I'll discuss what tools we've utilized in order to be able to recline that tree and draw everything that you saw on the diagram.

08:46.320 --> 08:48.000
Thank you for the other hall.

08:48.720 --> 08:50.360
Um, so let's clear the board.

08:50.360 --> 08:53.000
Uh, we will use the diagram as our quest map.

08:53.980 --> 09:03.460
And at the bottom, between each movement of the attacker that I'll highlight in the quest map, um, I'll display a timeline and we'll put a point on each, for each event.

09:03.600 --> 09:06.740
Um, we can actually start and add what we already know.

09:06.740 --> 09:11.880
This is March 14th, 2025, the mass credential leakage, that's on the right hand side.

09:12.000 --> 09:16.280
Um, let's put our attacker on the board, they're going to be on the left hand side.

09:16.740 --> 09:21.900
And now let's see how the attacker finally reached the TJ Actions repository.

09:23.260 --> 09:27.920
First move by the attacker, compromising the spot bugs organization.

09:28.080 --> 09:30.700
This is the first move, this is what initiated everything.

09:30.700 --> 09:31.940
Let's see what they did.

09:32.040 --> 09:39.560
In order to do this step, the attacker employed, uh, a TTP called pawn request, a poison pipeline execution.

09:40.160 --> 09:44.660
And this is when an actor can run unauthorized code in your CI machine.

09:44.720 --> 09:47.460
Um, basically a CIRC if you want.

09:47.680 --> 09:49.840
So, let's visualize that.

09:49.840 --> 09:53.240
And there are many options, so I'm going to show you the one the attacker employed.

09:53.240 --> 09:59.900
Assuming you have this, uh, GitHub setup, you have your GitHub, uh, Actions CI setup and you have your repo, repo A.

10:00.700 --> 10:04.320
And let's also assume that somebody forked your repo.

10:04.540 --> 10:08.280
Then this is their position now, the attacker's repo.

10:08.440 --> 10:18.940
Um, from this point there are again many variations to perform a pawn request, but what our attacker did was create a malicious commit inside the fork and create a pull request.

10:18.940 --> 10:25.540
In response, the victim's CI got triggered and executed.

10:25.580 --> 10:32.640
Now, during the vulnerable execution of the CI workflow, it checked out the code from the forked repo.

10:32.640 --> 10:34.240
This is because of misconfiguration.

10:34.240 --> 10:36.980
This is the specific variation of pawn request.

10:37.380 --> 10:40.860
And executed the malicious code in its context.

10:40.860 --> 10:51.860
And now you have a malicious code executed in the context of a victim's repository and you could do many things, like in our case, exfiltrate all the secrets that are accessible to this machine.

10:52.360 --> 10:55.720
Let's see this TTP, uh, employed by our attacker.

10:55.880 --> 11:05.480
Um, so using this technique, the attacker targeted a vulnerable GitHub Actions workflow in an organization called Spot Bugs, specifically in a repository called Sonar Find Bugs.

11:06.540 --> 11:11.620
Here we can see the pull request of the malicious, uh, commit that the attacker created in their fork.

11:11.620 --> 11:20.280
Uh, all the attacker actually did was introduce a single line change inside the Maven W file, uh, which was later executed in this- in the CI workflow.

11:20.400 --> 11:34.680
Um, in the change we can see a curl to- to fetch a bash script, um, from the attacker's repo, piped to bash for execution, everything is being- all the STD out, uh, STD are being redirected to DevNow, so everything is muted as well.

11:34.780 --> 11:36.320
Um, and that was it.

11:36.320 --> 11:38.240
That's all the attacker had to do.

11:39.340 --> 11:44.000
Now this event took place in December 6th, 2024.

11:44.120 --> 11:48.940
That is more than 3 months prior to what we were told about the TGActions incident.

11:50.440 --> 12:01.220
And the result of this exploitation was a personal access token, a PAT, uh, of a maintainer, Spot Bugs maintainer, that the attacker was able to leaked- to leak, sorry.

12:01.660 --> 12:09.060
Um, I'll mention that if a PAT, uh, gets stolen as long as the owner does not revoke it, it's acce- it's, like, usable.

12:09.060 --> 12:13.520
It contains- it contains all the permissions the owner gave the PAT.

12:13.520 --> 12:19.160
And throughout this attack, this token was accessible to the attacker because the owner just didn't know.

12:19.180 --> 12:21.480
So we have this PAT in hand.

12:22.220 --> 12:23.980
Let's pop back our diagram.

12:23.980 --> 12:28.500
Here's our attacker, and here's the Sonar Find Bugs, uh, repository.

12:30.560 --> 12:38.880
And since the attacker collected a PAT by exploiting the pipeline like we just saw, the attacker now have admin access to Spot Bugs organization.

12:39.060 --> 12:49.580
Do note that the stolen access token had access to more repositories than what is shown on the screen, but I am only showing the repositories that took place throughout this attack.

12:50.540 --> 12:52.100
Let's see the timeline.

12:52.240 --> 12:56.860
Um, so we had on the right hand side March 14th, match cred- mass credential leakage.

12:56.860 --> 13:01.000
And on the very left hand side, we have Spot Bugs getting compromised.

13:01.940 --> 13:03.340
Let's move on.

13:03.980 --> 13:07.940
The second step of the attacker was recon and waiting.

13:09.660 --> 13:20.440
In the time following the attacks on Spot Bugs, the attacker used the stolen PAT they obtained for sniffing around and checking what other organizations and repositories they could access using that token.

13:21.600 --> 13:27.620
We only know that because of the help we got from the maintainer of Spot Bugs who was kind enough to share their activity log with us.

13:27.960 --> 13:32.060
Um, and I'd like to share something interesting that we could draw.

13:32.060 --> 13:37.800
So, um, actually it was deleted so I wouldn't share that.

13:37.800 --> 13:41.740
But here's an example of one of the things the attacker was able to find.

13:42.460 --> 13:51.120
Um, inside a repository Spot Bugs Spot Bugs, uh, which the attacker can now control using the stolen PAT, existed another interesting PAT.

13:51.120 --> 14:04.220
The attacker found out that there was another Spot Bugs maintainer and not the previously mentioned one, which had their own PAT being used as a secret for the GitHub Actions Workflows of Spot Bugs Spot Bugs.

14:05.300 --> 14:12.880
What made this specific PAT interesting to the attacker is that this maintainer was also a maintainer of another organization.

14:14.000 --> 14:16.940
And this organization is called Review Dog.

14:17.680 --> 14:18.820
Remember that fact.

14:18.820 --> 14:20.780
We're going to meet that in a second.

14:22.440 --> 14:26.020
And, thank you.

14:26.380 --> 14:31.000
And for the second step phase of step two, all the attacker did was to wait.

14:31.180 --> 14:35.380
Um, the attacker didn't exploit anything or perform any known lateral movements.

14:35.380 --> 14:39.200
Uh, although they technically could, they had the credentials, but they didn't do anything.

14:39.920 --> 14:45.380
And three months after that, after the compromise of Spot Bugs, the right target showed up.

14:45.380 --> 14:46.980
The whale surfaced.

14:47.640 --> 14:50.320
The attacker waited and waited.

14:50.840 --> 15:00.560
And then, on March 7th, a Coinbase maintainer pushed a GitHub Actions Workflow that utilized the TGAction change files repository.

15:01.500 --> 15:05.260
And that is when our attacker started moving and moving fast.

15:05.260 --> 15:13.660
In practice, the attacker moved so explicitly and boldly towards that Coinbase repository that they were basically admitting along some other IOCs.

15:13.660 --> 15:16.360
We will see indications of compromise we're going to see ahead.

15:16.360 --> 15:20.400
Uh, that Coinbase was the only thing that they were interested in throughout this attack.

15:21.120 --> 15:24.240
Let's put this date as well in our timeline.

15:24.240 --> 15:26.900
And this is March 7th, 2025.

15:27.340 --> 15:29.180
Coinbase becomes vulnerable.

15:31.000 --> 15:32.620
Now for the fast movement.

15:32.620 --> 15:36.020
Step number 3, lateral movement into the Review Dog organization.

15:36.940 --> 15:44.080
Uh, as I just showed you, during the recon phase, the attacker found out about the path of the Review Dog maintainer existing within Spot Bugs.

15:44.180 --> 15:48.720
Um, this token was the, the key into moving into Review Dog.

15:48.780 --> 15:53.580
And in order to exfiltrate this new path, the attacker had to interact with the code base.

15:53.580 --> 15:57.300
This is because they can't just use the path they stole to access to GitHub.

15:57.420 --> 15:59.400
Um, they can't just, it doesn't work like that.

15:59.400 --> 16:01.540
They can't click and view the secrets.

16:01.540 --> 16:03.220
GitHub hides that on their UI.

16:03.240 --> 16:06.340
So the attacker had to extract the token in a different way.

16:07.260 --> 16:14.220
Now, obviously, since the attacker had write permissions to Spot Bugs, they could simply push a malicious workflow, right?

16:14.220 --> 16:15.120
They had, they could do that.

16:15.120 --> 16:16.240
They had write permissions.

16:16.240 --> 16:18.120
And it would exfiltrate the token.

16:18.400 --> 16:20.700
But such a push makes a lot of noise.

16:20.700 --> 16:32.220
So, if the attacker would do that, they would have either push a new branch with a commit, which makes a lot of noise, or push a commit to another branch, which also, which also makes a lot of noise.

16:32.340 --> 16:34.400
So, what did they do here?

16:34.400 --> 16:35.440
Let's see that.

16:39.260 --> 16:40.080
Yup.

16:41.900 --> 16:45.860
TTP number 2, this is, uh, memberships and disposable users.

16:45.880 --> 16:49.320
So, this was the attacker's solution for this, uh, situation.

16:49.320 --> 16:56.380
In order to stay under the radar and not, uh, raise suspicions, the attacker created a dummy user, uh, called Juka of Avak.

16:56.380 --> 17:00.680
Um, I'm only mentioning that because, at the time, I tried to find what the hell that means.

17:00.700 --> 17:02.200
Something anime, I believe.

17:02.200 --> 17:04.160
But I wasn't able to decide on that.

17:04.300 --> 17:08.800
Um, and they invited this user to be a member of the Spot Bugs, Spot Bugs repository.

17:09.900 --> 17:17.160
Using that user, the attacker pushed a branch with a commit containing a malicious workflow that exfiltrated the said path.

17:17.440 --> 17:23.200
And once the workflow was triggered, the Juka of Avak user deleted itself and the branch.

17:24.580 --> 17:27.720
Now, this may be a bit complex.

17:27.720 --> 17:29.560
Let's see that, uh, visualized.

17:30.220 --> 17:38.000
So, we have, we're gonna use a sequence diagram we have in the, on the top, uh, the attacker, Juka of Avak, and the Spot Bugs, uh, Spot Bugs repository.

17:38.000 --> 17:43.040
We have step nu- 1, the attacker invites as a member the user.

17:43.040 --> 17:51.080
Um, step number 2, Juka of Avak, basically the attacker pushed a branch with a malicious workflow to Spot Bugs.

17:51.080 --> 18:00.920
Um, the CI of Spot Bugs kicks in, executes the malicious commit, and roughly the same time, Juka of Avak deletes the branch and itself.

18:02.900 --> 18:05.120
Um, let's see the artifacts of that.

18:05.120 --> 18:08.340
What we have here is the activity log, uh, of Spot Bugs.

18:08.340 --> 18:10.100
This is public, you can check it afterwards.

18:10.320 --> 18:14.740
Um, and we can see that a branch was created and deleted.

18:15.720 --> 18:20.700
We can see at the top the branch name, this is just gibberish, whatever Herber Kerber, whatever that means.

18:21.040 --> 18:28.280
Um, and if we would inspect the timelines, we will see the, uh, sorry, the time stamps of these, uh, events, we will see that they happened within the same minute.

18:28.280 --> 18:30.020
So pretty fast movement.

18:31.400 --> 18:34.780
This is the malicious workflow that the attacker pushed.

18:35.660 --> 18:42.740
If we zoom in, this is the workflow's trigger, so basically on push to this specific gibberish branch.

18:43.180 --> 18:51.660
Um, and the rest of the, uh, the workflow, the payload may seem a bit fancy, we're going to break that down, but it's pretty standard in the exfiltration world.

18:51.660 --> 18:52.640
Let's take a look.

18:52.640 --> 18:59.400
So at the top we have the attacker taking all the secrets that are available, um, to the machine and strigify them.

18:59.460 --> 19:07.460
They move on to generate an asymmetric AS key, encrypt this, um, encrypt the file with the secrets.

19:08.080 --> 19:16.200
And they move on to, uh, encrypt the encrypted secrets and the key with their own, uh, uh, public key that they hardcoded.

19:16.200 --> 19:21.140
And they uploaded this whole thing as a GitHub artifact so they can download it after.

19:21.200 --> 19:26.300
Now since everything is encrypted, even if you would see that online, you wouldn't be able to decrypt that, right?

19:26.300 --> 19:29.600
So this is how it's being done in the GitHub world.

19:30.840 --> 19:49.920
Um, now not only the attacker by exploiting this workflow, not only the attacker obtained the new path and was able to move laterally now into ReviewDog, by performing, uh, the exfiltration using this technique, the attacker left minimal footprint which made detecting the exfiltration a lot harder.

19:50.700 --> 19:52.700
Let's go back to our quest map.

19:52.700 --> 19:54.800
This is where we left our attacker.

19:54.800 --> 20:04.060
They can access pod bugs and, uh, in the newly highlighted part we can see what our attacker did using the dummy user and the malicious workflow they pushed.

20:04.560 --> 20:13.080
And once the deed was done, a new access token was obtained, a path for ReviewDog and the attacker's domain expended.

20:13.260 --> 20:17.260
I really hope someone is catching that, that reference, but yeah.

20:17.460 --> 20:27.860
Um, anyways, now in the highlighted part we can see the new options that the attacker unlocked and we can see on the right hand side the ReviewDog action set up repository and that the attacker can access it.

20:27.860 --> 20:32.480
Again, the attacker could access many other repositories but this is the one that mattered.

20:33.240 --> 20:35.500
Let's move on to the next step.

20:37.020 --> 20:42.640
Step number 4 of the attacker, lateral movement into the TJ actions organization.

20:46.570 --> 20:54.850
Okay, so this is the attacker's current position and as I just said the attacker is about to move into the TJ actions organization.

20:55.530 --> 21:13.470
Highlighted in blue, uh, you can see a dependency chain that the attacker is about to compromise where we can see that ReviewDog action set up is a dependency of an action called TJ actions ESLint changed file which is used in the repository TJ actions changed files as an action.

21:13.750 --> 21:28.550
Um, I remind you that the attacker already have an access token to the ReviewDog, um, and again they could just push a malicious commit , um, and infect this whole chain but instead they did something different.

21:28.550 --> 21:34.910
The attacker employed, uh, very interesting technique here which in my opinion is the most interesting one throughout this whole attack.

21:34.910 --> 21:39.390
Um, and it is, it is abusing one of GitHub's core, core features.

21:40.410 --> 21:42.230
Let's see what the attacker did.

21:42.790 --> 21:48.390
TTP number 3, um, we're gonna give it another name in a second but for commits and git tags.

21:49.150 --> 21:56.470
So on GitHub when a repository is forked, uh, it is added to the so-called fork network of the original repository.

21:57.330 --> 22:02.110
However, this is a GitHub feature, not a git feature.

22:02.110 --> 22:04.610
Git doesn't have forks, it has branches.

22:04.850 --> 22:12.690
So behind the scenes , forks are pseudo-branches or whatever it was wrapped in in the GitHub backend but it's just a branch.

22:13.110 --> 22:21.350
So a residual artifact of that, um, is that commits that were pushed to a fork are accessible from the main repo.

22:21.550 --> 22:32.890
Okay, so you can go afterwards and check it, um, make a fork , get your own repo and try to access a shaft from that fork and you'll be able to see that from your main repo.

22:33.910 --> 22:46.390
Um, now this when combining it with git tags is an interesting thing but I just want to add that in other words, committing to a fork is equivalent to pushing a branch to a repository you don't own.

22:46.390 --> 22:49.030
The code doesn't do anything but it's there.

22:50.550 --> 22:52.750
Let's combine it with git tags.

22:52.750 --> 23:02.770
So when combined it creates an interesting behavior if you are, don't remember, you don't remember for some reason git tags are just pointers to commit shafts.

23:02.770 --> 23:15.690
Um, so assume in this, this uh, main branch, assume this uh, consider this main branch on some repository and let's assume that it was forked and a malicious commit was pushed to that fork.

23:17.590 --> 23:27.330
According to what I just said, uh, about the commits inside forks, in GitHub all of these are roughly in the same, you can say in the same context, in the same repo's context.

23:28.610 --> 23:41.630
So with respect to git tags, if I have a git tag pointing to a commit shaft, for example, commit to, as seen in the diagram, nothing stops me from making that tag point to a commit from a fork .

23:45.300 --> 23:49.220
This TTP is a well thought one actually because it achieves two things.

23:49.360 --> 23:54.340
One, no commit noise , nothing was pushed to the repo, complete silence on that end.

23:55.320 --> 24:08.560
And second one, this is a GitHub audit log blind spot, it does not get logged there and without uh, like help from GitHub support, which they can obviously give you the ref logs, the git ref logs, without them doing that, you won't be able to see these events.

24:10.940 --> 24:17.060
So the attacker utilized this technique multiple times in the steps ahead and we're gonna refer to them as shadow commits.

24:17.540 --> 24:19.220
And let's see them in play.

24:20.900 --> 24:28.400
So back to our di- to the diagram and the about to be exploited dependency chain, let's remove the highlighted part and make the attacker earn it.

24:29.560 --> 24:38.540
So for this step, the attacker created a fork of the review dog action, the action set up repository like we saw happens in the shadow commit TTP.

24:39.620 --> 24:42.680
And then they pushed the following commit to it.

24:42.720 --> 24:44.360
This is that commit.

24:44.360 --> 24:50.420
Um, it's another weird looking uh, user name, ILM, whatever we used to call that earmon during the investigation.

24:50.460 --> 25:02.120
And we actually um, yeah we actually used to call it earmon and if we'll expand that diff, we'll see a base 64, a base 64 uh, encoded uh, string which decodes the Python program.

25:02.120 --> 25:03.180
You're gonna see that in a second.

25:03.180 --> 25:05.140
And some script underneath that.

25:05.140 --> 25:06.480
Uh, let's look into them.

25:06.480 --> 25:09.940
This is the same diff with the Python base 64 decoded.

25:10.460 --> 25:11.420
Let's zoom in.

25:11.420 --> 25:13.220
Here we can see the Python script.

25:13.220 --> 25:19.140
Um, it's a bit small but I'll tell you that uh, it is looping over the proc FS file system.

25:19.140 --> 25:24.640
Um, it extracts the maps and the memory of the processes it found.

25:24.880 --> 25:29.220
And down the line it basically prints them to the standard output.

25:31.280 --> 25:37.280
Now on the second part of that script we can see the snippet obviously decoding the base 64 which I've done for this talk.

25:37.280 --> 25:45.980
Um, writes it to a file, makes Python executed, takes the outcoming STD out, pipes it, does some filtering, some clean ups.

25:45.980 --> 25:48.620
Um, and prints it to the log.

25:49.020 --> 25:56.120
Now this may be a spoiler but this is pretty much the same code that later landed in the 23,000 repos.

25:58.320 --> 26:02.520
So once our attacker had this commit in place, we're in the shadow commits TTP.

26:02.520 --> 26:09.440
Once their commit was in place, they override the tag V1 of review dog action setup making it point to their malicious commit.

26:09.440 --> 26:10.760
We can see that highlighted.

26:11.140 --> 26:13.160
And let's put that as well in our timeline.

26:13.160 --> 26:14.220
This is an important event.

26:14.220 --> 26:16.620
This was March 11th, 2025.

26:18.920 --> 26:25.640
By doing the override step, our attacker poisoned the V1 tag of the review dog action setup with minimal footprint.

26:27.120 --> 26:40.540
And per our chain, since TGAction's ESLint change files was referencing the V1 tag of the action setup repository, it was now infected as well and was shipping the malicious code to its consumers.

26:41.420 --> 26:46.420
Among its consumers, the repository TGAction's change files was a consumer of it.

26:46.480 --> 26:49.680
Um, and this action ran as a part of its CI.

26:50.200 --> 26:52.740
Now, this didn't happen yet.

26:52.980 --> 26:58.200
TGAction's change file wasn't compromised yet, but the attacker was staged to do so.

26:58.200 --> 27:00.600
So all they had to do now was wait.

27:01.180 --> 27:09.560
Um, and we know that the tag was pushed on 642 PM UTC on, um, March 11th.

27:09.700 --> 27:16.600
And we found out that the tag was reverted to its previous value by the attacker, of course, less than 2 hours after the infection.

27:16.600 --> 27:25.200
That was 831 PM UTC, basically marking that the attacker was now inside TGAction's and they didn't need the review dog infection no more.

27:29.000 --> 27:41.920
Alright, since TGAction's change files ran the malicious code, the CI picked it up and ran the malicious code, all the secrets that were present on that machine, um, were leaked and compromised, were leaked to the attacker and compromised.

27:42.080 --> 27:50.180
And by that, our attacker obtained another set of access tokens with permissions and this time, 2 TGActions.

27:53.890 --> 27:57.950
Let's put this event in our timeline as well and let's move on.

27:58.430 --> 28:03.990
This is still March 11th and TGAction gets compromised originally.

28:05.190 --> 28:13.790
With our attacker staged at TGAction's change files and with full control over it, it was time for the attacker to infect the actual target.

28:15.050 --> 28:16.330
Coinbase.

28:18.070 --> 28:18.850
So the attacker had to infect the target.

28:18.850 --> 28:25.570
If you're unfamiliar with Coinbase, Coinbase is a NASDAQ traded crypto platform, uh, with a market cap of 106 billion dollars.

28:25.570 --> 28:27.950
Suddenly this attack makes sense.

28:27.950 --> 28:37.510
Um, it allows users to buy, sell and store digital assets like Bitcoin, Ethereum, whatever coins, um, using self-made tools like the highlighted repository agent kit.

28:37.510 --> 28:43.230
Specifically, this repository is described as every AI agent deserves a wallet.

28:43.550 --> 28:46.890
If you'd like to hear my rant about AIs, come meet me later.

28:47.410 --> 28:55.050
Um, so this repository, as I said before, was using TGActions change files, um, and that was the target of our attacker.

28:55.050 --> 28:56.270
Let's see what they did.

28:56.550 --> 29:04.950
Using the same TTP of shadow commits, the attacker created a fork of the repository TGActions change files and overrode the tag V39.

29:05.850 --> 29:07.230
This is highlighted.

29:07.230 --> 29:16.210
Um, this event takes place on March 13th, 2 days after the review dog infection and less than a week after Coinbase got into a vulnerable position.

29:16.350 --> 29:17.750
Let's add that as well.

29:21.050 --> 29:26.230
This is the commit the attacker made, um, throughout the, uh, shadow commits TTP.

29:26.230 --> 29:34.270
Uh, we can see highlighted, um, again, uh, a curl bringing some script and then later being executed by Python.

29:34.310 --> 29:39.170
But what's more interesting here than this payload is the smoking gun.

29:39.170 --> 29:50.210
We can see here the attacker explicitly and hardcoded the name of Coinbase and said to the machine, if you're not in Coinbase and there's an or if you see there, the or is to one of these dummy users.

29:50.210 --> 29:53.950
So if you're not in Coinbase or in my place, you execute.

29:53.950 --> 29:59.490
So even if you would use one of the malicious versions, if you're not Coinbase, you wouldn't get the impact.

30:00.490 --> 30:03.170
But that is a nice smoking, uh, gun.

30:03.850 --> 30:10.550
So with a committed tag in position, our attacker again had to wait for a CI machine of Coinbase to pick it up.

30:11.530 --> 30:13.350
And eventually it happened.

30:14.110 --> 30:26.770
On March 14th, 310 PM UTC, a CI machine of Coinbase picked up the malicious action and the credentials and secrets that were present on that machine got leaked to the attacker.

30:28.350 --> 30:29.810
Let's add that to the timeline.

30:29.810 --> 30:32.890
I decreased the size of the previous events to make some room.

30:33.230 --> 30:37.030
Um, and let's look at some indications of compromise.

30:38.710 --> 30:43.750
This is how the CI log of the infected machine of Coinbase looked like.

30:44.170 --> 30:54.370
Um, we can see in the upper right, uh, the permission execution had like, uh, write permissions for deployments or contacts, contents, which implies you can write to the repo.

30:54.590 --> 31:08.410
Um, and in the lower highlighted part, you can see that the shell of the malicious commit, um, the malicious commit the attacker made, you can see that it was fetched when the, uh, when the Coinbase machine tried to fetch V39.

31:08.510 --> 31:15.030
So instead of getting the actual V39 commit that was pointed to, the machine got the malicious version.

31:16.230 --> 31:28.630
Back to our attacker, after about an hour after Coinbase got compromised at 437 PM, Coinbase was notified that there is some suspicious activity in their CI pipeline.

31:29.970 --> 31:36.850
And they immediately identified that it was coming from the TJ Actions usage and removed the workflow that used TJ Actions.

31:37.610 --> 31:42.030
And at once, the link our attacker was building towards was deleted.

31:43.370 --> 31:46.070
Coinbase was no longer accessible for our attacker.

31:46.250 --> 31:53.350
Now, we assume the attacker noticed that the link was deleted because this is a great segue to what we're going to see next.

31:54.870 --> 32:01.090
Twenty minutes after the attacker lost the link to Coinbase, they decided to go all out and burn the field.

32:01.090 --> 32:04.350
They basically Leroy Jenkins'd everything we're going to see.

32:05.870 --> 32:26.730
On March 14th at 457 PM, the attacker performed the last shadow commit maneuver and the attacker overruled most, if not all of the commit, the attack, sorry, of TJ Actions change files, made them all point to the malicious commit they created with the secret logger that I showed you before that was printing to the logs.

32:28.170 --> 32:35.070
By doing that, the attacker basically nuked everything and we are arriving to what we learned to know as the TJ Actions incident.

32:35.070 --> 32:39.310
Again, as you saw, this was just the tip of the iceberg of this thing.

32:39.670 --> 32:50.150
And it took us some time but we were able to track the steps of this attacker, draw the complete attack flow diagram and I hope it was clear and I'll stop seeing comments like this on Reddit.

32:55.400 --> 33:01.560
So I'm aware this is a lot to digest and let me show you some pictures from behind the scenes.

33:01.560 --> 33:05.060
This is how one of the boards in our office during the investigation.

33:05.300 --> 33:15.900
Um, this is my personal notepad where you can see some classic uh, coffee stains on the left hand side and was few uh, all-nighters, fun times, great CTF honestly.

33:16.360 --> 33:20.920
Um, and let's go over the TTPs and put them in a list so we can understand what exactly happened here.

33:20.920 --> 33:22.460
So list of TTPs.

33:23.420 --> 33:32.560
Um, we got one, shadow commits abusing GitHub's fork network in order to introduce code changes to a repository's context without making actual commits to it.

33:32.560 --> 33:39.460
We got two, tag overrides abusing GitHub's audit log blind spot and silently redirecting consumers to different commit SHAs.

33:39.740 --> 33:51.680
We have three, the disposable members uh, where the attacker made the noise be associated to a disposed user and last and not least, upon request, RCNCI workflows due to various misconfigurations .

33:53.020 --> 33:58.100
Now, towards the end we're getting there, I want to share how we conducted this investigation.

33:58.100 --> 34:04.280
So as I said, we began here in the highlighted part and we had to climb back this whole chain and find all the evidence.

34:04.280 --> 34:06.020
So we've used the following tools.

34:06.020 --> 34:09.700
Uh, we heavily utilized the GitHub events data set on Clickhouse.

34:09.980 --> 34:17.780
Um, this is, if you're unfamiliar, a great SQL queryable tool based on the Clickhouse infrastructure, blazing fast, free.

34:17.800 --> 34:21.800
Um, but however it doesn't always contain all the information that we needed.

34:21.900 --> 34:27.180
So in order to get a better resolution and sp- at specific points, we've used the GitHub archive.

34:27.180 --> 34:32.080
I said it was referenced here yesterday in one of the talks, so it is a great tool apparently.

34:32.200 --> 34:37.620
Um, it allows you to download the logs of most GitHub events in a resolution of one hour.

34:37.620 --> 34:39.760
Um, comes in handy in cases like this.

34:39.760 --> 34:41.120
Thank you for that project.

34:41.280 --> 34:48.940
Um, and in addition we communicated to all- with all the involved maintainers and they were very kind and helped us draw the picture of this attack as we saw today.

34:48.940 --> 34:50.000
Great community.

34:50.620 --> 34:58.320
Uh, one shout out I would like to make is to Adnan Khan who tweeted this amazing lead, uh, during the investigation.

34:58.320 --> 35:03.740
Uh, there was a lot of discussions on- on X during the investigation and this was a great breakthrough.

35:03.780 --> 35:16.080
Um, I know Adnan is not in the crowd now- right now because he's giving a talk at 1 PM, um, on the creator stage 5 about- alongside looping about advanced offensive strategies in the supply chain, uh, ecosystem.

35:16.080 --> 35:17.600
I highly recommend that one.

35:19.240 --> 35:21.820
Now for additional victims and impact.

35:21.820 --> 35:34.160
Um, we observed that the attacker tested various payloads against a fork of Ultralytics and that was done 4 days, um, sorry 3 days after Ultralytics was breached on December 4th, 2024.

35:34.160 --> 35:36.620
We saw the attacker was testing with some payloads.

35:36.620 --> 35:40.880
Um, but we didn't find any impact although we saw the payloads.

35:41.280 --> 35:45.800
At the same- in the same fashion, the attacker played with a fork of Apache Superset.

35:45.800 --> 35:51.800
Uh, this is a data visualization- visualization framework, uh, 67.3K stars on GitHub.

35:51.800 --> 35:54.360
Uh, yet again we didn't find impact.

35:54.360 --> 35:55.440
We didn't detect.

35:56.180 --> 36:05.280
That said, the next repo, Model Federation, uh, core which is according to them, concept that allows developers to share code across multiple JavaScript applications.

36:05.340 --> 36:15.420
Um, we did see the infrastructure for the shadow commits, uh, being done, being made but we didn't see any logs and indications of compromise.

36:15.420 --> 36:18.140
So we did see the things but we weren't able to confirm that.

36:18.140 --> 36:19.420
So we're uncertain.

36:19.960 --> 36:33.400
And for the last repo, uh, by Baidu BC which is a one stop shop for AI native applications, uh, we were able to detect malicious pull requests and we know for a fact that their pipeline was compromised.

36:35.870 --> 36:39.490
Quick words about mitigation, um, here's the list again.

36:39.490 --> 36:40.530
Let's go one by one.

36:40.530 --> 36:46.670
So shadow commits, if you have forks allowed in your repo, you are opted in, nothing you can do.

36:47.190 --> 36:52.610
Um, tag overrides, you'd be happy to hear that GitHub is testing with immutable releases and tags.

36:52.610 --> 36:59.170
Um, this feature means that once you make a tag or release, they're uh, immutable, they're pointers and they will be immutable.

36:59.170 --> 37:02.770
Uh, this may be GitHub's take away from the post-mortem of this.

37:02.830 --> 37:11.190
Uh, I only know this because I stumbled across this LinkedIn post by a GitHub product manager, says she's in charge of the supply chain security at GitHub.

37:11.730 --> 37:14.910
Uh, you have at the bottom the QR to go to that uh, post.

37:15.110 --> 37:22.310
And in one of the comments she made, I found a link she shared to a gist of hers with details and specs of the immutable releases feature.

37:22.410 --> 37:27.290
Uh, the moment I saw it was marked as a secret, I forked it and you can access it here.

37:29.130 --> 37:30.230
Why not?

37:31.310 --> 37:36.530
Um, paired upon request, this is a well-covered topic in various uh, ecosystems.

37:36.630 --> 37:42.510
This is a little , a list of tools um, that can help you audit the uh, your pipeline basically.

37:43.030 --> 37:49.530
And the last mitigation advice here would be to stop the bad practice of using Git tags as Git, in GitHub Actions.

37:49.530 --> 37:52.350
It was covered previously many times.

37:52.710 --> 37:56.790
Most of the community still does that so thank you Biden, don't use that.

37:56.790 --> 38:01.490
And instead, prefer a 40 char Git sha, a complete one.

38:02.790 --> 38:10.830
Before I seal this talk with a brain teaser, um, I'd like to thank my colleagues at Power Alternate Networks, to Yaron, Assi, Omer, and Gil.

38:11.030 --> 38:18.190
Thank you for your part in this research and being amazing colleagues 24-7 and I'm annoying as hell so 24-7 was needed for me.

38:20.110 --> 38:23.970
And now for the last outstanding question with this research, of this research.

38:23.970 --> 38:26.130
Something I'd like to send you home to think about.

38:26.650 --> 38:28.930
Let's zoom out and look at the complete diagram.

38:29.010 --> 38:32.010
Uh, we saw that the attacker executed a well-planned attack.

38:32.030 --> 38:33.810
Uh, they had time during the execution.

38:33.810 --> 38:36.090
They used various techniques while executing it.

38:36.090 --> 38:39.390
Some are more impressive than others, I agree, but still various TTPs.

38:40.570 --> 38:45.250
And they moved very fast once Coinbase was vulnerable, right?

38:48.700 --> 39:05.960
Now, with respect to that, given that this was the final exploit of the attacker, an open source Python memory dumper that simply logs to the console and gets downloaded on each CI machine that is infected, um, that makes a lot of noise.

39:05.960 --> 39:10.060
They didn't make the script call home at the final exploit like they did on Coinbase.

39:10.060 --> 39:11.080
They could have, they didn't.

39:11.080 --> 39:12.880
They did make the network noise though.

39:13.060 --> 39:17.780
Um, and they didn't double encrypt the stolen credentials like they did for ReviewDog.

39:17.780 --> 39:19.760
They could have, they chose not to.

39:20.620 --> 39:25.780
Instead the attacker simply printed the secrets to the logs of 23,000 repos.

39:25.780 --> 39:32.200
That's a lot of credentials, a lot of potential money, um, and a lot of potential further lateral movements.

39:32.200 --> 39:34.680
Instead the attacker printed it to the logs.

39:35.080 --> 39:54.360
Logs are noisy, downloading, downloading in your CI stuff is noisy, so my question with respect to this whole research is why did the attacker choose to make that noise?

39:54.920 --> 39:57.560
The attacker eventually pushed a commit.

39:57.560 --> 39:58.420
It was a decision.

39:58.420 --> 39:59.980
It was an active thing.

40:00.300 --> 40:02.600
Um, why would they do that?

40:02.620 --> 40:04.860
Was this decision made by mistake?

40:04.900 --> 40:15.280
Um, the attacker was nervous about getting caught and bailed or they didn't have a proper exfiltration in place so they were unprepared for that masses of credentials?

40:15.740 --> 40:19.340
Um, we saw the TTPs, it doesn't really make sense.

40:19.460 --> 40:20.920
Or was it on purpose?

40:20.920 --> 40:22.300
They purposely tripped the wire.

40:22.300 --> 40:23.300
They made the noise.

40:23.300 --> 40:25.400
Um, what would be the reasons for that?

40:25.420 --> 40:29.860
Was that in order to make GitHub su- uh, stampeded GitHub support?

40:29.940 --> 40:37.080
Um, getting 25,000 Zendesk tickets can kill someone so maybe they just wanted to blog GitHub support?

40:37.640 --> 40:43.680
Or maybe it's an upcoming APT just trying to gain some street cred but then we're lacking the attribution.

40:43.680 --> 40:46.420
They didn't post anywhere who they are.

40:46.840 --> 40:59.680
So, these are open and there's another hypothesis saying what if there is a buyer and a seller here where the bu- where the seller found this Spotbugs token, sold it, and the second actor was not as professional.

40:59.680 --> 41:08.080
We did see, uh, a breach forums, uh, post on that, on the, on the pun request TTP, specifically mentioning, uh, Ultralytics by the way.

41:08.180 --> 41:12.340
Um, and that was the same month Spotbugs was exploited.

41:12.340 --> 41:13.760
So maybe it's related.

41:15.800 --> 41:21.200
So, the last outstanding for me, and that is my final slide, so, heh, thank you for your time.

41:21.200 --> 41:25.160
Um, the last outstanding question for me is, why?

41:25.840 --> 41:27.260
Why would you do that?

41:29.540 --> 41:40.380
Um, here's a link to our complete article regarding this incident, more IOCs, uh, more information, more complete timeline, how we exactly traced it back because tracing it back was a bit more confusing and long.

41:40.540 --> 41:48.200
And I would like to thank everyone who helped me make this talk, um, especially to my wife, which at this point knows more about TJ Actions than I do.

41:48.840 --> 41:52.320
Um, I was Aviad, find me on X, thank you for your time.

41:53.740 --> 41:54.740
This is it.

41:58.420 --> 42:05.160
Um, if there are any questions, I'll be answering them down here until we get kicked out and then outside.

42:05.200 --> 42:06.220
Thank you very much.

