An AI commit deleted a Snowflake workflow's injection guard. An agent walked in five days later.
Copilot Autofix swapped an env-var-and-jq pattern for inline interpolation in a public GitHub Actions file, and Wiz's autonomous agent exploited it inside a week.
The Engineer · Build desk
What happened
- The target was snowflakedb/snowflake-connector-net, a public repository whose jira_issue.yml workflow ran on issues: opened, meaning any GitHub user could trigger it by filing an issue on the public repo.
- On June 18, 2026, a commit (4a1b8ce, PR #1218) co-authored by Copilot Autofix rewrote part of the workflow.
- The AI removed the repository's existing safe pattern, which passed the issue title through an env: variable and built the JSON payload with jq, and replaced it with direct string expansion of the untrusted title inside a shell script.
- The replacement code read: TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\\"/g' | sed "s/'/\\'/g")
- GitHub expands ${{ github.event.issue.title }} before the shell sees the script, so the sed escaping runs too late and can never work; a single quote in the title lands inside the shell source, breaks out of echo '...', and the rest of the line executes as a command.
Why it matters
A commit co-authored by Copilot Autofix removed the injection guard from a GitHub Actions workflow in Snowflake's public .NET connector repository, and an autonomous security agent exploited the result five days later [1][5][2][14]. The operational lesson is narrow and unglamorous: CI/CD workflow files are not ordinary code, and an AI-authored diff that touches one belongs in a different review queue than a diff to application logic.
The account comes from Wiz Research, whose write-up "Red Agent Exploits Snowflake Vuln Created by Copilot Autofix" was published on August 17 and summarised in a dev.to post [12]. The target was `snowflakedb/snowflake-connector-net`, a public repository whose `jira_issue.yml` workflow ran on `issues: opened`, so any GitHub user could trigger it by filing an issue [4]. On June 18, 2026, commit `4a1b8ce` (PR #1218), co-authored by Copilot Autofix, rewrote part of that workflow [1]. The existing pattern passed the issue title through an `env:` variable and built the JSON payload with `jq --arg`; the AI replaced it with direct string expansion of the untrusted title inside a shell script [5].
What makes this worth studying is that the replacement looks defensive. It reads `TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\\"/g' | sed "s/'/\\'/g")` [6]. GitHub expands the expression before the shell ever sees the script, so the `sed` escaping runs on already-expanded text and can never work; a single quote in an issue title terminates `echo '...'` and the remainder of the line executes as a command [7]. GitHub's own contexts documentation states the rule the original code relied on: expressions are evaluated before the command runs, so anything from an event payload that reaches a `run:` block must go through `env:` [8].
A second control was decorative. The workflow's `if:` condition tested `github.event.pull_request.user.login` against a bot name, but on `issues` events `github.event.pull_request` is always `null`, so the comparison is always true and every user passed the gate [10]. Per the write-up, a condition that silently evaluates to true because the field does not exist in that trigger's schema is worse than no condition, because it reads as protection [11].
On June 23, 2026, Wiz's Red Agent, an autonomous research agent working through Snowflake's HackerOne program, found the script injection, exploited it, pulled credentials from the runner, and reported the same day [2]. The exfiltrated token authenticated as `qa@snowflake.net` and granted read access across Snowflake's engineering, security compliance, and bug bounty tracking projects on Atlassian [3]. Snowflake patched within hours in commit `1dc7766` (PR #1402), restored the safe pattern, and rotated the credential [17]. Public disclosure followed on July 25, 2026, 32 days later, under Snowflake's disclosure policy [13][15].
The framing to resist is "an AI wrote a bug." Per the write-up, the assistant completed a security regression rather than introducing a defect: the `env:`-plus-`jq` construction it deleted was an explicit anti-injection design, not incidental style [16]. That is the reviewable difference. A reviewer skimming a workflow diff sees escaping added and interpolation tidied, which looks like an improvement, and the trigger surface behind it was open to anyone with a GitHub account [4]. A proof of concept that cost nothing to run produced broad read access to a major company's internal tooling [9].
Worth watching: whether teams start treating `.github/workflows` as a protected path with mandatory human security review for machine-authored commits, whether linting catches guard conditions that reference fields absent from the firing event's schema [10][11], and how many more of these regressions surface through bounty programs now that agents are hunting them at this speed [2].
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence72
- Adoption
- Not scored
- Hype gap+35
- Incentives65
- Confidence62
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
On June 18, 2026, a commit (4a1b8ce, PR #1218) co-authored by Copilot Autofix rewrote part of the workflow.
- [2]
On June 23, 2026, Wiz's Red Agent, an autonomous AI security research agent working through Snowflake's HackerOne program, discovered the script injection, exploited it, pulled credentials out of the runner, and Wiz disclosed the same day.
- [3]
The exfiltrated token authenticated as qa@snowflake.net and granted read access across Snowflake's engineering, security compliance, and bug bounty tracking projects on Atlassian.
- [4]
The target was snowflakedb/snowflake-connector-net, a public repository whose jira_issue.yml workflow ran on issues: opened, meaning any GitHub user could trigger it by filing an issue on the public repo.
- [5]
The AI removed the repository's existing safe pattern, which passed the issue title through an env: variable and built the JSON payload with jq, and replaced it with direct string expansion of the untrusted title inside a shell script.
- [6]
The replacement code read: TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\\"/g' | sed "s/'/\\'/g")
- [7]
GitHub expands ${{ github.event.issue.title }} before the shell sees the script, so the sed escaping runs too late and can never work; a single quote in the title lands inside the shell source, breaks out of echo '...', and the rest of the line executes as a command.
- [8]
GitHub's own contexts documentation says workflow expressions are evaluated before the command runs, so anything from an event payload that touches a run: block must go through an env: variable, never inline interpolation.
- [9]
A proof-of-concept that cost nothing to run turned into broad read access inside a major company's internal tooling.
- [10]
The workflow's if: condition was (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'); on issues events github.event.pull_request is always null, so the condition reduces to null != 'whitesource-for-github-com[bot]', which is always true, and every GitHub user passed the gate including the attacker.
- [11]
The write-up argues guard conditions must be checked against the actual event schema for the trigger that fires them, and that a condition which silently evaluates to true because a field does not exist is worse than no condition at all because it reads as protection.
- [12]
Wiz Research published the full write-up, titled "Red Agent Exploits Snowflake Vuln Created by Copilot Autofix", on August 17.
- [13]
Public disclosure occurred on July 25, 2026, per Snowflake's disclosure policy.
- [14]
Five days elapsed between the Copilot Autofix commit and the agent's exploitation of the resulting injection.
- [15]
Public disclosure came 32 days after the exploitation and same-day patch.
- [16]
The write-up argues the AI completed a security regression rather than a bug: the removed pattern was not incidental, because passing untrusted input through env: and parsing with jq was an explicit anti-injection design.
- [17]
On June 23, 2026, Snowflake patched the workflow in hours (commit 1dc7766, PR #1402), restored the safe pattern, and rotated the affected credential.
Sources
2 independent publishers whose own reporting we read for this story.
- dev.toCopilot Autofix Introduced a Critical CI/CD Bug at Snowflake. Here's How to Harden GitHub Actions
3 articles · August 17, 2026
- runtimewire.comWiz says Red Agent exploited a Snowflake workflow flaw introduced by Copilot
1 article · August 17, 2026
Topics and entities
Topics
- AI Coding Assistants
- GitHub Actions Script Injection
- Autonomous Security Agents
- Coordinated Vulnerability Disclosure