You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Data dir override: refuse a parent directory chain that other users can modify (Unix) #1750
A data directory override is also refused when a directory in the parent chain of the pointer file or data directory can be replaced by another local user.
Context
Follow-up of #1717 (PR #1734): only the pointer file, its immediate trust and the data directory itself are checked (data_dir_trust.rs:79-148). If a parent is writable by others (e.g. a world-writable folder without sticky bit), another user can rename the parent and substitute their own content, similar to sshd's StrictModes. Spec 0115 §4.1 defines the current rules.
Requirements
On Unix, walk the ancestors of the data directory and of the pointer file up to the root. Refuse an ancestor that is group/world-writable without the sticky bit, or not owned by the current user or root.
Do not refuse the system root hierarchy that is standard (/, /home, /tmp with sticky bit).
Windows is out of scope (separate issue); state this in the spec.
Reason strings name the offending ancestor.
Acceptance Criteria
A writable-by-others parent without sticky bit is refused with a reason naming it
A sticky-bit parent such as /tmp is accepted
A parent owned by another non-root user is refused
Normal default locations (home directory) still start
Spec 0115 and THREAT-MODEL.md describe the rule; changelog fragment added
Security-critical path. Unix only. Use lstat-style metadata; symlinks in ancestors are resolved first (canonicalise) and the resolved chain is checked.
Check ancestors up to root or only up to the home directory: recommended up to root with the sticky-bit exception. Alternative: stop at the home directory.
Needs maintainer: The issue waits for #1733, but "blocked by" could not be set. Set it on the issue (Relationships), then remove needs-maintainer: The code this issue extends (crates/persistence-sqlite/src/data_dir_trust.rs from #1734) exists only on release/0.8.0; it reaches develop with the open back-merge PR #1733. Nothing to attach the ancestor-chain check to on develop yet.
Activity
smart-ssh-coder commentedon Dec 5, 2026
Needs maintainer: The issue waits for #1733, but "blocked by" could not be set. Set it on the issue (Relationships), then remove needs-maintainer: The code this issue extends (crates/persistence-sqlite/src/data_dir_trust.rs from #1734) exists only on release/0.8.0; it reaches develop with the open back-merge PR #1733. Nothing to attach the ancestor-chain check to on develop yet.