Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in profile and snapshot handling#43

Open
bitcoiner-dev wants to merge 1 commit into
masterfrom
sentinel-path-traversal-fix-2944430463881924379
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in profile and snapshot handling#43
bitcoiner-dev wants to merge 1 commit into
masterfrom
sentinel-path-traversal-fix-2944430463881924379

Conversation

@bitcoiner-dev
Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: Path traversal vulnerability in profile and snapshot path resolution. Path::join inherently replaces paths or navigates backward when provided with absolute strings (/) or relative (..) constructs, which wasn't restricted for command-line inputs.
🎯 Impact: A local user or automated process executing the CLI could perform arbitrary file reads/writes on the system under the permissions of the user running the tool if an attacker crafts malicious CLI arguments (e.g. zinc-cli snapshot save --name ../../../etc/passwd).
πŸ”§ Fix: Implemented strict validation for the profile and snapshot name strings to only permit alphanumeric characters, dashes, and underscores using crate::utils::validate_file_name.
βœ… Verification: Tests run successfully (cargo test --bin zinc-cli). Specifically added test_validate_file_name coverage.


PR created automatically by Jules for task 2944430463881924379 started by @bitcoiner-dev

User-provided `profile` and `snapshot` names were directly passed into
`Path::join` without validation, making the CLI vulnerable to critical
path traversal attacks (e.g. `../../../etc/passwd`).

Introduced a robust `validate_file_name` utility function to enforce an
allowlist of safe characters (alphanumeric, dashes, and underscores) and
added explicit checks in `src/paths.rs` and `src/commands/snapshot.rs`.

Co-authored-by: bitcoiner-dev <75873427+bitcoiner-dev@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant