Skip to content

🐛 fix(pep514): reject relative registry paths - #212

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:security/nwcj24kd-absolute-registry-exe
Nov 3, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:security/nwcj24kd-absolute-registry-exe

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

_resolve_exe() accepted a relative PEP 514 executable path if a matching file existed in the caller's working directory. Discovery could then run that file as the caller. The registry source now requires an absolute string before it checks or probes the executable. This addresses draft advisory ANT-2026-NWCJ24KD.

Registry executable paths

PEP 514 requires ExecutablePath to be the full path to the executable. The old load_exe() only checked whether the raw registry value existed. The new validation checks the value's type and uses Windows absolute-path semantics for both ExecutablePath and the InstallPath fallback. It also skips non-string registry values instead of raising an uncaught type error.

Behavior changes

Discovery accepts absolute drive and UNC paths. It skips relative, drive-relative, rooted-without-drive, and non-string values with a PEP 514 warning. REG_EXPAND_SZ values contain unexpanded environment references; discovery skips any such value that remains relative.

Reported by Antigravity: ANT-2026-NWCJ24KD.

PEP 514 requires a full executable path. A relative registry value lets
interpreter discovery run a file from the caller's working directory.
@gaborbernat gaborbernat added the bug Something isn't working label Nov 2, 2026
@gaborbernat gaborbernat added the security Security fixes and advisories label Nov 3, 2026
@gaborbernat
gaborbernat merged commit c40ad44 into tox-dev:main Nov 3, 2026
21 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