Security Report: Unauthorized Directory Traversal in Codex

Resolved 💬 1 comment Opened Nov 17, 2025 by dikaio Closed Nov 17, 2025

What version of Codex is running?

codex-cli 0.58.0

What subscription do you have?

Business Plan

Which model were you using?

gpt-5.1-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

Codex, when operating within a specific project context (e.g., ProjectA - a Next.js application), is performing file system operations that extend beyond the authorized project directory. Specifically:

  • Expected Behavior: Codex should only access files within /path/to/projectA/
  • Actual Behavior: Codex uses commands like grep to traverse and scan arbitrary directories across the entire operating system
  • Scope Violation: No authorization has been granted for accessing files outside the current project scope

What steps can reproduce the bug?

  1. Initialize Codex within a Next.js project (ProjectA)
  2. Monitor file system access using system monitoring tools
  3. Observe grep commands being executed with paths outside projectA/

Example of Unauthorized Access

# Expected (authorized) operation:
grep -r "pattern" /home/user/projectA/

# Observed (unauthorized) operation:
grep -r "pattern" /home/user/
grep -r "pattern" /

What is the expected behavior?

Codex should respect the user's scope. There are potentially huge implications for not doing so.

  1. Data Exposure (Critical)
  • Unauthorized access to sensitive files outside project scope
  • Potential exposure of credentials, API keys, and configuration files
  • Access to other projects' proprietary source code
  1. Privacy Violation (High)
  • Scanning of personal or confidential documents
  • Violation of data segregation principles
  • Potential compliance violations (GDPR, CCPA, etc.)
  1. Cross-Project Contamination (Medium-High)
  • Risk of information leakage between unrelated projects
  • Potential for unintended code or data correlation
  1. System Reconnaissance (Medium)
  • Ability to map the entire file system structure
  • Identification of installed software and system configuration

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗