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
[Seatbelt] Fix symlink and parent-traversal policy enforcement - #1531
Elliot (theelliotm)
changed the title
Fix Seatbelt symlink and parent-traversal policy enforcement
[Seatbelt] Fix symlink and parent-traversal policy enforcement
Oct 19, 2026
[P2] symlink_metadata checks the link itself, not whether its target can be traversed. For a link whose stored target is file/../secret, with file a regular file and secret an existing sibling, macOS canonicalization can fold .. without rejecting the invalid traversal. A readwritePaths entry for that link can therefore grant access to secret instead of failing before launch. Check the followed target with metadata before accepting canonicalization, and extend the macOS executor regression cases to reject parent traversal inside a symlink target.
The reason will be displayed to describe this comment to others. Learn more.
Consider using resolve_policy_path instead of expand_tilde in resolved_working_directory_opt. Otherwise, a working directory with a symlink and .. sets PWD and default HOME to the unresolved path instead of the real directory.
The reason will be displayed to describe this comment to others. Learn more.
Consider stopping .. popping in resolve_through_symlinks once a symlink fails to resolve, or skipping the mask in resolve_denied_paths when resolved.error is set. Right now, a denied path like /work/dangling/../secret pops the broken link and masks the unrelated path /work/secret.
The reason will be displayed to describe this comment to others. Learn more.
Consider calling prepare_profile in SeatbeltScriptRunner::validate as well as spawn. Currently, mxc-exec-mac --dry-run skips prepare_profile and passes on broken symlinks or loops that fail at launch.
The reason will be displayed to describe this comment to others. Learn more.
Consider resolving symlinks on the user_keychains path with resolve_policy_path when keychainAccess is enabled. If HOME sits under a symlinked root like /var/root or /home, the generated Seatbelt rule uses the unresolved path and will not match.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 Description
.., preserving deny/read-only precedence across aliases...rejection test.🔗 References
No linked issue. Updates
docs/backends/seatbelt/seatbelt-backend.md.🔍 Validation
cargo test --locked --quiet -p mxc-sdk --lib -- seatbeltcargo fmt --all -- --checkcargo clippy --locked --quiet -p mxc-sdk --lib --tests -- -D warningscargo clippy --locked --quiet -p mxc-sdk --lib --tests --target x86_64-unknown-linux-gnu -- -D warningscargo build --locked --quiet -p mxc_darwinMXC_EXEC_MAC="$PWD/src/target/debug/mxc-exec-mac" bash tests/scripts/run_seatbelt_symlink_test.shMXC_EXEC_MAC="$PWD/src/target/debug/mxc-exec-mac" bash tests/scripts/run_seatbelt_options_test.sh✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see pull request builds)📋 Issue Type
Microsoft Reviewers: Open in CodeFlow