Monday, September 7, 2026

Microsoft Warns Claude Code GitHub Action May Expose CI/CD Secrets

Anthropic’s Claude Code GitHub Action could unintentionally expose CI/CD workflow secrets when AI agents process untrusted GitHub content.

The risk arises because certain tools the agent uses to read files were not sandboxed like subprocess execution paths such as Bash. In particular, the Read tool was able to access /proc/self/environ and returned environment variables, including ANTHROPIC_API_KEY and potentially other credentials available to the runner.

Researchers began this work after noticing prompt injection attempts in public repositories where AI-assisted workflows from several vendors processed attacker-controlled issue bodies, pull request descriptions, or comments.

Attackers hid malicious instructions in places that are invisible to standard browsing HTML comments inside issues, for example but still visible to models that read raw markdown.

HTML comment hidden inside an issue opened by the actor (Source : Microsoft).
HTML comment hidden inside an issue opened by the actor (Source : Microsoft).

In one observed campaign, a fork of a popular documentation project used a permissive workflow that gave an AI bot broad tools: searching the repository, reading files, creating commits, and opening pull requests.

An attacker could craft a seemingly normal feature request that instead contained a precise sequence of commands. The AI followed those steps, locating the target file, appending an invisible XSS payload, and opening a pull request that, if merged, would silently exfiltrate visitor session tokens when the site rendered the poisoned page.

The same attack logic makes the Read tool vulnerability dangerous. If an attacker can influence the agent’s behavior through injected prompts, they can steer the agent to sensitive files accessible in the CI runner.

GitHub Actions runners can contain repository contents, event metadata, the GITHUB_TOKEN, cloud credentials, and third-party API keys. When these values are available to an AI agent that reads untrusted content, the trust boundary collapses.

Tool permissions, model selection, and most other runtime behavior are SDK options that the action is responsible for setting.

Attack flow (Source : Microsoft).
Attack flow (Source : Microsoft).

Researchers in Microsoft began this work after noticing prompt injection attempts in public repositories where AI-assisted workflows from several vendors processed attacker-controlled issue bodies, pull request descriptions, or comments.

Anthropic had implemented environment scrubbing and Bubblewrap sandboxing for subprocesses such as Bash, which helps prevent environment variables leaking when those tools run.

However, the Read tool performed in-process file reads and bypassed the sandbox. Microsoft’s team constructed a prompt injection that first had the model read /proc/self/environ, then launder the found key before output so safety filters and GitHub’s secret scanner would not detect it.

Microsoft Warns Claude Code GitHub

The Read tool returned the unscrubbed environment, exposing ANTHROPIC_API_KEY. From there, an attacker could exfiltrate credentials through a web fetch, a GitHub comment, or by writing to logs.

Read tool accesses /proc/self/environ (Source : Microsoft).
Read tool accesses /proc/self/environ (Source : Microsoft).

Microsoft disclosed the issue to Anthropic via HackerOne. Anthropic released Claude Code version 2.1.128 on May 5, 2026, which blocks access to sensitive /proc files and prevents this particular exfiltration path.

This mitigation reduces the immediate risk, but defenders should still treat AI workflows that process untrusted GitHub content as high-risk when they also have access to secrets, file-read tools, or external communication channels.

Practical hardening steps include applying the “Agents Rule of Two”: ensure no AI workflow simultaneously processes untrusted input, holds secrets or sensitive access, and can change state or communicate externally.

Enforce least privilege for every token, scope API keys narrowly, and monitor usage for anomalies. Strengthen the system prompt and explicitly declare trust boundaries in the workflow so the agent treats issue bodies, PRs, and file contents as untrusted data, not instructions.

Finally, pin the workflow to a single clear task and have it refuse anything outside that scope.

As AI agents become more common in CI/CD, these patterns sandboxing, strict token scoping, explicit trust models, and minimal privileges are essential to prevent prompt injection and secret exfiltration in automated development pipelines.

Follow us on Google NewsLinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Mayura Kathir
Mayura Kathirhttps://gbhackers.com/
Mayura Kathir is a cybersecurity reporter at GBHackers News, covering daily incidents including data breaches, malware attacks, cybercrime, vulnerabilities, zero-day exploits, and more.

Hot this week

How To Access Dark Web Anonymously and know its Secretive and Mysterious Activities

What is Deep Web The deep web, invisible web, or...

How to Build and Run a Security Operations Center (SOC Guide) – 2023

Today’s Cyber security operations center (CSOC) should have everything...

Russian Hackers Bypass EDR to Deliver a Weaponized TeamViewer Component

TeamViewer's popularity and remote access capabilities make it an...

Web Server Penetration Testing Checklist – 2026

Web server pentesting is performed under three significant categories: identity,...

ATM Penetration Testing – Advanced Testing Methods to Find The Vulnerabilities

ATM Penetration testing, Hackers have found different approaches to...

Chainguard Hits 1 Billion Build Manifests With AI-Powered Software Supply Chain Security

Chainguard has surpassed 1 billion container build manifests, doubling...

Russian Hackers Deploy New HOOKEDGE Backdoor in Espionage Attacks Across Europe

Russian state-sponsored threat actor BlueDelta, also tracked as APT28,...

New Panzer Ransomware Hits 16 Victims Across 11 Countries With Data Theft and Encryption

Panzer ransomware has emerged as a new Ransomware-as-a-Service (RaaS)...

12-Year-Old PostgreSQL Flaw Lets Attackers Execute Code and Take Over Database Servers

A critical PostgreSQL vulnerability dubbed PostGREShell could allow low-privileged...

Hackers Use Frontier AI Agents to Breach Enterprise Network in Under 10 Hours

A threat actor used frontier artificial-intelligence models and attack-specific...

CARS24 Data Breach Exposes 3,100 Customer Records, Leads Allegedly Sold for ₹1,000 Each

Used-car platform CARS24 has alleged that confidential information belonging...

Hackers Turn HiveMQ and Element Messenger Into Control Channels for Windows Backdoors

The financially motivated threat actor Toy Ghouls has expanded...

Related Articles

Recent News