Skip to content

CI/SEC: preventing arbitrary code execution at install time in CI #19879

Open

Description

@neutrinoceros

Because it's a common attack vector, I've been trying to eliminate arbitrary code execution from installation in CI. Typically I've done this through constraints on direct and indirect dependencies, though tool.uv.constraint-dependencies and tool.uv.no-build-package.
This approach is, to my knowledge, the best one available now, but it suffers serious drawbacks:

  1. all dependencies need to be audited
  2. upgrading project.python-requires or python versions used in CI requires additional care (which may be simply forgotten)
  3. packages that are merely visited during resolution (i.e., considered but ultimately not included in the final env) are especially hard to keep track of.

All of these would become trivial (or disappear completely) if we used locked environments in CI (#17596), which I haven't been able to get consensus for yet. Alternatively, if the following upstream issues are ever resolved, they'd enable a more robust strategy

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions