Challenge

The Shadow Pipeline Overlord was the second challenge on the Aikido sponsor track at BSidesNYC 2026 Cloud Village, worth 1000 points. The setup is a self-hosted Forgejo instance at https://41.challenge2.aikidolabs.net, where my team number was 41. Provisioning handed me a player account with Write access to a single repository, team-41/infra.

Inside that repo is a deploy pipeline, .forgejo/workflows/deploy.yml. It triggers on pushes to deploy/**, requests an OIDC id token, exchanges that token for an AWS IAM role through AssumeRoleWithWebIdentity, and reads a flag out of Secrets Manager. There are no static AWS credentials anywhere in the repo. The whole point of the design is that the pipeline, not the player, holds the privilege.

So the question is not “where are the AWS keys.” There are none. The question is “how do I make the pipeline run on my behalf,” and the answer turned out to be a branch-protection coverage gap.

Approach

The branch-protection gap

I started by cloning the repo with the player credentials and reading the workflow.

1
git clone https://player:<redacted>@41.challenge2.aikidolabs.net/team-41/infra.git

The relevant part of .forgejo/workflows/deploy.yml looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
on:
  push:
    branches:
      - 'deploy/**'

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
    steps:
      - uses: actions/checkout@v4
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          enable-openid-connect: true
          role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }}
          aws-region: ${{ secrets.AWS_REGION }}
      - name: Read deploy secret
        run: aws secretsmanager get-secret-value --secret-id ${{ secrets.FLAG_SECRET_ID }}

The pipeline reads the flag secret and, in the stock version, prints the result into its own job log. That is the intended prize. The trick is getting a run to happen under my account.

As a Write-level collaborator I cannot open Settings and I cannot view the branch protection page. Those are admin-only. The branch_protections API returns nothing useful to me either. So I could not read the protection rules directly. Instead I discovered the gap empirically, by testing what the server would actually let me do.

Pushing to main is rejected outright:

1
2
git push origin main
# remote: protected branch main cannot be pushed to

But the workflow triggers on deploy/**, and there is no reason to assume the protection that covers main also covers the deploy branches. I created a fresh deploy/* branch and tried pushing that instead.

1
2
3
git checkout -b deploy/pop
git commit --allow-empty -m "trigger deploy pipeline"
git push origin deploy/pop

That push succeeded. The protection on main did not extend to deploy/**, feature/*, or release/*.

Triggering the pipeline

Pushing any content to a deploy/* branch is enough to fire deploy.yml. The empty commit above did the job. The run started, requested its OIDC id token, exchanged it for the deploy role via AssumeRoleWithWebIdentity, and called get-secret-value. The pipeline ran with its own privilege, exactly as designed, except I was the one who started it.

Reading the secret

I edited deploy.yml on a new deploy/* branch so that after reading the secret, the job commits it to a separate branch using my own player credentials against the Forgejo contents API. My first attempt tried to authenticate the write with the built-in github.token, which is not authorized on this instance and silently created no file. Switching the write to the player credentials fixed it. The working branch wrote the secret to a file on a loot branch, and I pulled it back with a plain authenticated request.

1
2
3
curl -s -u player:<redacted> \
  "https://41.challenge2.aikidolabs.net/api/v1/repos/team-41/infra/contents/loot.txt?ref=loot"
# -> FLAG-55eeda3ea24058cbdf527eb6369dc9ad

Flag

FLAG-55eeda3ea24058cbdf527eb6369dc9ad