deps(uv): jawnie zadeklaruj indeks PyPI (dependency confusion guard)#174
Merged
Conversation
Praktyka #5 z pypi-security-best-practices (prevent dependency confusion). Bez jawnej deklaracji uv uzywa pypi.org jako implicit default. Po dodaniu prywatnego indeksu w przyszlosci kazda komenda uv resolve mogla pulnac publiczny pakiet o tej samej nazwie z wyzszej wersji - klasyczna wektor dependency confusion attack (np. namepsace squat na nazwe internal pkg). Po tej zmianie: - pypi.org jest single source of truth, jawnie udokumentowany - przyszly dev dodajacy prywatny indeks dostanie jasny sygnal jak ustawic index priority (musi go dodac PRZED [pypi] albo z explicit = true) - uv.lock bez zmian (pypi byl juz domyslnym indeksem) Komentarz w toml objasnia zasade dla przyszlych zmian.
This was referenced Apr 27, 2026
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.
Podsumowanie
PR 2/12 wdrażający rekomendacje z
lirantal/pypi-security-best-practices —
praktyka #5: Prevent Dependency Confusion.
Co się zmienia
Dodaje jawny
[[tool.uv.index]]block wpyproject.tomldeklarującyPyPI jako jedyny domyślny indeks. Komentarz objaśnia zasadę dodawania
przyszłych prywatnych indeksów (priority +
explicit = true).Dlaczego
uvużywapypi.orgjako implicit default.→ atakujący publikujący pakiet na PyPI o tej samej nazwie co wewnętrzny
pakiet wygrywa resolution (klasyczne dependency confusion).
Plan testowy
uv lock— bez zmian wuv.lock(pypi był juz default).pre-commit run --files pyproject.toml— passed.🤖 Generated with Claude Code