π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in Snapshot Command#26
π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in Snapshot Command#26bitcoiner-dev wants to merge 1 commit intomasterfrom
Conversation
Added `validate_file_name` in `src/utils.rs` to restrict file names to alphanumeric characters, hyphens, and underscores. Applied this validation in the `snapshot` command to prevent path traversal attacks via user-supplied names. Switched the snapshot directory creation to use `crate::paths::create_secure_dir_all`. Co-authored-by: bitcoiner-dev <75873427+bitcoiner-dev@users.noreply.github.com>
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: CRITICAL
π‘ Vulnerability: Path traversal in the
snapshotcommand via unvalidatednamearguments passed directly toPathBuf::join. Standard directory creation viafs::create_dir_allcould also have insecure default permissions.π― Impact: An attacker could read from or write to unintended files/directories outside the standard profile directory using sequences like
../.π§ Fix: Added a new utility
validate_file_namethat restricts input to alphanumeric characters, dashes, and underscores. Enforced this validation on thenameargument in the snapshot command. Replaced standardfs::create_dir_allwithcreate_secure_dir_allto ensure secure permissions.β Verification: Verified compilation and successfully passed the test suite locally. Evaluated secure pathing constraints using a simulated code review.
PR created automatically by Jules for task 9740700310746200504 started by @bitcoiner-dev