AI Security AI安全 4d ago Updated 4d ago 更新于 4天前 46

Snowflake GitHub Actions Flaw Lets Crafted Issues Trigger Command Injection Snowflake GitHub Actions漏洞允许伪造Issue触发命令注入

Wiz disclosed a GitHub Actions workflow injection vulnerability in Snowflake's public `snowflakedb/snowflake-connector-net` repository that allowed crafted GitHub issues to trigger command injection The vulnerable workflow (`jira_issue.yml`) directly interpolated attacker-controlled issue title and body values into a shell `run:` block, exposing Jira credentials (API token, email, base URL) to potential exfiltration Wiz's Red Agent system successfully exploited the flaw during authorized securit Wiz安全团队发现Snowflake的GitHub Actions工作流存在命令注入漏洞,可通过构造的GitHub issue触发远程代码执行 漏洞根因是将用户控制的issue标题和内容直接插入shell run:块,导致Jira API凭证(JIRA_BASE_URL、JIRA_USER_EMAIL、JIRA_API_TOKEN)泄露 Snowflake在漏洞披露后5天内完成修复,确认无未经授权访问证据,Jira令牌已轮换 漏洞与GitHub Copilot Autofix相关,但提交历史未明确证明Copilot是漏洞代码的直接作者 截至2026年8月17日,该漏洞尚未分配CVE编号,未发现

68
Hot 热度
65
Quality 质量
60
Impact 影响力

Analysis 深度分析

TL;DR

  • Wiz disclosed a GitHub Actions workflow injection vulnerability in Snowflake's public snowflakedb/snowflake-connector-net repository that allowed crafted GitHub issues to trigger command injection
  • The vulnerable workflow (jira_issue.yml) directly interpolated attacker-controlled issue title and body values into a shell run: block, exposing Jira credentials (API token, email, base URL) to potential exfiltration
  • Wiz's Red Agent system successfully exploited the flaw during authorized security testing, obtaining a Jira API token with read access to engineering, security compliance, and bug bounty tracking projects
  • Snowflake merged a fix within hours of disclosure (PR #1402 on June 23, 2026), replacing direct expression expansion with environment variables passed safely to jq
  • Snowflake stated no evidence of unauthorized access was found during the five-day exposure window, and the Jira token was rotated on June 24, 2026

Why It Matters

This vulnerability exemplifies the growing class of GitHub Actions workflow injection flaws that arise when untrusted user-generated content (issue titles, bodies, comments) is directly interpolated into shell commands within CI/CD pipelines. For AI practitioners and DevOps teams, it underscores the critical importance of treating all external inputs in workflow files as potentially malicious, regardless of the repository's visibility or perceived trust level. The incident also highlights how AI coding assistants like GitHub Copilot can inadvertently introduce security vulnerabilities when their suggestions are merged without adequate security review.

Technical Details

  • Vulnerable workflow: .github/workflows/jira_issue.yml triggered on public issue open events, directly embedding ${{ github.event.issue.title }} and ${{ github.event.issue.body }} into a run: shell block
  • Credential exposure: The workflow exposed JIRA_BASE_URL, JIRA_USER_EMAIL, and JIRA_API_TOKEN as environment variables accessible to the same step that processed untrusted issue data
  • Bypassed guardrail: The workflow checked github.event.pull_request.user.login against whitesource-for-github-com[bot], but since the event was an issue (not a pull request), this property evaluated to an empty string per GitHub's documented behavior, failing to filter out ordinary issue submissions
  • Exploitation method: Wiz's Red Agent system initially encountered a shell syntax error, adapted its payload, and achieved out-of-band callback confirmation from the GitHub Actions runner, successfully extracting the Jira API token
  • Fix: PR #1402 replaced direct GitHub expression expansion with environment variables passed as arguments to jq, eliminating the injection vector; the fix has been present on the master branch since June 23, 2026

Industry Insight

  • AI-assisted coding requires security validation: Snowflake attributed the flaw to a GitHub Copilot Autofix change, though commit history shows Copilot participated in the PR without directly authoring the vulnerable lines. This reinforces that AI-generated code suggestions must undergo the same security review as human-written code, especially in CI/CD contexts.
  • Workflow injection is a systemic risk: GitHub documented this class of vulnerability as early as July 2025, yet it persisted for five days in a major cloud provider's repository. Organizations should adopt automated scanning for workflow injection patterns (e.g., direct interpolation of event data into run: blocks) as part of their supply chain security posture.
  • No CVE assigned yet, but risk is real: As of August 2026, no CVE, CVSS score, or CISA KEV entry exists for this flaw, and no wild exploitation has been confirmed. However, the successful authorized exploitation and credential access demonstrate that similar patterns in other repositories may be actively exploitable. Teams should proactively audit their GitHub Actions workflows for the same vulnerability pattern.

TL;DR

  • Wiz安全团队发现Snowflake的GitHub Actions工作流存在命令注入漏洞,可通过构造的GitHub issue触发远程代码执行
  • 漏洞根因是将用户控制的issue标题和内容直接插入shell run:块,导致Jira API凭证(JIRA_BASE_URL、JIRA_USER_EMAIL、JIRA_API_TOKEN)泄露
  • Snowflake在漏洞披露后5天内完成修复,确认无未经授权访问证据,Jira令牌已轮换
  • 漏洞与GitHub Copilot Autofix相关,但提交历史未明确证明Copilot是漏洞代码的直接作者
  • 截至2026年8月17日,该漏洞尚未分配CVE编号,未发现实际利用案例

为什么值得看

本文揭示了AI辅助编程工具(GitHub Copilot Autofix)可能引入的安全风险,为DevOps和CI/CD安全实践提供了重要警示。对于使用GitHub Actions的开发者而言,这是一个关于如何处理不可信输入的典型案例,强调了工作流注入防护的必要性。

技术解析

  • 漏洞位置snowflakedb/snowflake-connector-net仓库的.github/workflows/jira_issue.yml工作流文件,该工作流在公开issue创建时触发
  • 注入机制:工作流将攻击者控制的issue标题和内容直接插入shell run:块,同时错误地检查github.event.pull_request.user.login(issue事件中该属性不存在,评估为空字符串),导致防护逻辑失效
  • 利用过程:Wiz的Red Agent系统在授权安全测试中成功利用该漏洞,首次payload遭遇shell语法错误后调整策略,最终获得带外回调并提取Jira API令牌
  • 凭证影响:泄露的令牌属于qa@snowflake.net,可读取snowflakecomputing.atlassian.net上的工程、安全合规和漏洞赏金追踪项目
  • 修复方案:Snowflake通过PR #1402将直接GitHub表达式扩展替换为环境变量传递方式,通过参数传递给jq命令,消除注入风险

行业启示

  • AI辅助编程的安全审查:GitHub Copilot Autofix等AI工具可能引入安全缺陷,团队需建立针对AI生成代码的专项安全审查流程,不能仅依赖自动化测试
  • CI/CD工作流安全最佳实践:GitHub早在2025年7月已文档化此类工作流注入风险,组织应将"不直接在run:块中展开不可信输入"作为强制安全规范,使用环境变量和参数化传递
  • 漏洞响应时效性:Snowflake在5天内完成修复和凭证轮换,展示了良好的安全响应能力,但漏洞在默认分支存在5天且无CVE编号,提醒行业需要更快的漏洞披露和补丁分发机制

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Security 安全 Open Source 开源 Research 科学研究