惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
量子位
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
博客园 - 聂微东
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog

Step Security Blog

Announcing Dependabot Configuration Enhancements: Cooldown and Group Support - StepSecurity Securing Vibe Coding and AI Coding Agents: An End-to-End Approach with StepSecurity - StepSecurity Introducing StepSecurity Dev Machine Guard: Protecting Developer Machines from Supply Chain Attacks - StepSecurity Top 2024 Predictions for CI/CD Security - StepSecurity Dev Machine Guard Is Now Open Source: See What's Really Running on Your Developer Machine - StepSecurity Datadog's DevSecOps 2026 Report Validates What We've Been Building - StepSecurity hackerbot-claw: An AI-Powered Bot Actively Exploiting GitHub Actions - Microsoft, DataDog, and CNCF Projects Hit So Far - StepSecurity Cline Supply Chain Attack Detected: cline@2.3.0 Silently Installs OpenClaw - StepSecurity StepSecurity’s Unified Protection Across the SDLC Infrastructure Threat Framework (SITF) - StepSecurity @velora-dex/sdk Compromised on npm: Malicious Version Drops macOS Backdoor via launchctl Persistence - StepSecurity axios Compromised on npm - Malicious Versions Drop Remote Access Trojan - StepSecurity Behind the Scenes: How StepSecurity Detected and Helped Remediate the Largest npm Supply Chain Attack - StepSecurity 10 Layers Deep: How StepSecurity Stops TeamPCP's Trivy Supply Chain Attack on GitHub Actions - StepSecurity Malicious IoliteLabs VSCode Extensions Target Solidity Developers on Windows, macOS, and Linux with Backdoor - StepSecurity TeamPCP Plants WAV Steganography Credential Stealer in telnyx PyPI Package - StepSecurity litellm: Credential Stealer Hidden in PyPI Wheel - StepSecurity Checkmarx KICS GitHub Action Compromised: Malware Injected in All Git Tags - StepSecurity CanisterWorm: How a Self-Propagating npm Worm Is Spreading Backdoors Across the Ecosystem - StepSecurity Trivy Compromised a Second Time - Malicious v0.69.4 Release, aquasecurity/setup-trivy, aquasecurity/trivy-action GitHub Actions Compromised - StepSecurity bittensor-wallet 4.0.2 Compromised on PyPI - Backdoor Exfiltrates Private Keys - StepSecurity Malicious npm Releases Found in Popular React Native Packages - 130K+ Monthly Downloads Compromised - StepSecurity Malicious Polymarket Bot Hides in Hijacked dev-protocol GitHub Org and Steals Wallet Keys - StepSecurity ForceMemo: Hundreds of GitHub Python Repos Compromised via Account Takeover and Force-Push - StepSecurity xygeni-action Compromised: C2 Reverse Shell Backdoor Injected via Tag Poisoning - StepSecurity kubernetes-el Compromised: How a Pwn Request Exploited a Popular Emacs Package - StepSecurity How StepSecurity Caught a Release Storm in Microsoft’s @types Packages - StepSecurity Harden Runner Now Supports Windows and macOS GitHub Actions Runners - StepSecurity 10,000 Open-Source Projects Now Secured by Harden-Runner Community-Tier: A Milestone Three Years in the Making - StepSecurity 20+ Popular NPM Packages Compromised (Chalk, Debug, Strip-ANSI, Color-Convert, Wrap-ANSI...) - StepSecurity 2024 in Review: The Evolution of CI/CD Security & What's Next - StepSecurity
Grafana GitHub Actions Security Incident - StepSecurity
2025-07-08 · via Step Security Blog

Introduction

On Saturday, April 26, 2025, Grafana Labs disclosed that an unauthorized user leveraged a vulnerability in a GitHub Actions workflow within a public Grafana Labs repository. This led to the exposure of a small number of secrets. Grafana Labs stated that their detections immediately triggered alerts, and the team responded by mitigating the vulnerability, rotating keys, and verifying that there was no access to production systems or data.

Grafana Labs plans to share more detailed information in a forthcoming blog post.

Independent security researcher Adnan Khan shared information about this incident publicly on Twitter.

Timeline of Key Updates

April 28, 2025 10:00 PM UTC – Grafana Labs officially disclosed the incident on LinkedIn.

Observed Details

Initial Access: Exploitation of Pwn Request

This is most likely how the initial credential was compromised. A GitHub Actions workflow named pr-patch-check-event.yml in the grafana/grafana repository was configured to trigger on pull_request_target events and contained a combination of Pwn Request and script injection vulnerablities .The workflow contained the following behavior.

Trigger

pull_request_target

Steps  

- Generate a GitHub App token using the tibdex/github-app-token action.  

- Use the GitHub App token to dispatch a workflow in another repository (grafana/security-patch-actions).

Secrets

The secrets GRAFANA_DELIVERY_BOT_APP_ID and GRAFANA_DELIVERY_BOT_APP_PEM were used to generate the token. Due to the use of the pull_request_target trigger, these secrets were available to the workflow even when pull requests were opened from external forks.

This is most likely how the initial credential was compromised. The attacker exploited a script injection vulnerability by crafting a branch name that escaped out of the literal context and executed JavaScript to exfiltrate the credential.

Screenshot of the pr-patch-check-event.yml workflow showing the pull_request_target trigger and inputs

What is Pwn Request Vulnerability?


A Pwn Request is a vulnerability in GitHub Actions where a workflow kicked off by an external pull request runs with repository-level permissions and injected secrets. If the workflow references attacker-controlled input, such as the branch name, without proper sanitization, the untrusted code can execute during the CI run and steal CI/CD credentials and backdoor production software builds.

In the Grafana incident, the pr-patch-check-event.yml workflow executed on the pull_request_target trigger, which automatically supplied two GitHub-App secrets to every run. An external contributor most likely crafted a branch name that escaped its expected context and ran a short script that exfiltrated those secrets. The compromise occurred during the very first workflow run launched by the untrusted pull request; no merge or further privilege escalation was required.

For a full primer on Pwn Request attacks and hardening guidance, see GitHub Actions "Pwn Request" Vulnerability.

What is Script Injection Vulnerability?

A script injection vulnerability in GitHub Actions appears whenever an inline shell or JavaScript statement inside the workflow interpolates attacker-controlled values - such as the branch name, pull-request title, or issue comment - without proper quoting or sanitization. By slipping characters that break out of the intended literal context (for example, using back-ticks, $() command substitution, or unescaped quotes), an outsider can smuggle arbitrary commands into the runner, siphon off environment variables, and ultimately steal secrets or tamper with build artifacts.

In the Grafana incident, the vulnerable pr-patch-check-event.yml workflow may have echoed the untrusted branch name inside a Node script. In that case, the attacker could have created a branch with specially crafted name to achieve remote code-execution in the very first CI run.

For a deeper dive into identifying and hardening against script-injection patterns, see our guide Defend Your GitHub Actions CI/CD Environment in Public Repositories

Subsequent Actions: Pushing a Malicious Workflow

You can view an interactive demo of the exploit code below.

After obtaining access to the bot credentials, the attacker used the GitHub App token to push a malicious workflow into the grafana/grafana repository. The malicious commit added a workflow named hrgqavynjp with the following behavior: - Trigger: Pushes to a branch named hrgqavynjp.

Steps

- Serialize all available GitHub Actions secrets into a file.  

- Encrypt the secrets using AES-256-CBC encryption.  

- Encrypt the AES key using a hardcoded RSA public key.  

- Upload both the encrypted secrets and the encrypted key as GitHub Actions artifacts.

Screenshot of the malicious GitHub Actions workflow used to exfiltrate secrets.

Activity Evidence

The GitHub activity feed for the grafana/grafana repository shows that the grafana-delivery-bot account created a new branch (hrgqavynjp) and made a commit adding the malicious workflow, followed by deletion of the branch.

Screenshot showing the grafana-delivery-bot pushing and deleting the branch used for the malicious workflow

Mitigation strategies

The following section describes security best practices to avoid such GitHub Actions security incidents.


Avoid risky triggers wherever possible

Where feasible, replace high-risk triggers such as pull_request_target with safer alternatives such as pull_request and workflow_dispatch so that untrusted code from forks never runs with elevated privileges or inherited secrets. If the risky trigger is truly required (for example, to lint patches from forks), scope its permissions narrowly and run it on an isolated runner that has no access to production credentials.

Audit secrets – especially the ones used by risky-trigger workflows

Compile an inventory of every secret referenced in workflows that use, reusable workflows called from forks, or any job that runs on self-hosted runners. Validate that each secret is still needed, rotate it regularly, and monitor its usage. Treat any unexplained access as a potential compromise and investigate immediately.

Leverage Environment Secrets and Mandatory Reviews for Production Secrets

Environment secrets are stored at an environment level. They enable you to implement guardrails by enforcing mandatory reviews. This means they can only be accessed by an authorized reviewer who can approve the GitHub Actions workflow run. No job will have access to these secrets without the approval of the reviewer.  

Environment secrets also allow you to implement other quality gates including static code analyzers that can flag issues and ensure the absence of vulnerable dependencies in the GitHub workflow.

Enable network and runtime monitoring (Harden-Runner)

Static checks can miss novel attacks, so enable continuous runtime monitoring on every runner. StepSecurity Harden-Runner inspects network calls, file writes, and process activity during the job and raises real-time detections if it sees suspicious behavior (for example, mass-export of secrets or outbound traffic to an unexpected host). These signals give responders precious minutes to revoke tokens and quarantine artifacts before damage spreads. Harden-Runner community tier is free for open-source projects.

Use least-privileged GitHub App permissions

Even if the compromised bot in this incident was not over-privileged, limiting a GitHub App to the minimum permissions and repository access it legitimately requires shrinks the blast radius of any credential leak. Review each permission (content, issues, workflows, administration, etc.) and set it to Read-only or remove it entirely unless it is demonstrably needed. Re-evaluate scopes whenever the app’s functionality changes.

Require approval for workflow runs from public fork

This is a must-have setting for public repositories that use GitHub Actions. In your public GitHub organization / repository, you can select when GitHub Action should wait for explicit approval before running workflows for forked pull request.

Current Status

As of April 28, 2025:

- GitHub Actions have been disabled across all public Grafana Labs repositories.

- Grafana Labs has completed its internal investigation and published a detailed blog post with additional information