Skip to content

🐛 fix(probe): extract zipapp script privately - #206

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:security/t96k7jxu-private-probe
Nov 3, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:security/t96k7jxu-private-probe

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Archive imports extracted the interpreter probe script directly into the shared temp directory. Python searches the script's directory first, so another local user could affect imports during an interpreter probe. The script now runs from a private directory. This addresses draft advisory ANT-2026-T96K7JXU.

Archive probe extraction

The old fallback created a script in the temp root when an archive supplied the package. The fallback now creates a private directory, writes the script there and removes the directory when interrogation ends. Filesystem imports continue to use the packaged script.

Behavior changes

For archive imports, the child interpreter sees a private script directory at the start of its module search path. The context manager removes the temporary directory and its script after the probe, including when the probe raises an error.

Reported by Antigravity: ANT-2026-T96K7JXU.

Archive imports extracted the interrogation script into the shared temp
root, which Python adds to the probe's module search path. Place the
script in a private directory and remove that directory after the probe.
@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 df36fa6 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