Skip to content

[SECURITY] Supply chain: build images from a hashed lock file instead of open >= ranges #121

Done

Description

@OkiriGabriel

Problem

Every runtime dependency uses an open >= range (requirements.txt), and the Docker images install them at build time. Each image build therefore pulls whatever was newest on PyPI that day, unpinned and unhashed.

That's how the October 21 LiteLLM 1.107.0 compromise reached people: a malicious release was live on PyPI for about 2 hours, and any unpinned build in that window installed it. We don't depend on LiteLLM, but the same could happen with anthropic, fastapi, httpx, mcp or any of the ~80 transitive packages. Builds also aren't reproducible: two images from the same commit can differ.

Separately, CI's dependency check is safety check || true (ci.yml), so a known-vulnerable dependency never fails the build. #18 tracks making scans blocking and asks Safety vs pip-audit.

Suggested fix

  1. Keep requirements.txt as the human-edited ranges, and generate requirements.lock with uv pip compile --generate-hashes (and one for middleware/).
  2. Docker builds install with pip install --require-hashes -r requirements.lock.
  3. CI: pip-audit -r requirements.lock --strict as a blocking step (coordinate with Make CI lint and security scans fail the build #18), plus a check that the lock is up to date.
  4. Dependabot (see the dependabot.yml issue) updates the lock via PRs, so upgrades are reviewed instead of silent.

Activity

  1. added
    dependencies
    security
    ci
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cidependenciessecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions