Skip to content

Reject symlinked wheel installation destinations - #21569

Merged
woodruffw merged 5 commits into
mainfrom
zb/security-validated-wheel-destinations
Sep 10, 2026
Merged

woodruffw merged 5 commits into
mainfrom
zb/security-validated-wheel-destinations

Conversation

@astral-automations-bot

Copy link
Copy Markdown
Contributor

When a wheel installation destination already contains a directory symlink, merging the payload can write files outside the environment. Represent the wheel root and each .data subtree mapping as a ValidatedWheelDestination, require callers to distinguish trusted scheme roots from mapped child destinations, and require those validated mappings throughout linking and data installation. Replace destination file symlinks encountered by .data move fallbacks atomically.

Supersedes astral-sh#56.

@woodruffw woodruffw added the internal A refactor or improvement that is not user-facing label Sep 9, 2026
@astral-sh-bot

astral-sh-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the main base revision.

  • Added tests: 5
  • Removed tests: 0
  • Changed suites: 2
uv-install-wheel: +1 / -0

Added:

  • uv-install-wheel::wheel::test::rename_or_copy_does_not_follow_destination_symlink

Removed: none

uv::pip_install: +4 / -0

Added:

  • uv::pip_install::pip_install::reject_symlinked_wheel_data_package_directory
  • uv::pip_install::pip_install::reject_symlinked_wheel_headers_destination
  • uv::pip_install::pip_install::reject_symlinked_wheel_nested_package_directory
  • uv::pip_install::pip_install::reject_symlinked_wheel_package_directory

Removed: none

@codspeed

codspeed Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 25 untouched benchmarks
⏩ 12 skipped benchmarks1


Comparing zb/security-validated-wheel-destinations (03b2de5) with main (66d6d99)2

Open in CodSpeed

Footnotes

  1. 12 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (95a1251) during the generation of this report, so 66d6d99 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Signed-off-by: William Woodruff <[email protected]>
@woodruffw
woodruffw merged commit 89c3b2c into main Sep 10, 2026
61 checks passed
@woodruffw
woodruffw deleted the zb/security-validated-wheel-destinations branch September 10, 2026 22:38
konsti-openai pushed a commit that referenced this pull request Sep 15, 2026
Reverts #21569 to restore the previous wheel installation behavior.

This fixes two regressions introduced in uv 0.12.14:

- `uv pip install --target=.` fails because the relative installation
root normalizes to an empty path. Fixes #21694.
- Installing wheels with man pages fails in official Python Docker
images, where `/usr/local/man` is a symlink to `share/man`. Fixes
#21692.
<!-- codex-thread: 01a0a496-3b61-7140-8190-53aa070449d2 -->
woodruffw added a commit that referenced this pull request Sep 15, 2026
This reverts commit cdabfce.

Restore the hardening from #21569 unchanged. Subsequent commits correct relative installation roots and supported in-prefix symlink layouts.

This branch was previously deployed

1 inactive deployment
automations — 03b2de54 Deployed Sep 10, 2026 by woodruffw via review / security review #46383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants