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
Warn about hidden Bubblewrap resolver targets - #1441
This PR adds an advisory warning when a direct, absolute /etc/resolv.conf
symlink points to a canonical regular file clearly outside Bubblewrap's
mounts. It names a read-only policy remedy or link repair without changing
mounts or the execution outcome.
Part of #507. This is the separate resolver diagnostic recommended when #1160 was closed; the cwd advisory is #1442. Neither PR alone closes#507.
Details
Check baseline, virtual, and policy mount destinations conservatively;
defer relative, chained, and ambiguous resolver paths to Bubblewrap.
Compare mount paths by components so repeated or trailing separators
cannot cause false warnings.
Cover root and emitted mount destinations in command-builder tests.
Test a real temporary resolver symlink and file without changing host /etc, and document SDK/CLI warning delivery.
This PR warns when a direct, absolute /etc/resolv.conf symlink points to a
canonical regular file clearly outside Bubblewrap's mounts. It names a
read-only policy remedy or link repair without changing mounts or the
execution outcome.
Details
* Check baseline, virtual, and policy mount destinations conservatively,
deferring relative, chained, and ambiguous resolver paths to Bubblewrap.
* Cover root and emitted mount destinations in command-builder tests.
* Test a real temporary resolver symlink and file without modifying host
/etc, and document warning delivery for SDK and CLI callers.
Tests
* cargo fmt --all -- --check: passed.
* cargo check -p mxc-sdk --all-targets --quiet: passed.
* cargo clippy -p mxc-sdk --all-targets --quiet -- -D warnings: passed.
* cargo test -p mxc-sdk --lib bwrap_command --quiet: 52 passed.
* Linux-target mxc-sdk all-target check and Clippy: passed.
* Native Linux Bubblewrap execution was not run on this Windows host.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6f448a40-019f-4bfd-82e0-ec6b7d23c4d8
Generated-with: gpt-6-sol
Gudge (MGudgin)
changed the title
feat(bwrap): warn on clearly hidden resolver symlink targets
Warn about hidden Bubblewrap resolver targets
Oct 7, 2026
/tmp and /var/run are not host-content mounts. --tmpfs /tmp creates an empty filesystem, and --symlink /run /var/run only redirects lookup; neither makes a host resolver file such as canonical /tmp/resolv.conf or /var/run/custom/resolv.conf available. Treating these destinations as overlap therefore suppresses the advisory for targets that are clearly hidden, contrary to the PR's stated behavior (the new test even incorrectly classifies /tmp/resolv.conf as covered). Count only mounts that expose the target's host contents, and handle /var/run by checking the corresponding /run target against actual bind mounts rather than considering the whole subtree covered.
Correct test expectation for hidden files under tmpfs
This expectation encodes the same incorrect assumption: Bubblewrap's --tmpfs /tmp is empty and does not expose the host file /tmp/resolv.conf. This case should assert that the target is hidden so the regression test exercises the promised diagnostic.
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
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.
This PR adds an advisory warning when a direct, absolute
/etc/resolv.confsymlink points to a canonical regular file clearly outside Bubblewrap's
mounts. It names a read-only policy remedy or link repair without changing
mounts or the execution outcome.
Part of #507. This is the separate resolver diagnostic recommended when #1160 was closed; the cwd advisory is #1442. Neither PR alone closes #507.
Details
defer relative, chained, and ambiguous resolver paths to Bubblewrap.
cannot cause false warnings.
/etc, and document SDK/CLI warning delivery.Tests
src/,cargo fmt --all -- --check: passed.cargo check -p mxc-sdk --all-targets --quiet: passed.cargo clippy -p mxc-sdk --all-targets --quiet -- -D warnings: passed.cargo test -p mxc-sdk --lib bwrap_command --quiet: 52 passed on Windows, including separator cases.cargo check -p mxc-sdk --target x86_64-unknown-linux-gnu --all-targets --quiet: passed.cargo clippy -p mxc-sdk --target x86_64-unknown-linux-gnu --all-targets --quiet -- -D warnings: passed.src/),CARGO_TARGET_DIR="$HOME/src/microsoft/mxc/mxc.root/src/target" cargo test -p mxc-sdk --lib bubblewrap::common --quiet -- --test-threads=1: 306 passed.CARGO_TARGET_DIR="$HOME/src/microsoft/mxc/mxc.root/src/target" cargo build -p lxc --quiet: passed; the builtlxc-exec --experimental ../tests/configs/bubblewrap_basic.jsonsmoke passed ("Hello from Bubblewrap")./etc/resolv.confwas not modified.Microsoft Reviewers: Open in CodeFlow