Skip to content

Policy file path from environment (path traversal) #29

@pimlock

Description

@pimlock

Summary

When loading the dev sandbox policy, the CLI checks the NAVIGATOR_SANDBOX_POLICY environment variable. If set, it is used as a file path and the file is read with std::fs::read_to_string(path). The path is not canonicalized or validated; it is not restricted to a safe directory. If an attacker can set this environment variable, they can read arbitrary files the process can access. Parse failures can leak file content in the error message.

Source Code

  • In crates/navigator-cli/src/run.rs, load_dev_sandbox_policy (lines 1231-1245) does std::env::var("NAVIGATOR_SANDBOX_POLICY"). On success it sets path = Path::new(&policy_path) and calls std::fs::read_to_string(path) with no canonicalization or check that the path stays within a safe tree.

Originally by @drew on 2026-02-19T09:01:55.805-08:00

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions