Skip to content

Never give workers the RunPod key or the organization's API key (0.21.0) - #104

Merged
nielsrolf merged 2 commits into
mainfrom
security/h10-runpod-key
Nov 24, 2026
Merged

nielsrolf merged 2 commits into
mainfrom
security/h10-runpod-key

Conversation

@nielsrolf

Copy link
Copy Markdown
Collaborator

What

Closes finding H10 of the 2026-11-22 security audit of the internal tools.

  • RunPod key: a job author chooses the worker image, and official images older than v0.16.0 were still handed the organization's RunPod key. No worker gets that key any more, whatever the image. Jobs that name an official image older than v0.16.0 are failed with a message telling the author to upgrade.
  • Admin key fallback: when create_worker_token found no such function in the database, the worker was started with the organization's admin API key. Now no worker is started without a token of its own; jobs stay pending, the manager logs the reason and retries after 60 s.

Who notices

  • Clients older than 0.16.0 (their built-in jobs pin old images): their jobs fail with the upgrade message.
  • A database without migration 20261122000000_worker_tokens.sql (including a self-managed ow cluster): the manager starts no workers until it is applied.
  • Workers already running on old images keep the key until they end. Since any member could read it until now, rotate the RunPod key after release (see docs/release-0.21.0.md).

Tested

pytest tests --ignore=tests/test_integration.py: 309 passed with the local test database (239 passed, 70 skipped without it). New tests cover which images are refused, a started pod's environment, and no pod on token failure. Reverting the fix makes 6 tests fail.

Not tested: real RunPod and Supabase; whether any production organization still has jobs or clients on pre-0.16 images.

The version bump to 0.21.0 follows the repository's release-commit habit; change it if this ships under another number.

🤖 Generated with Claude Code

…ase 0.21.0

Security audit 2026-11-22, finding H10.

The cluster manager passed RUNPOD_API_KEY to official worker images older
than v0.16.0. The image is chosen by the job's author, so any organization
member, or code in a job, could name such an image and read the key. And on
a database without create_worker_token() the manager passed the
organization's admin API key to workers in place of a worker token.

Now the environment of a worker does not depend on its image and never
holds either key. Jobs that name an official image older than v0.16.0 are
failed with the reason in outputs.error instead of started. When no worker
token can be created, no pod is started: the worker row is closed, the jobs
stay pending and the manager tries again after 60 seconds.

Behaviour changes, release order and key rotation: docs/release-0.21.0.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@nielsrolf
nielsrolf marked this pull request as draft November 23, 2026 12:01
@nielsrolf

Copy link
Copy Markdown
Collaborator Author

Parked as a draft on 2026-11-23: no breaking changes to openweights for now. When picked up again, first check whether any organization still uses clients or worker images older than 0.16.0.

Production still has jobs on nielsrolf/ow-vllm:v0.11; the three-part pattern
treated such images as custom ones and started them without the key.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@nielsrolf
nielsrolf marked this pull request as ready for review November 24, 2026 09:42
@nielsrolf
nielsrolf merged commit 2f86949 into main Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant