Repository navigation
policy: {colon} path variable writes a literal ':' - #692
Merged
Merged
Conversation
{colon} joins {lbrace}/{rbrace} in pathVars, so every sink expands it:
ro/rw/tmpfs/symlink/optional specs, file path and content, environ
values. splitSpec splits host:guest on the raw text before expanding,
so `/mnt/a{colon}b` grants /mnt/a:b and `/mnt/a{colon}b:/g` binds it at
/g. In an element of a ':'-separated list checkExpandedElement refuses
it, with a message naming {colon}: whatever reads PATH splits there.
Red team on this change, both fixed with tests:
- env coupling read a symlink's target unexpanded while bwrap got the
expanded one, so `target = "/q{colon}"` was judged as a different
link than `target = "/q:"` (TestEnvCouplingExpandsASymlinkTarget).
- refusals suggesting `ro = ["<path>"]` echoed a host path holding ':'
raw, which splitSpec reads as another host at another guest; specText
writes ':' and '{' as {colon}/{lbrace}
(TestSpecTextRoundTripsThroughSplitSpec).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
{colon} joins {lbrace}/{rbrace} in pathVars, so every sink expands it: ro/rw/tmpfs/symlink/optional specs, file path and content, environ values. splitSpec splits host:guest on the raw text before expanding, so
/mnt/a{colon}bgrants /mnt/a:b and/mnt/a{colon}b:/gbinds it at /g. In an element of a ':'-separated list checkExpandedElement refuses it, with a message naming {colon}: whatever reads PATH splits there.Red team on this change, both fixed with tests:
target = "/q{colon}"was judged as a different link thantarget = "/q:"(TestEnvCouplingExpandsASymlinkTarget).ro = ["<path>"]echoed a host path holding ':' raw, which splitSpec reads as another host at another guest; specText writes ':' and '{' as {colon}/{lbrace} (TestSpecTextRoundTripsThroughSplitSpec).