Repository navigation
🐛 fix(activation): reject shell PATH options - #3734
Merged
Merged
Conversation
gaborbernat
force-pushed
the
fix/3hk-dash-path-option
branch
from
November 20, 2026 15:13
c369c28 to
d9e9605
Compare
dash treats the first percent sign in a PATH entry as an option delimiter. Paths with %func or %builtin can then load shell functions outside the virtual environment. Reject them at creation and activation, including after relocation. PowerShell needs an ordinal comparison to catch combining marks after the option name.
gaborbernat
force-pushed
the
fix/3hk-dash-path-option
branch
from
November 20, 2026 15:34
d9e9605 to
4d4c1b1
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 17:02
gaborbernat
marked this pull request as draft
November 20, 2026 20:27
Dash also ships with Git for Windows. Reject its PATH options on Windows and check that relocated executable directories occupy one PATH entry in Bash and Python activation.
Git Bash can return a drive-qualified path for a moved environment. Check for PATH separators after converting the drive letter to its shell spelling, so the guard sees the path that activation will use.
gaborbernat
marked this pull request as ready for review
November 20, 2026 21:42
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.
Some environment paths change how dash looks up commands after activation. Regardless of the current shell, creation rejects a resolved destination when its first
%starts the lowercase option%funcor%builtin, including on Windows, where Git ships dash. Choose a different directory name if creation reports a shell PATH option. Other percent signs are allowed. Dash command lookup.Bash rejects the same percent options when an environment has moved. PowerShell and Python reject them in paths they discover at activation. Bash relocation and Python activation also reject directories containing the platform's PATH separator, so the environment's executable directory stays a single PATH entry.
Reported by oss-scanner. Draft advisory ANT-2026-3HKDKHBU.