피드로 돌아가기
OpenAI Codex Had a Command Injection Bug That Could Steal Your GitHub Tokens
Dev.toDev.to
Security

OpenAI Codex가 branch name 검증 부재로 GitHub OAuth token 탈취 취약점을 보유하고 있었음

OpenAI Codex Had a Command Injection Bug That Could Steal Your GitHub Tokens

Not Elon2026년 3월 30일2intermediate

Context

Codex는 managed container 환경에서 GitHub repo를 clone하고 short-lived OAuth token으로 인증하는 구조이다. Container 내부에서 branch name이 shell command에 검증 없이 그대로 전달되는 입력 검증 부재가 핵심 문제였다.

Technical Solution

  • Branch name → Shell command 전달 전 character escaping 및 검증 적용
  • OAuth token scope → Repository 접근 권한 read-only로 최소화
  • Container network access → 외부 네트워크 egress 필터링 적용
  • Dependency pinning → Package version 명시적 고정으로 supply chain 공격 방어
  • Security scanner 통합 → Branch name, commit message, config file 내 exposed secrets 자동 탐지

Impact

구체적 수치 없음

Key Takeaway

AI coding agent는 autocomplete가 아닌 실제 명령 실행 환경이며, credentials 접근 권한을 가진다. Container 격리만으로 보안이 보장되지 않는다.


Codex 및 AI coding tool 환경에서 branch name, commit message 등 사용자 입력을 shell command에 전달할 때 sanitization을 적용하고, OAuth token scope를 read-only로 최소화하여 command injection 및 token 탈취 공격을 방어한다

원문 읽기