Skip to content

Security Report: Unauthorized Directory Traversal in Codex #6772

Closed as duplicate

Description

@dikaio

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
  2. Privacy Violation (High)

    • Scanning of personal or confidential documents
    • Violation of data segregation principles
    • Potential compliance violations (GDPR, CCPA, etc.)
  3. Cross-Project Contamination (Medium-High)

    • Risk of information leakage between unrelated projects
    • Potential for unintended code or data correlation
  4. System Reconnaissance (Medium)

    • Ability to map the entire file system structure
    • Identification of installed software and system configuration

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    sandboxIssues related to permissions or sandboxing
    on Nov 17, 2025
  2. github-actions commented on Nov 17, 2025

    @github-actions
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingsandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions