Do not remove files outside the venv on uninstall#18942
Merged
Conversation
Check that only files inside the installation scheme can be removed when uv uninstalls a package. This fixes a bug where uv would try to remove arbitrary files due to a malformed or malicious RECORD file in a wheel. For venvs, the installation prefix is the entire venv, as `.data/data` allows wheels to write to the entire venv, so all files in the venv can also be removed. This is both a correctness fix (uv should never remove files outside its domain) and a low severity security fix, where a malicious wheel could remove a user's files during uninstallation, such as a `uv sync` that upgrades the package version. Note that this requires an attacker having control over the wheel, which also allows them to modify arbitrary Python code. There are no known cases of wheels actually referencing files outside the installation scheme in their RECORD.
Open
1 task
naveenOnarayanan
pushed a commit
to doppelxyz/uv
that referenced
this pull request
Apr 9, 2026
Check that only files inside the installation scheme can be removed when uv uninstalls a package. This fixes a bug where uv would try to remove arbitrary files due to a malformed or malicious RECORD file in a wheel. For venvs, the installation prefix is the entire venv, as `.data/data` allows wheels to write to the entire venv, so all files in the venv can also be removed. This is both a correctness fix (uv should never remove files outside its domain) and a low severity security fix, where a malicious wheel could remove a user's files during uninstallation, such as a `uv sync` that upgrades the package version. Note that this requires an attacker having control over the wheel, which also allows them to modify arbitrary Python code. There are no known cases of wheels actually referencing files outside the installation scheme in their RECORD.
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Apr 15, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [uv](https://github.com/astral-sh/uv) | patch | `0.11.5` → `0.11.6` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (uv)</summary> ### [`v0.11.6`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0116) [Compare Source](astral-sh/uv@0.11.5...0.11.6) Released on 2026-04-09. This release resolves a low severity security advisory in which wheels with malformed RECORD entries could delete arbitrary files on uninstall. See [GHSA-pjjw-68hj-v9mw](GHSA-pjjw-68hj-v9mw) for details. ##### Bug fixes - Do not remove files outside the venv on uninstall ([#​18942](astral-sh/uv#18942)) - Validate and heal wheel `RECORD` during installation ([#​18943](astral-sh/uv#18943)) - Avoid `uv cache clean` errors due to Win32 path normalization ([#​18856](astral-sh/uv#18856)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMTAuOCIsInVwZGF0ZWRJblZlciI6IjQzLjExMC44IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
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.
Check that only files inside the installation scheme can be removed when uv uninstalls a package. This fixes a bug where uv would try to remove arbitrary files due to a malformed or malicious RECORD file in a wheel. For venvs, the installation prefix is the entire venv, as
.data/dataallows wheels to write to the entire venv, so all files in the venv can also be removed.This is both a correctness fix (uv should never remove files outside its domain) and a low severity security fix, where a malicious wheel could remove a user's files during uninstallation, such as a
uv syncthat upgrades the package version. Note that this requires an attacker having control over the wheel, which also allows them to modify arbitrary Python code. There are no known cases of wheels actually referencing files outside the installation scheme in their RECORD.