Skip to content

🛡️ Sentinel: [HIGH] Enforce secure file and directory permissions#1

Merged
bitcoiner-dev merged 2 commits intomasterfrom
sentinel-secure-file-permissions-11202492616986576315
Mar 26, 2026
Merged

🛡️ Sentinel: [HIGH] Enforce secure file and directory permissions#1
bitcoiner-dev merged 2 commits intomasterfrom
sentinel-secure-file-permissions-11202492616986576315

Conversation

@bitcoiner-dev
Copy link
Copy Markdown
Owner

This PR introduces secure file permission enforcements when creating the CLI's configuration directories and saving sensitive files (like wallet profiles and snapshots). By utilizing Unix-specific DirBuilderExt and OpenOptionsExt, the application explicitly requests 0o700 (for directories) and 0o600 (for files) permissions, preventing local users from reading or tampering with these files on shared machines.

This change documents the security pattern within .jules/sentinel.md.


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

Severity: HIGH
Vulnerability: The application creates sensitive files (wallets, snapshots) using `fs::create_dir_all` and `fs::write` which default to the system's `umask`, potentially exposing them to other local users.
Impact: Local privilege escalation or exposure of wallet secrets on shared Unix-like systems.
Fix: Created secure wrappers using `DirBuilderExt` and `OpenOptionsExt` to enforce `0o700` and `0o600` permissions respectively. Updated usages in `src/paths.rs`. Documented the learning in `.jules/sentinel.md`.
Verification: Compile and verify permissions on Unix systems.

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.

@bitcoiner-dev
Copy link
Copy Markdown
Owner Author

@jules can you check if we can merge this to latest master? Do we need to do anything else in the light of recent changes?

@google-labs-jules
Copy link
Copy Markdown
Contributor

@jules can you check if we can merge this to latest master? Do we need to do anything else in the light of recent changes?

I've checked the changes against the current state of the repository. The modifications are isolated to src/paths.rs and introduce new utility functions (create_secure_dir_all and write_secure_file) replacing standard fs calls. These changes are straightforward, self-contained, and do not conflict with recent updates. The changes are ready to be merged, and no further action is required.

Severity: HIGH
Vulnerability: The application creates sensitive files (wallets, snapshots) using `fs::create_dir_all` and `fs::write` which default to the system's `umask`, potentially exposing them to other local users.
Impact: Local privilege escalation or exposure of wallet secrets on shared Unix-like systems.
Fix: Created secure wrappers using `DirBuilderExt` and `OpenOptionsExt` to enforce `0o700` and `0o600` permissions respectively. Updated usages in `src/paths.rs`. Documented the learning in `.jules/sentinel.md`.
Verification: Compile and verify permissions on Unix systems.

Co-authored-by: bitcoiner-dev <75873427+bitcoiner-dev@users.noreply.github.com>
@bitcoiner-dev bitcoiner-dev merged commit 9fc14fb into master Mar 26, 2026
10 checks passed
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