Zombie Workflows And Other GitHub Actions Horror Stories

Paul Gerste (Vulnerability Researcher · Sonar)

Insomni'hack 2026 · Day 1 · Main Track

Overview

In this technical presentation at Insomni'hack, Paul Gerste, a vulnerability researcher at Sonar, explores the security pitfalls of GitHub Actions, focusing on a novel attack vector he termed zombie workflows alongside a catalog of real-world exploitation techniques. As organizations increasingly rely on built-in CI/CD pipelines for deployment automation, testing, and pull request management, these systems have transformed into high-value targets. Gerste demonstrates how seemingly benign configuration choices—such as multi-branch repositories, environment variable parsing quirks, and unsafe trigger selections—can lead to total repository compromise, supply chain tampering, and unauthorized access to deployment credentials.

Watch on YouTube

Visual summary for Zombie Workflows And Other GitHub Actions Horror Stories by Paul Gerste
Visual summary for Zombie Workflows And Other GitHub Actions Horror Stories by Paul Gerste

Key moments

  1. 0:00 Introduction and GitHub Actions primer
  2. 4:00 Common risks and dangerous event triggers
  3. 8:30 Discovering zombie workflows and scanning top repositories
  4. 17:30 Real-world exploitation: Cross-job privilege escalation
  5. 22:30 Docker build context abuse and token exfiltration
  6. 25:30 Bypassing secret censoring and side-channel oracles
  7. 34:30 Defense updates, platform fixes, and key takeaways

Zombie Workflows And Other GitHub Actions Horror Stories

Speakers: Paul Gerste (Vulnerability Researcher, Sonar)

Conference: Insomni'hack

YouTube: https://www.youtube.com/watch?v=ZLPAGWYYu28

Overview

In this technical presentation at Insomni'hack, Paul Gerste, a vulnerability researcher at Sonar, explores the security pitfalls of GitHub Actions, focusing on a novel attack vector he termed zombie workflows alongside a catalog of real-world exploitation techniques. As organizations increasingly rely on built-in CI/CD pipelines for deployment automation, testing, and pull request management, these systems have transformed into high-value targets. Gerste demonstrates how seemingly benign configuration choices—such as multi-branch repositories, environment variable parsing quirks, and unsafe trigger selections—can lead to total repository compromise, supply chain tampering, and unauthorized access to deployment credentials.

The talk bridges the gap between theoretical CI/CD edge cases and empirical vulnerability research. Gerste shares insights from scanning nearly 30,000 top GitHub repositories, dissecting real YAML configurations, and uncovering non-intuitive vulnerabilities. Beyond highlighting the risks, the session covers defensive mitigations, including GitHub's own infrastructural patches that neutralized the zombie workflow class, while reinforcing the broader security axiom: developer tools and build engines are fundamentally not designed to process untrusted input safely.

Background

▶ Watch: Introduction and GitHub Actions primer (0:00)

GitHub Actions is GitHub's native continuous integration and continuous deployment (CI/CD) platform. It allows developers to define workflows in YAML format inside the .github/workflows/ directory. These workflows are triggered by various repository events, such as pushes, pull request openings, comment additions, or cron-like time schedules. By default, workflows execute inside disposable, ephemeral virtual machines hosted on GitHub infrastructure (such as ubuntu-latest), utilizing predefined or custom actions to clone code, install dependencies, and run scripts.

The underlying threat model of any CI/CD pipeline makes it an attractive attack surface. Repositories frequently store sensitive deployment secrets—such as npm publishing tokens, cloud provider credentials, and container registry keys—to promote build artifacts to production. Furthermore, workflows often require elevated write permissions on the repository to automate tasks like labeling, auto-closing, or merging pull requests. When an external contributor opens a pull request on a public repository, the untrusted code submitted by the attacker interacts directly with the CI/CD environment.

Historically, standard pull requests (pull_request) isolate untrusted contributions by stripping write permissions and withholding secrets. However, developers frequently misconfigure workflows to use the dangerous pull_request_target trigger. Unlike pull_request, which runs the workflow using the context of the pull request's head commit, pull_request_target executes workflows in the context of the base branch and retains repository write permissions and secrets, even when triggered from an external fork. This classic misconfiguration—frequently dubbed "porn requests" in security culture—allows malicious actors who can control repository files (like package.json or build scripts) to achieve remote code execution and compromise the pipeline.

Key Findings

▶ Watch: Discovering zombie workflows and scanning top repositories (8:30)

To understand the real-world prevalence of these architectural risks, Gerste conducted a large-scale empirical scan of approximately 30,000 GitHub repositories with 1,000 or more stars. Of those scanned, roughly 55% utilized GitHub Actions, and 14,000 repositories maintained multiple branches. Filtering for workflows using the pull_request_target trigger and applying heuristics to identify exposure to secrets or write permissions, Gerste analyzed a reduced set of 2,000 candidate workflows.

Out of this triaged subset, 188 workflows were confirmed vulnerable. A deeper inspection revealed a surprising statistic: two-thirds of these vulnerable workflows were still insecure on their primary (main) branch. However, 67 repositories suffered specifically from zombie workflows—instances where the maintainer had successfully patched a vulnerability on the main branch, but left vulnerable, outdated copies of the workflow file lingering on older, un-deleted non-default branches (such as old release branches, forgotten feature branches, or unmerged pull request branches). Attackers could explicitly target these secondary base branches with a pull request, bypassing the security patches applied to the main branch.

Beyond discovering zombie workflows, analyzing hundreds of real-world YAML files allowed Gerste to categorize several sophisticated exploitation primitives used to escalate privileges, bypass secret-masking filters, and manipulate Git internals.

Technical Deep Dive

▶ Watch: Real-world exploitation: Cross-job privilege escalation (17:30)

Gerste detailed several technical exploitation vectors discovered in real-world workflows, illustrating how minor developer assumptions lead to complete pipeline compromise.

1. Cross-Job Privilege Escalation via Environment Injection and Shared Artifacts

Many organizations attempt to isolate risk by splitting workflows into multiple jobs: a dangerous job that runs with read-only permissions and no secrets to check out and build untrusted PR code, and a safe job that handles privileged actions. Gerste demonstrated a multi-stage attack bypassing this boundary:

  • Environment Variable Injection (GITHUB_ENV): The dangerous job uses an inline bash script to query changed files via git diff. It writes these filenames to the GITHUB_ENV file using a multi-line here-doc syntax delimited by EOF. By naming a malicious file EOF, an attacker prematurely closes the here-doc. By injecting an additional file named LD_PRELOAD=pwn.so followed by a second here-doc, the attacker breaks out of the environment variable assignment context. This injects LD_PRELOAD into the subsequent runner steps, achieving arbitrary code execution.
  • Artifact Poisoning: The dangerous job uploads build diffs as artifacts using standard upload/download actions without specifying a destination path. When the privileged job downloads the artifact, files are extracted directly into the current working directory. An attacker packaging a malicious json.py inside the upload artifact causes the safe job's Python script (which imports JSON modules) to execute the attacker's json.py via Python's local module resolution precedence. This bridges the security boundary and steals the privileged GitHub token.

2. Docker Build Context Manipulation and Symlink Abuse

Some workflows isolate builds inside Docker containers. Repositories typically check out code, store the short-lived GitHub token inside .git/config with content write permissions, and run a Docker build targeting a subfolder.

  • Because Docker's build context prevents a Dockerfile from referencing files outside the specified directory, direct exfiltration of .git/config is blocked.
  • Attackers bypass this restriction using symbolic links. By replacing the Docker subfolder with a symlink pointing to the repository root (.), the Dockerfile and the .git folder become siblings. The container can then successfully copy .git/config and abuse the write token before execution terminates.

3. Secret-Masking Bypasses via Regex Problem Matchers

GitHub automatically masks known repository secrets in standard output by replacing them with asterisks (*). Attackers can subvert this via workflow commands and problem matchers**:

  • Partial Matching: By registering a local JSON problem matcher using the ::add-matcher:: command, an attacker defines custom regular expressions to parse standard output. By intentionally crafting a regex that matches all characters of a secret except the first character, the partial secret is captured and displayed in the GitHub Actions UI because GitHub's scanner does not recognize substrings as secrets.
  • Dynamic Masking Oracles (::add-mask::): Attackers can dynamically add new strings to the masking engine. By iterating guesses and observing shifts in the length of censored output blocks when secrets overlap with newly masked prefixes, an attacker can construct a side-channel oracle to brute-force unknown secrets character by character.

4. Git Metadata Trashing and Post-Execution Hooks

GitHub Actions utilize post-execution hooks that run in reverse order at the end of a job to clean up environments (e.g., executing Git cleanup commands).

  • If an attacker uses symbolic links to redirect a temporary file write into .git/HEAD, the Git metadata file becomes corrupted or "trashed."
  • When Git commands execute during clean-up hooks, failure to parse .git/HEAD causes Git to traverse parent directories or inspect top-level files acting as a bare repository. An attacker planting a malicious configuration file in the working directory tricks Git into executing arbitrary commands defined in the forged config during the cleanup phase.

Demo / Proof of Concept

▶ Watch: Bypassing secret censoring and side-channel oracles (25:30)

The speaker did not perform a live keyboard-and-screen demonstration during the talk; instead, the presentation relied on minimized, real-world YAML snippets, architectural diagrams, and code breakdowns illustrating concrete exploit chains such as environment variable injection and symlink Docker context escapes.

Defensive Implications

▶ Watch: Defense updates, platform fixes, and key takeaways (34:30)

Defending CI/CD pipelines requires moving beyond superficial hardening and implementing strict architectural controls:

  • Eliminate pull_request_target: Avoid the pull_request_target trigger entirely unless absolutely necessary. Standard pull_request triggers inherently isolate external contributions by denying write access and withholding secrets.
  • Enforce Branch Protections and Cleanups: Prior to GitHub's platform-level fixes, organizations had to audit and purge abandoned feature branches, old release branches, and stale pull request branches to eliminate zombie workflows.
  • Treat Developer Tools as Insecure Parsers: Never run build tools, package managers, linters, or Git commands directly against untrusted checkouts without strict sandboxing. Assume that processing untrusted code with developer tooling will yield code execution.
  • Principle of Least Privilege: Strictly scope permissions on individual jobs. Even if a workflow must use privileged triggers, ensure that jobs processing untrusted checkouts operate under read-only permissions with zero access to environment secrets.

Key Takeaways

  • GitHub Actions and CI/CD pipelines are saturated with complex pitfalls, requiring deep knowledge of underlying runner mechanics to configure securely.
  • Zombie workflows occurred when vulnerabilities fixed on the primary (main) branch remained exploitable via outdated workflow copies residing on forgotten secondary branches.
  • GitHub addressed the zombie workflow class natively in December by enforcing that workflows triggered by external pull requests are always loaded from the default branch.
  • Standard developer tools (Git, package managers, compilers, and agent harnesses) are fundamentally unequipped to process untrusted files safely without leading to code execution.
  • Utilizing pull_request_target on external pull requests remains the single most dangerous architectural risk in GitHub Actions configurations.

About the Speaker(s)

  • Paul Gerste (Vulnerability Researcher, Sonar): Paul Gerste has participated in Pwn2Own twice and has discovered security issues in popular applications like Proton Mail, Visual Studio Code, and Grafana. Outside of work, he plays CTFs with team FluxFingers and organizes Hack.lu CTF.

Reviews

→ Top-rated talks at Insomni'hack 2026

All talks from Insomni'hack 2026