Yeah, yeah, yeah. What's up? Good to go? Okay. So, hi everybody. Today's talk is called Ohm IDC, where we're going to learn and see how we can abuse IDC set ups in the context of CI. This is extremely exciting for me. That's my first time speaking in the con, so thank you very much for showing up. And thank you very much for having me. That was the first voice breakdown, so it's fine. Okay, by the way, if Adnan and John are here, thank you for the build up. I hope I'll satisfy that. So, I'll present myself. My name is Aviad Hachami. This is my Twitter handler. I do security research at Palo Alto. I do CI domain mainly. I welcome you to check my latest publication. This is Azure CLI information leakage with 8.6 core somehow. But it probably affected all your ASG usages. I also do bug bounty, I DJ, I do graph theory, and FPV drones. Not necessarily in this order. Okay. So, before we go into the agenda, I want to try and convince you why you should listen. So, first thing first, if you are completely new to this world or you have like a rough idea of what OIDC is, I hope you get today the full context of what's up with that, what's up internally, and how does it play. If you're already a user, I hope you're going to learn some pitfalls and misconfiguration. I hope I'm going to save you some weekends. And if you're a bounty hunter, like most of us here, I hope you're going to get some new ideas for exploitation. All right. So, with that, let's go into the overview. Okay. For those of you who are familiar with this topic, hold on tight for a sec. After this, we're going to move into no configs. This is just a word term I set up. I'm going to explain about it soon enough. We're going to move into advanced configurations, misconfigurations, and we're going to learn what happens when the CI vendor makes a misconfig and why do we care about the CI vendor in that context. All right. So, first things first, let's begin with an OIDC overview. So, when I actually rehearsed this talk to some of my friends, some of them are good researchers, I used terms like workflow, job, the CI config, et cetera, et cetera, and they said at some point, this is nice, but I'm not sure how CI works. So, in the case you're like my friend and you slept under a rock for the past ten years, I'm going to show you what CI is in one slide so we can move on. So, extremely quickly, what is CI? Assuming you're a developer, you perform some Git operation, maybe push, pull requests, et cetera, this was pushed to your VCS provider, GitHub, GitLab, you name it, and it was reflected in your online repository. So far, so good. Now, since you've configured your CI provider, because this is what we care about, then the VCS provider notified the OCI provider that something happened using a web hook with payload, nothing special here. In turn, the CI provider spinned a machine for you, it can be any OS according to your configuration, aka workflow. These machines do whatever you want. It can be lints, builds, compilations, and since we're in 2024, they also push to your cloud environments. It can be GCP, AWS, Docker Hub, basically everything out there. This is CI, welcome. So, something I want to emphasize is that those are all split entities, okay? We're going to come into that later on, we're going to show this diagram again, but I want you to remember that these are split entities. Cool. Our problem space is this small arrow, welcome to the OIDC and CI niche. This small arrow, which basically makes us ask an important question, we're in a machine-to-machine world, so how does authentication happen, right? How can we access Docker Hub, for example? An easy answer, right, will be to hard-code your secrets. This is great for my bug bounty, please do that. But, yeah, continue. The second option will be secrets, right? This is a feature by the CI providers, etc. But we all know that at some point or another it's going to leak, right? We're going to see some article saying company whatever was leaked was breached because of a leakage. So we don't want to do that anymore. And then OIDC comes in to help. So OIDC is open identity, this is initials for open identity, something I forgot because I'm stressed obviously, but that's fine. But what I want to emphasize is that it's a simple OAuth extension. I believe most of you know what OAuth is at this point in time. If you're on YouTube and you're not familiar with, pause now, go learn OAuth, come back. Yeah, it's the basics. So OIDC comes in to help and going to help us solve this whole credentials problem and it's going to allow us to use something called identities that we're going to see in a second. So what is this OIDC flow? We're going to learn the vanilla version and then the CI version because they're a bit different. This is just a slide taken from Microsoft. You are all familiar with the try to log in, go to the identity provider, get like the token, come back, exchange it. But now we see something different. Instead of access token and refresh token, we're relying on something called ID token. Welcome. So we're going to learn what ID tokens are in a second, but I just want to plug in some terminology. This is the auth n part, the authentication where you actually put credentials. And this is the auth z part where you actually authorize someone to access something. Regardless of their authentication state, obviously they should be authenticated by this point in time. So ID tokens. Standard JWTs, base 64, we're going to decode them and we're going to get the header which we don't care about for the sake of this talk. I'll just add that this is how you verify the integrity of an incoming ID token, but I'm not going to touch this any further. Don't care symbol. And the second part is the actually ID token body and we're going to dive into the contents of it in a sec, but for the purpose of this slide, I want you to remember that ID tokens, the body of it is a simple dictionary where each key is called claim. So now onwards I'm going to say the token claims something. Okay? Good. So let's conclude the OIDC in the vanilla version of it. It's an OAuth extension and it allows us to rely on short-lived tokens that are based on identity. That's it. TLDR of the whole magic. Right. So let's put it in the context of CICD. If I'm bringing back this small snippet here, right, and I told you this is our problem space, we have two important questions now. First, this is a machine. How does it authenticate? We no longer have credentials. So how do we log in? Second question is, assuming this ID token, how do we verify it? What do we verify it and who does this for us? Okay? So let's address these questions. This is the diagram that you all saw like a few slides ago. And if I'm going to call her back, who's in charge of what? And we see that the only entity that is in charge of the CI machine is the CI provider. Right? So what actually happens behind the scene, and again I'm going to pop up this question, how do we get the credentials? The CI provider reacts in accordance to our configuration. Right? And when we were configured, we were authenticated to the CI provider. So in a sense you can say that when a CI executes, the machine runs on our behalf. Hence, it's associated with our identity. And this is important to remember. A CI invocation is in the context of the owner of the CI integration. So in the context of CICD, the CI vendor also gets to be the identity provider. It's the only one that can give this machine who it is. Okay? Otherwise it's just an ephemeral machine, right? Nobody knows what it is. Like why should I give you access to something? So this is the first question answered. Now the second question was, assuming I do have this ID token, who authorizes this and how exactly? So, I'm going to close the global protect. So, um, I'm going to bring back this ID token and this, the auth Z part is actually composed of 2 components. The first is the ID token and this is an example ID token that is shipped by, uh, GitHub's identity provider. Most of these, uh, examples are going to be on GitHub. I really like you folks. Um, so, and if you look at the contents, you see various claims like, uh, the git sha, the repository name, run ID, et cetera, et cetera. So that's, like, claims. And the most important for us to remember is, to note, sorry, is the sub. Sub short for subject. And this is the default property to assert. When the, uh, basically when we check those claims, it's called assertion, um, and this is the default property to assert. Now, if we actually dissect this for a second, we know the following. The repo, short for repository, contains the value of the repository claim, okay? And the ref, right, the ref prefix contains the value of the git ref coming from the ref claim. So, we can actually see that there's a format behind the scenes and we're going to come back to that later on. So, an ID token, in the context of CI, I'm going to summarize that, contains information about the git event that triggered the pipeline, uh, alongside other vendor information. And we're going to see later on what this other vendor information, where exactly does it bite us. The second part, the second component of the AuthZ, is the something called identity federation. As the name implies, it, uh, it federates identities coming in. Um, this is an example configuration, uh, for AWS specifically. And the file is pretty simple. Um, you have the identity name, just a string, the identity provider, this is usually the URL of it. Um, and then you set up conditions for who can claim to be this identity. Um, then we see what claims we assert, right? We have the sub, does it work? Okay. We have the sub and then we have the odd, odd short for audience by the way. And then we see that there, we can define the comparators, right? We can do string like or string equals and set the values. Okay, so this is roughly, this is how it goes. So, per the question, how exactly do we authorize someone? Then we have this entity called identity federation and it's going to assert tokens claims coming, uh, from, uh, CI machines. In this case, obviously. Alright, so now that we know that the CI provider is also the identity provider, right? This is something new. And we also know that this, uh, we have this federation. Then let's redraw the, the OIDC flow in the context of CI. So in the context of CI, we actually have this diagram. Now the CI provider also gets to be the identity provider. So it hosts both, uh, like both the CI and itself, the identity. And also we see on the cloud provider, we have the federation. So the flow is as follows. You ask for an ID token, you get an ID token, you go to your cloud, you say I want to access. The clouds verify the integrity. This is done using the header. And then it's going to assert the incoming token against its policies. And assuming everything was fine, you're going to get a set of short-lived credentials. This, this microphone hiccups, right? Right? Uh, oops. The mic hiccups. It doesn't work. Roughly. Halfway. Okay. I'll say take care of that. Okay. Um, I'm going to plug back in the terminology. This is the auth N bit. Okay? And this is the auth Z bit. Now, since the flow is different, what does it imply? I'm going to border this square and let's zoom in. Since everything here happens within the CI provider, if we are able to trigger a CI pipeline, we basically granted the owner's identity. Okay? Now, you can limit that using, you can limit that using specific, uh, uh, orders we'll see later on. But if you're able to trigger a CI machine, you're basically passed the auth N part. Okay? This leaves us with the auth Z part to guard everything basically, cause we have the CI machine running. And in a sense, if we're able to trigger a CI pipeline, all that stands between us and accessing a target's resources is just the policy pattern matching, right? So, you can see on the bottom part, examples for, uh, sub-claims. It can begin with repo, a multi-banana Zurich, um, the name of the, uh, uh, repository, the git ref. And on the right-hand side, you can see an example of assertion. For example, repo colon star and where star will expand to everything using pattern matching. Okay? So, this was the summary for, uh, OIDC in the context of CI. This is how it works. This is the whole magic. So, in the context of CI, we can say that it is done by asserting incoming ID tokens from CI machine using an identity federation in exchange for credentials. That's it. Easy. Cool. We can move on to the no configs. And let's have some fun. So, no configs is basically when there is no one at the door. If you think about the auth Z as the bouncer, if the bouncers allows anyone into the club, then anybody can get in, right? So, a no config is a state, uh, where the federator is asserting lax rules, if any. Um, and they will, it will authorize almost any ID token. Okay? What does it mean? So, let's take a look at these three snippets. These are snippets from the identity federation example you just saw, but different assertions. So, the first one, we have, uh, an asterisk, right? Using pattern matching and gonna expand to anything. Obviously, you didn't check anything here. Um, second option, repo column stars. So, everything begins with repo. There's nothing specific to your account here. So, again, you didn't check anything. And the last one is everything that begins with my org and something to note, there's no slash between the org and the stars. So, if you open a GitHub organization called my org one, it will satisfy this as well. Cool. Now, this was already talked about in, uh, in, uh, two talks. One by, uh, Rojan of Tinder and one by Christoph that maybe sits in the audience here. So, hi Christoph. Um, I also talked about it, uh, on the latest, um, b-sides. And basically, I, I really, I highly recommend watching these talks. They explain exactly how those misconfigs look like, okay? And how to hunt for them and how to exploit them. I'm not gonna talk about, uh, when there's no config kind of situation, um, and yes, go ahead and watch them. So, since we're not talking about the no config situation, what happens when I have partial configs? How safe are they, if at all? Let's zoom in. So, the first one we're gonna assert everybody in the org name, right? Repo colon org name. Let's say I can say anybody in Palo Alto can access this identity. Is this okay? Is this safe? What about everybody in Palo with respect to a branch? So, the answer is, the first one is potentially unsafe, so does the second one. We're gonna see later how we can exploit and abuse such cases. And the workflow example is actually the worst. This is very bad. If you configure using the workflow, you're exploited immediately, okay? And we're gonna see how. And another thing you gotta ask yourself, how come this claim begins with workflow? All you've seen was repo colon. How come we're at workflow colon? What happened here? Alright, so let's move to misconfiguration when you do some configurations but they're insufficient. Uh, we're gonna see some pitfalls for advanced configurations including a demo. And then we're gonna see how you can abuse, uh, pipelines. This is partially what Adnan, uh, talked about in the, in the last talk. Um, but we're gonna see how we can abuse lax policies and access, uh, um, various identities. So, misconfigs. We're gonna start with a short demo. Um, and just click here. Okay, so what you see here is a video that was uploaded by, uh, JFrog explaining to their customers how to configure OIDC in front of, uh, JFrog. So you can access the artifactory, x-ray, etcetera. So this is a great feature by the way, nothing bad to say about them. And what we see in this example is how they configure the identity provider on JFrog's side and how they configure the identity. Here we see the example, uh, claims GitHub allows us to rely upon. And we can see on the right hand side that they instruct us to assert workflow equals JFrog NPM. This is according to their video. Alright, um, I'm a naive user. I'm gonna copy paste that, right? Uh, I just learned OAuth and, and OIDC. So, this is me creating the same identity provider at JFrog. Um, just naming it my provider, etcetera, etcetera, nothing fancy, and some arbitrary, arbitrary identity. And I'm gonna do the same instruction. I'm gonna assert that the workflow equals core pre-usable workflow. This is coming from my corporation. Alright. Uh, I'm gonna save it, uh, and then I'm gonna copy the snippet. This is for GitHub Actions. Uh, for those of you who are unfamiliar somehow with this product, this is GitHub's CI. Um, once I saved it, I'm gonna go to my leaking pond repository and I'm gonna create a new GitHub Actions file. I'm gonna commit everything. If you are unfamiliar with how the workflows of GitHub Action looks like, then this is it. This is the recipe. And all you gotta know for the sake of this demo is that assuming a success, the machine invocation as a whole will be successful, otherwise it will fail. So, uh, I've committed the CI reacts to my Git event, so it fires. Um, we're gonna see a machine being run and then we're gonna see that this account, as the video instruct us, was indeed able to access GitHub. Now let's exploit that, okay? We're gonna use this special technique called copy-paste. I'm gonna copy the exact same workflow configuration file and I'm gonna commit it to my own private, uh, uh, account, which I was told that it's not safe to do at DefCon, but whatever. Um, gonna do a special commit message cause it's important for nothing and in reaction the CI will trigger again. Now what we will see, uh, we're gonna go into this logs, we're gonna count 1, 2, 3, worker's gonna pick it up, and we were able to successfully access the same account, right? From a different account. Amazing, magic. What happened? Right? What happened here? On JFrog's end, we defined the identity federation to be something, whatever the name of the provider, but workflow. I'm gonna set the workflow to be corp usable workflow, correct? Good. When my token showed up and said hi, I'm coming from a repository, et cetera, et cetera, and the workflow is called corp usable workflow, so the federation said yeah, it's the same claim, get in. And you gotta ask yourself where is this value coming from? And the answer is, as always, user input. So you can just, this is the name of the workflow, you can put any string there and yeah. So, copy paste for the win. And we can see by showing one example that not all claims are safe, right? I've showed you once, this is sufficient to say that not all are safe. If we look into the RFC of OIDC, then basically we're instructed to have five required claims, issuer, subject, audience, expiration, and issued at, let's translate them to an attacker point of view, the URL of the provider, the target, just a string that you can modify if you have an RC in the case of odd, expiration time for the OIDC token is roughly four minutes and nobody cares when it was issued. On top of these five claims, we have a plethora of other custom claims. These are given by the CI vendors, which get to be the identity providers, right? For example, GitHub supplies with various claims, but all of these are unique to GitHub, right? Repository owner, runner, environment, run number, whatever, whatever, these are all GitHub unique. If we go to Circle, they have their own world, right? Workflow ID, VCS origin, whatever, and GitLab has their own stuff, right? Nobody, like, what's going on? So it adds up to a lot of confusion. If you're a DevOps for a company and you're trying to set up using custom claims, you can get lost really quickly, because you have so many and there's almost zero instructions on which values are safe in this context. So if you'd like to avoid a situation like I just showed, a rule of thumb for using custom claims coming from the vendor is to remember that they're provided regardless of their strength. By strength, I mean how hard they are to fraud. So check where the values come from, okay? Now, a hidden pitfall of this behavior, or this basically behavior, is the custom claim format feature, okay? So as the name suggests, it's a custom format, and it comes to answer a problem where some federators do not assert custom claims directly, like we saw with JFrog asserting workflow. Some just don't want to do that. Why? I don't know. It's just a JSON. But therefore, some identity providers allow reformatting the structure of the subclaim to contain custom claims values, okay? What do I mean by that? Consider the top option. This is what you're familiar with. It begins with repo and then the ref, right? The git ref. But now you can put actor ID, this is in GitHub's world, so now you can put actor ID and repository ID, and it will be later populated with the values with respect to where this was fired from, where the CI ran from. So something that can be easily missed with this feature is that the claims order is critical, all right? Let's see why. Consider this format and this claim. So we're going to have repo, my org, and then the name of the workflow, Makat Shemesh, fine. So we all know by now that this is very unsafe, right? I just showed you how it can be abused. But this one is actually safe. The prefix is safe. Why? Because GitHub will actually put the name of the organization and repository, you can't just fake that, at least not in this talk. But you can't just fake that. So this is fine. This is an example of fine, although it relies on unsafe claim for the second half of it. If you flip it, however, then you're done with, okay? So let's see how. In order to abuse such a case, basically all you have to do is create a workflow, name it everything after the workflow prefix, go to your favorite CI provider, change the sub claim to be workflow only, and they will grant you with a pretty and beautiful signed token that has the exact same claim like the other organization asserts. And obviously you can put whatever my org in Palo Alto, Microsoft, you can just write whatever. So a rule of thumb for this feature is that the claims order is critical. I haven't seen even one manual page that mentions that. When you use custom claims, they just let you use it, but they don't tell you what not to do. So the order is critical. In order to help everybody here to either escape from these bugs or to exploit them, I've created this tool. You can scan the QR code to get the latest zero click for your Android. But basically it allows you to enlist all the GitHub possible custom claims with information about the strength of each one. This is a nice guide I composed. It can check your sub claim format for safety, and it will allow you to modify the sub claim if you want to attack with it or you just want to fix it for your organization or repository. There is some hierarchy option, so it's interesting. This is how the tool looks like. All you've got to bring is your favorite GitHub token with admin permissions, not necessarily of your organization, but yeah. And for example, in the inspect mode, you can see that these are the claims, and they're not safe because it's set right, so go ahead, get a zero click, and yeah. Okay. Now this is behind us. And let's move into pipeline abuses that can lead to OIDC abuse. Basically misconfigs that lead to abuses, abusage, sorry, of lax policies. So we saw that this was very bad, right? We now know why this sucks. But what about these two? We did just say that, for example, saying everybody in Apollo is fine, right? Or not? So let's abuse those. The answer is pretty simple. Poison pipeline execution, which is the most common entry vector for CIs, right? And lax policies. So let's explain for a second. Uh, a PPE is a pull request from a fork that will trigger a vulnerable CI execution in the context of the target, right? We're all familiar with this by now. I hope so. Um, the second bit, the lax policies, um, they will allow a token from the same, uh, from the targeted organization, sorry, to slip through lax policies. Okay? Now what do I mean by that? Let's see how it plays. Demo. In order to demo that, we have to define a few entities, right? Let's begin with the identity federation on the resource side. So we're gonna set up something like this. We wanna assert that the audience equals, uh, the Amazon AWS thing. Um, and we wanna assert that all the identities coming in from the banana multi organization are okay to go in. This is the federation. If you put it, by the way, on AWS, it's gonna look something like this. And although AWS did some changes in order to enforce more strict policies, they will allow you to do that. This is fine by AWS. Now for the git part. Let's see what's our setup. We have this organization called banana multi and we have two, uh, basically pipelines including the git repo itself. And let's explain. So the upper one, um, is a pipeline that is configured to connect using OIDC to an S3 role that is, uh, an admin. Um, this policy is the policy that we just saw. So it's lax. Um, and this is our target. The second pipeline is called any updateser and, uh, it contains, it's connected to a vulnerable pipeline and then it's using an OIDC token again to access a restricted S3, uh, uh, bucket or a role and we obviously cannot use that. So let's see our attack vector. Pretty simple. We're gonna fork the any updateser and we're gonna, uh, um, basically invoke the CI machine of the, the CI workflow, sorry, of, uh, and we're gonna invoke the vulnerable CI workflow and we'll try to access the other accounts. Um, the workflow, by the way, looks something like this. It has to react to pull request, maybe pull request or pull request target for the GitHub world. Um, and you have to specify that you want an ID token that the workflow has to say. Um, the pipeline is gonna check out the fork. This is the head for the pull request. Uh, we're gonna skip the part where it actually assumed the AWS role. We don't, we can't use that so we don't care. And then there's an invocation of a file from the file system which was just cloned from the fork and yeah, we have RCE. So what we need to do now is make the fork pull request. This is what's called IPP, indirect points of pipeline execution. And this is the exploit script. Don't rush and, and, and take pictures. It's just chat GPT. Um, but basically all you have to do before you make this exploit code, you have to, uh, to do some recon and collect various id- accounts that are, are connected through using OIDC. Okay? I'm not gonna talk about it in this talk but this is something you have to do. In this example, I'm having 2 roles at the top that I'm gonna try to exploit. Let's see it in action. So this is the prepare.sh file that is gonna be invoked at some point. Uh, this is my fork. Any updates sir? And I'm gonna open a pull request. So, uh, hello it's me. The diff is the same file. Nothing but this file. And I'm gonna open the pull request and it's gonna invoke the CI in response to the trigger. Cool. 3 seconds from now we're gonna see the machine logs. 1, 2, 3, as I promised. And, uh, now in the logs we will see in the prepare step that it, we will see the output of my script and if we're successful we'll see sets of credentials. And I wouldn't be here if it would work so, yeah, we have sets of credentials. So we were able to assume a role that was not allocated to the pipeline we were running at. Well we were not able to assert others but again you can just spray OIDC tokens. So this is a very nice technique. You can just collect tokens, find vulnerable pipelines and start spraying for, to find the logs policies internally, right? You're already past the auth end. You have the credentials. So give it a shot. 1 second. Okay, uh, some nice disclosure. I was able to, this is by the way from last year already and, and I was able to find this, uh, a month ago in Azure and this allowed to access basically all the identities that had Azure slash star. So, yeah, nice technique. Um, the rest did not allow disclosure but you're out there. Cool, so rule of thumb in order to avoid this type of stuff, one is for the CI, please follow the best practices. We're 2024, um, we, my team, we've released plenty of guides on how to, uh, harden your pipelines. Please do so. The second thing, uh, pursue, uh, policies that are not with wildcards as much as you can or, uh, use other claims that are safe in order to assert identities. Okay, this brings us to our last topic of the day and this is when, when the vendor misconfigures. Now that you know that the vendor, the CI vendor is also the identity provider, now they have to put, to give more attention to the details, right? They have various products at their hand now and they have to be very careful. So, this is a disclosure for, uh, Circle CI, um, and basically if you're unfamiliar with Circle, they're a great CI product. Um, they provide various machines, right, in order for you to run your workloads and they're super nice and professional folks on a personal level. Okay? When I looked into, oh, just to explain, uh, Circle, sorry, um, this is you, you perform git push, you're all familiar with this diagram by now, well, you notify Circle with a payload and they did your CI thing for you. Now, when GitHub notifies Circle, by the way, they do that with the web hook and the payload is everything that was, that is in your git context. So, in a way, and just to add to the confusion, Circle can supply you with a super set of claims on top of GitHub's claims, if you think about it. Just to add to the confusion from earlier, I see your faces, so yeah, it's confusing. Um, okay, so when I looked into Circle's CI system state, I noted the following. First, pipelines reacted to fork pull request if and only if, there's no typo, uh, the project is configured to do so. Now, this is actually a good limitation, right? We don't want anybody on the internet to run machines for us. Putting aside security, someone's gotta pay for that. Okay, but second thing that I noted is that pipelines were triggered, uh, on a workflow change, even from a fork. Okay? And this is not good. Why? This implies every pull request can be an RCE, you can just commit, basically pull request a malicious workflow. Okay, doesn't look good, but the third part was the, the cherry on top. An IDC token was always granted to the machine regardless of anything. And this is credentials mishandle and misuse. Okay? So, combining those, I was granted an ID token in the context of any Circle CI project that allowed fork pull requests. Okay? What does it imply? What does it mean? Is that I was able to access OIDC gated resources of any Circle CI organization that allowed fork pull requests. Right? That's basically everybody on Circle that has pull requests and OIDC. Nice amount. Um, the attack flow is pretty simple, you just saw a demo of that using, uh, another file, right? The prepare, so I'm not gonna show the same thing, all you've, you had to do basically is, uh, pull request the workflow. So, I'm not gonna show that. I will talk about the disclosure, however. So, in order to show Circle CI that this was indeed a bug, I looked for instances in the wild to support my case. Um, it wasn't long ago until I found this file. Now, this was by a company called Darklang. Anybody here familiar with those folks? Hands up? No? Okay. Um, just to explain this file, this is an identity federation for, uh, GCP. And even though you don't know this, this cell language, uh, GCP's language, you can understand the mapping here, right? We know that CircleCI.com, we know this is the provider, and we know project ID is the claim, and we're gonna map it to project, audience to organization ID, and sub to sub, right? We now know what these claims are. Um, per the condition, the condition was that any one of these three project IDs is okay to access. And something that I cared but then didn't care for the exploitation was that the issue URL and the allowed audience had to be the organization, uh, ID. Now this is fine as long as you create a pull request within the organization, Circle will just provide you with the ID, right? You're in the context of the organization. So this part is fine, we don't need to care about that. Um, so basically, a fork PR to any of those projects, uh, which indeed they allowed fork PRs, uh, granted access to their clouds. That was it, as simple. Okay, just detect the misconfig, pull request, enjoy the cloud account. So good summary and me, I'll disclose to the company so they can fix it and meanwhile, meanwhile I'll go to Circle. I went to DarkLang's, uh, Discord asking for, uh, bug bounty cause I like it, and but there was none, so I was told to DM, um, DM someone. Um, this is the someone, PBigger, I don't know if someone is familiar with this name, but yeah, we're gonna see exactly how you are familiar. But, um, yeah, he told me DM me, which I did, I sent, uh, I sent them everything and I also added the line, the reason, at the bottom, sorry, the reason is not safe, it's not because of you, it's because of a bug in Circle, right? I mean, you're fine, just defend yourself, it's them, not you. Um, I also asked them to not disclose right now. I don't know who is aware of that, I don't want anybody to exploit, I'm, uh, white hat at that point. Uh, I don't want anybody to exploit, um, so don't talk to anybody. Um, PBigger replied that he was investigating and then he confirmed it and blocked all access. By the way, this is exactly where OIDC kicks in. By ticking one box, he was able to kill all the GitHub, uh, basically all the, um, OIDC connections coming from Circle. Okay, this is very powerful. No rotations needed, no credential changes, just one box. Um, he was fixing that, we were, we continued chatting, later on he said again that he was very happy to seal it, to which I replied, no problem. To which he replied, uh, by the way, I sent a note to the security folks at CircleCI, I wasn't sure if you knew, but I founded Circle. Yeah. So, just a random dude on Discord, right? So, a good advice here would be to attempt to not disclose directly to the board member or the CEO, it can be a bit awkward and odd. So, yeah. This was, uh, June 23, Circle since then fixed this bug and sealed it, and now if you look into their OIDC page, you see this message, what about forks, and basically, uh, you have to opt in now. Like in GitHub, I told you you have to set up ID token, right? This is the same thing, you have to opt in, this is done in a different manner, but the same idea, you have to opt in in order to provide a fork, a machine that is running for a fork pull request, an OIDC token. Um, this changes this state and now we have a proper handling. You can see that, um, part two is still there. Uh, some integrations in Circle still react to that, so enjoy the misconfig. Um, and this is roughly, this is our conclusions and takeaways. So, first of all, I hope that now you know what OIDC is. It's not that hard, right? I was talking to folks before and they were giving me weird faces, like, yeah, I know, know OIDC, know. So, I hope you know it now, relax, it's fine, it's chill, okay? Um, plus you already learned OAuth, this is the big thing to, to swallow here. Um, second thing, and this is actual takeaways, so for in using OIDC and CI, do the following, uh, learn the origin of each claims, I've provided the tool for GitHub again, but, um, learn the claims for your identity providers, uh, pursue policies without wildcards, and always think, always think, which other identities can satisfy my conditions? Last bit, please harden your pipelines, sometimes it's too easy. That's it. So, yeah. Um, and yeah, but that's basically it. Thank you very much. Um, yeah, I'm here for questions, if there are any. Questions? Beers? Shots? No? See you around.