Skip to content
← RegistryDossier · 7 steps · 6 edges

pull_request_target injection → secrets → cloud takeover

A GitHub Actions workflow runs on pull_request_target and checks out the PR's head SHA. The attacker's PR injects code that runs with the base repo's secrets, including a cloud deploy role.

Filed by AD Knowledge Base
§ Kill-chainDrag · zoom · scroll

§ Context

Assumed environment: target uses GitHub Actions; at least one workflow triggers on pull_request_target (commonly because it needs secrets for labelling / commenting). The workflow checks out github.event.pull_request.head.sha.

§ Steps

  1. 01
    Fork target repo + push payloadInitial Access
    T1078Valid Accounts
  2. 02
    Spot pull_request_target workflowReconnaissance
    W-RECON-GITHUB-DORKGitHub / GitLab Dorking
  3. 03
    Use AWS deploy creds to assume admin roleLateral Movement
    C-AWS-ASSUMEROLE-CHAINAWS sts:AssumeRole Chain
  4. 04
    Backdoor IAM userPersistence
    C-AWS-IAM-BACKDOORAWS IAM Backdoor User / Access Key
  5. 05
    Open PR — workflow runs in base context with secretsInitial Access
    CI-PR-TARGETGitHub Actions pull_request_target Injection
  6. 06
    Exfil all $SECRETS to attacker hostCredential Access
    CI-SECRET-IN-LOGSecret Echo to Build Log
  7. 07
    Workflow step executes attacker codeExecution
    CI-WORKFLOW-INJECTWorkflow Command Injection

§ References

§ Frequently asked

What is the "pull_request_target injection → secrets → cloud takeover" attack path?
A GitHub Actions workflow runs on pull_request_target and checks out the PR's head SHA. The attacker's PR injects code that runs with the base repo's secrets, including a cloud deploy role. It chains 7 steps drawn from real-world offensive-security techniques.
What starting position does this attack require?
The first step is Fork target repo + push payload (T1078) — a initial access primitive. Assumed environment: target uses GitHub Actions; at least one workflow triggers on pull_request_target (commonly because it needs secrets for labelling / commenting).
What is the final impact of this kill-chain?
The final step lands on Workflow step executes attacker code (CI-WORKFLOW-INJECT), which falls under Execution. From here, an operator typically pivots into post-exploitation or maintains persistence.
How can defenders detect or prevent this attack?
Detection and prevention vary per step. Refer to each linked MITRE ATT&CK entry under "References" — every technique on that page lists defensive controls, detection telemetry, and known threat-actor usage.

§ Related dossiers