Skip to content

🐛 fix(shims): validate version names - #205

Merged
gaborbernat merged 4 commits into
tox-dev:mainfrom
gaborbernat:security/tkszq34k-shim-versions
Nov 3, 2026
Merged

gaborbernat merged 4 commits into
tox-dev:mainfrom
gaborbernat:security/tkszq34k-shim-versions

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Shim resolution joined a configured version to the version manager's installation directory without checking whether the version was a directory name. A value that contains a path could make interpreter discovery probe a binary outside that directory under the caller's account. Discovery now accepts one directory name per version. This addresses draft advisory ANT-2026-TKSZQ34K.

Shim version selection

python-discovery reads versions from the environment and version files when resolving pyenv, mise, and asdf shims. The old join accepted path syntax in those values. The resolver now skips names containing paths before building a candidate path.

Behavior changes

Discovery ignores version names containing a path separator or equal to . or ... Discovery tries later configured versions. If none resolves to a binary, the existing shim fallback still applies. Normal version directory names continue to resolve.

Reported by Antigravity: ANT-2026-TKSZQ34K.

A version from a shared parent directory could escape the version manager
root and cause discovery to probe another user's binary. Reject path-like
version names before building the candidate path.
@gaborbernat gaborbernat added the bug Something isn't working label Nov 2, 2026
@gaborbernat gaborbernat changed the title 🐛 fix(shims): reject path-like version names 🐛 fix(shims): validate version names Nov 2, 2026
@gaborbernat gaborbernat added the security Security fixes and advisories label Nov 3, 2026
@gaborbernat
gaborbernat merged commit d93e05a into tox-dev:main Nov 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security Security fixes and advisories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant