The CI/CD Escape Room - Eleven doors, zero exploits
Jesper Larsson (Security Researcher and Penetration Tester · 0x4A)
SEC-T 2026 · Day 1 · Main hall
Overview
In his compelling SEC-T presentation, "The CI/CD Escape Room - Eleven doors, zero exploits," Jesper Larsson, a Security Researcher and Penetration Tester at 0x4A, takes the audience on a journey through a meticulously crafted chain of misconfigurations within a modern CI/CD pipeline and cloud environment. Larsson's talk challenges the conventional understanding of vulnerabilities, demonstrating how an ordinary employee with basic Git repository access can escalate privileges to become a global administrator within a Google Cloud organization, all without exploiting any zero-day vulnerabilities, memory corruption, or known CVEs. Instead, the attack relies on chaining together 11 subtle "puzzles" – individually benign misconfigurations that, when combined, create a critical path to compromise.

Key moments
- 3:45 The "CI/CD Escape Room" quest begins
- 9:00 Bypassing main branch protection via new branch
- 11:15 Attacker's branch code executed by pipeline
- 21:00 Exploiting federated identity trust conditions
- 28:00 Escalating privileges via service account impersonation
- 30:00 Achieving global administrator rights over the organization
- 32:40 Four key mitigations to break the attack chain
- 40:00 Q&A: The core problem of missing context
The CI/CD Escape Room - Eleven doors, zero exploits
Speakers: Jesper Larsson, Security Researcher and Penetration Tester, 0x4A
Conference: SEC-T
YouTube: https://www.youtube.com/watch?v=UXBse_AnS54
Overview
In his compelling SEC-T presentation, "The CI/CD Escape Room - Eleven doors, zero exploits," Jesper Larsson, a Security Researcher and Penetration Tester at 0x4A, takes the audience on a journey through a meticulously crafted chain of misconfigurations within a modern CI/CD pipeline and cloud environment. Larsson's talk challenges the conventional understanding of vulnerabilities, demonstrating how an ordinary employee with basic Git repository access can escalate privileges to become a global administrator within a Google Cloud organization, all without exploiting any zero-day vulnerabilities, memory corruption, or known CVEs. Instead, the attack relies on chaining together 11 subtle "puzzles" – individually benign misconfigurations that, when combined, create a critical path to compromise.
Larsson's core thesis is that while individual components of a CI/CD system might be configured "correctly" in isolation, a lack of holistic understanding and cross-team oversight can lead to severe security gaps. He likens the CI/CD pipeline to "just a computer" that takes instructions from a repository, and Workload Identity Federation as a powerful but often misunderstood mechanism for granting temporary cloud credentials. The talk serves as a stark reminder that the journey from basic repository access to full organizational control is often paved with logical flaws in configuration and trust relationships, rather than complex exploits.
This detailed article will dissect Larsson's "escape room" scenario, examining each of the 11 steps that culminate in full cloud compromise. It will explore the technical nuances of how pipeline triggers, environment declarations, and identity federation trust conditions can be abused, and crucially, what defenders can do to break this insidious kill chain. The presentation underscores the critical need for a deeper understanding of how CI/CD pipelines interact with cloud identity and access management (IAM) at scale, moving beyond simple checks to a comprehensive audit of the "graph of use."
Background
▶ Watch: The "CI/CD Escape Room" quest begins (3:45)
The premise of "The CI/CD Escape Room" begins with a common scenario: an ordinary employee, dubbed "The Dungeon Crawler," with minimal initial access. This employee possesses write access to a large number of Git repositories—approximately 1,840 in the simulated "Vault Work AD" organization—but crucially, lacks administrative privileges (admin: false) and cannot directly merge code into protected branches like main. The ultimate objective is to achieve global administrator status within the associated Google Cloud organization.
Larsson frames the problem not as a search for vulnerabilities in software, but as a series of configuration puzzles. Modern CI/CD practices often involve complex integrations between source code repositories, automated build and deployment pipelines, and cloud infrastructure-as-code (IaC) tools like Terraform. While these systems are designed for efficiency and automation, their inherent complexity can obscure critical security misconfigurations. The shift from static API keys to dynamic, short-lived credentials via mechanisms like Workload Identity Federation in Google Cloud is a positive step, but it introduces new challenges in correctly defining trust boundaries and claims.
The underlying problem is often a disconnect between different teams responsible for various parts of the delivery pipeline. Source control administrators might set repository permissions, platform teams might manage CI/CD runners and workflows, and cloud operations teams might configure IAM policies and identity federation. As Larsson notes, this creates a "hallway problem" where no single entity has a complete, end-to-end security view. Each team might make decisions that are "correct" within their silo, but when combined, these decisions create an exploitable chain. The talk highlights that the absence of a single, obvious vulnerability does not equate to security; rather, it's the aggregation of seemingly minor misconfigurations that forms the pathway to compromise.
Key Findings
▶ Watch: Attacker's branch code executed by pipeline (11:15)
Jesper Larsson's "CI/CD Escape Room" reveals several critical findings about the security posture of modern CI/CD pipelines and cloud environments:
- "Write is not one permission": The impact of having "write access" to a Git repository is not uniform. It heavily depends on the type of repository. A mere application code repository has a limited blast radius, but a "delivery repo" (containing pipeline definitions) or an "infrastructure repo" (containing IaC like Terraform) can grant access to pipeline identities and cloud privileges, significantly expanding the potential for compromise.
- Branch Protection is Insufficient: While
mainbranch protection (requiring reviews, preventing direct pushes) is standard, it often fails to account for pipelines configured to trigger on any branch push. An attacker can create their own branch, modify workflow files within it, and trigger sensitive production pipelines without ever merging tomain. - Terraform Plan as an Authentication Trigger: Even a
terraform plancommand, which is typically considered read-only, can trigger a federated account to perform a login and authorization process. This action can mint short-lived credentials for the pipeline's service account, which can then be extracted by an attacker. - Misconfigured Workload Identity Federation Trust Conditions: This is a pivotal finding. Many Workload Identity Federation trust conditions are configured to validate only broad claims like the
environment(e.g.,prod), without specifying theref(branch) orrepositoryfrom which the request originated. This allows an attacker to declare an environment likeprodin their malicious branch's workflow file, satisfying the trust condition and receiving production-level cloud credentials. - Abuse of Service Account Administrative Roles: CI/CD deployment service accounts are often granted
serviceAccountAdminroles over other service accounts within the cloud environment. This administrative privilege allows the deployment account (and by extension, the attacker who has compromised it) to modify the IAM policy of another service account, granting themselves impersonation rights to that account. - The "Hallway Problem" and Contextual Security: Larsson emphasizes that different teams (source control, platform, cloud ops) manage different segments of the pipeline, leading to a fragmented security view. Each component may function "correctly" in isolation, but the lack of an overarching, contextual security assessment across these boundaries creates vulnerabilities.
- Logs are Not a Panacea: While every action in the attack chain is meticulously logged, the sheer volume and lack of contextual correlation across different systems make it practically impossible for human operators to detect the malicious intent behind seemingly legitimate actions. The problem is not the absence of logs, but the inability to interpret the aggregated context.
Technical Deep Dive
▶ Watch: Escalating privileges via service account impersonation (28:00)
The "CI/CD Escape Room" is a detailed, 11-step journey from basic Git access to global cloud administrator. The scenario unfolds within a fictional "Vault Work AD" organization, targeting a Google Cloud environment, with GitHub Actions as the CI/CD platform and Terraform for infrastructure management.
Initial State (Door 1-3): The Ordinary Employee
The attacker begins as an ordinary employee with write access to approximately 1,840 repositories. Critically, they are not an administrator (admin: false) and cannot directly push or merge to protected branches like main. The first key insight is that "write access" is not uniform; its power depends on the repository's content. A repository holding pipeline definitions or infrastructure-as-code (IaC) is far more valuable than a simple application code repository.
- Door 1: Identify a "Delivery Repo": The attacker searches for repositories that define CI/CD pipelines or infrastructure. They find
Vault Work infrawhich contains.github/workflowsandTerraformcode, tagged forproduction. - Door 2: Bypass Main Branch Protection: While
mainis protected, the attacker discovers they can create new branches. - Door 3: Create an Attacker Branch: The attacker creates a new branch (e.g.,
poke-from-evilattacker.com) within theVault Work infrarepository. This branch is a copy ofmain, including its workflow definitions.
Gaining Code Execution on the Runner (Door 4-6): The Pipeline as a Computer
The next phase focuses on achieving code execution within the CI/CD runner.
- Door 4: Understand the Pipeline: Larsson stresses that a pipeline is "just a computer" executing instructions from the repository. If this pipeline deploys to production, it must hold production credentials.
- Door 5: Trigger the Pipeline: Many CI/CD workflows are configured to trigger on
pushevents to any branch, not just merges tomain. By pushing changes to their new branch, the attacker triggers the pipeline. Crucially, because the original workflow declaredenvironment: production, the pipeline runs with a production context. - Door 6: Terraform Plan & Credential Extraction: The pipeline's workflow includes a step to run
terraform plan. Larsson demonstrates that even aplanoperation, when executed with a federated account, performs an authentication step to the cloud. The attacker modifies their branch's workflow file to inject commands (e.g., into apre-flight checkstep) that capture the short-lived Workload Identity token issued during this authentication. This token, although temporary, is sufficient for immediate malicious actions. An example command could beecho $GCP_TOKEN > credentials.jsonto write the token to a file accessible to the attacker.
Abusing Cloud Identity Federation (Door 7-8): The Wrong Field
This is where the attack pivots from the CI/CD platform to the cloud identity system.
- Door 7: Manipulate Environment Declaration: The attacker knows the cloud's Workload Identity Federation is configured to trust claims where
environment == "prod". In their attacker branch, they modify the workflow file to declareenvironment: prod. - Door 8: Exploit Trust Condition Misconfiguration: This is the most critical misconfiguration. The cloud's trust condition for issuing credentials validates the
environmentclaim, but fails to validate theref(branch) orrepository. Because the attacker's branch now correctly declaresenvironment: prod, the cloud's identity federation system, despite its robust cryptographic checks, issues a valid, short-lived credential for the production environment. The guardian is "reading the wrong field."
Privilege Escalation in the Cloud (Door 9-11): Impersonation and Global Admin
With a valid production credential, the attacker begins escalating privileges within Google Cloud.
- Door 9: Identify Impersonation Rights: The obtained credential belongs to a service account, specifically the
Terraform deployer production Vault Work CIaccount. The attacker discovers this account has theserviceAccountAdminrole over a "broker account." TheserviceAccountAdminrole allows managing IAM policies for other service accounts. - Door 10: Grant Self-Impersonation: Using the
Terraform deployeraccount'sserviceAccountAdminrole, the attacker modifies the IAM policy of the "broker account." They add themselves (or their controlled service account) to the list of members allowed to impersonate the broker account (i.e., grantingroles/iam.serviceAccountTokenCreator). After minting a token for the broker account, the attacker can revert the policy change to cover their tracks. - Door 11: Achieve Global Admin: The "broker account" is highly privileged, holding roles such as
organizationAdmin,folderAdmins,projectCreator,deleter of org policies, andKMS secret manager. By impersonating the broker account using the newly minted token, the attacker gains global administrative control over the entire Google Cloud organization.
This intricate chain highlights how seemingly isolated configuration decisions across different layers of the infrastructure can be combined to achieve complete compromise, without any single "exploit" in the traditional sense.
Demo / Proof of Concept
▶ Watch: Achieving global administrator rights over the organization (30:00)
During the talk, Jesper Larsson provides a live demonstration of a crucial part of the attack chain, specifically focusing on the ability to trigger a pipeline from a new branch and extract credentials. The demo illustrates the process of creating a pull request from an attacker's branch, which then initiates a Terraform plan job. Although the live demo encounters minor technical hiccups, Larsson successfully conveys how an attacker can inject commands into the workflow (e.g., within pre-flight checks), such as grep credentials or echo $GCP_TOKEN > credentials.json, to exfiltrate the short-lived Workload Identity token generated by the pipeline runner.
He emphasizes that while these tokens are indeed short-lived, they are perfectly sufficient for an attacker to immediately use for further actions, such as interacting with Google Cloud APIs to enumerate permissions, modify IAM policies, or initiate further impersonation steps. The demonstration visually reinforces the concept that even a non-mergeable branch can trigger powerful actions and that sensitive credentials can be extracted from the runner's environment if the workflow is not carefully secured. This practical proof-of-concept underscores the feasibility and ease with which these misconfigurations can be leveraged.
Defensive Implications
▶ Watch: Q&A: The core problem of missing context (40:00)
The "CI/CD Escape Room" provides a sobering look at common misconfigurations and offers critical defensive implications for organizations:
- Strictly Scope Base Repository Permissions: The fundamental starting point for this attack was the generic
write accessto repositories. Organizations should set default repository permissions to read-only and grantwriteaccess explicitly through teams or individual grants, following the principle of least privilege. This prevents an ordinary employee from creating branches in sensitive infrastructure or delivery repositories. - **Enforce Review for All Pipeline Triggers**: Relying solely on
mainbranch protection is insufficient. Implement mandatory code reviews and approvals for any pipeline execution that interacts with sensitive environments, regardless of the branch. While challenging for rapid CI/CD, specific policies can be enforced for infrastructure-as-code or production deployment pipelines. - Refine Workload Identity Federation Trust Conditions: This is a critical mitigation. The trust condition for issuing cloud credentials must include more than just the
environmentclaim. It should explicitly scope the trust to the branch (ref) and repository (e.g.,ref == "refs/heads/main"andrepository == "vault-work-infra"in addition toenvironment == "prod"). This ensures that only authorized branches in specific repositories can obtain production credentials. - Remove Administrative Rights from Deployment Identities: Audit and remove
serviceAccountAdminor similar highly privileged roles from CI/CD deployment service accounts, especially if they operate over other service accounts that can mint tokens or have broad cloud access. Deployment accounts should only have the minimum permissions necessary for their direct tasks (e.g., applying Terraform changes to specific resources, but not managing IAM policies of other service accounts). - Audit the "Graph of Use," Not Just Accounts: Beyond individual account permissions, organizations must audit the transitive permissions and trust relationships. Understand what one identity can do to another (e.g., "can this service account grant itself impersonation rights to another service account?"). Tools for visualizing and auditing IAM policies across cloud and CI/CD environments are crucial.
- Implement Egress Filtering on CI/CD Runners: To prevent credential exfiltration, implement strict egress filtering on CI/CD runners. Block outbound connections to unauthorized destinations, limiting where extracted tokens or other sensitive data can be sent.
- Separate Credentials for Terraform Plan and Apply: Consider using dedicated, read-only service accounts for
terraform planoperations and separate, more privileged accounts forterraform apply. This limits the blast radius if an attacker can inject code into aplanstep. - Contextual Security Awareness: Foster a culture of holistic security. Teams responsible for source control, CI/CD platforms, and cloud infrastructure must collaborate to understand the end-to-end security implications of their configurations, preventing the "hallway problem" where no one owns the full security context.
- Break the Kill Chain Early: The talk emphasizes that fixing any one of the 11 "doors" can break the entire chain. Defenders do not need to solve every problem simultaneously but can prioritize and implement controls at various points to prevent full compromise.
Key Takeaways
- "Write access" is context-dependent: The security impact of write permissions on a Git repository is not uniform; it critically depends on whether the repository contains application code, CI/CD pipeline definitions, or infrastructure-as-code.
- Branch protection is often insufficient: Protecting the
mainbranch alone does not secure CI/CD pipelines if workflows can be triggered by pushes to attacker-controlled branches in sensitive repositories. - Workload Identity Federation requires precise scoping: Trust conditions for cloud identity federation must validate not only the
environmentclaim but also the specificref(branch) andrepositoryto prevent attackers from minting production credentials from unauthorized branches. - Service account administrative roles are high-risk: Granting
serviceAccountAdminor similar IAM policy management roles to CI/CD deployment accounts creates a significant privilege escalation path, allowing attackers to grant themselves impersonation rights. - Chains of misconfigurations are critical: Individually benign or seemingly minor misconfigurations, when chained together, can lead to a complete compromise of cloud environments without the need for traditional exploits or zero-days.
- Audit the "graph of use," not just individual accounts: Effective security requires understanding the full chain of trust and transitive permissions between identities and resources across both CI/CD and cloud, rather than just isolated account permissions.
About the Speaker(s)
Jesper Larsson is a distinguished Security Researcher and Penetration Tester at 0x4A. His expertise lies primarily in the complex and often overlooked domains of orchestration, cloud environments, and intricate systems that many tend to ignore. Beyond his professional work, Jesper is deeply involved in the security community. He is the organizer of Security Fest in Gothenburg, Sweden, a popular security conference. Additionally, he co-hosts Säkerhetspodcasten, a Swedish podcast dedicated to security banter and discussions. Jesper is also recognized for his participation in Hack Gat.
Reviews
Dr. Zero (Offensive Security Researcher) — SOLID
This is a masterclass in modern cloud exploitation. Larsson drops the memory corruption theater and proves that you don't need a zero-day to own a GCP organization—you just need a developer's blind trust in GitHub Actions and a butchered Workload Identity configuration. Required viewing for any platform engineering team that thinks branch protection equals security.
Heather Calloway (CISO) — MUST SEE
This is required viewing for any organization using CI/CD pipelines and cloud identity federation. Larsson demonstrates how an attacker can walk from standard developer access to global cloud administrator without a single zero-day, purely by abusing organizational silos. It's a textbook illustration of why identity governance must extend entirely through the pipeline.