Skip to content

Refuse YARDMASTER_* variables as provider key names - #25

Merged
bricke merged 1 commit into
mainfrom
fix/reserved-key-names
Oct 9, 2026
Merged

bricke merged 1 commit into
mainfrom
fix/reserved-key-names

Conversation

@bricke

@bricke bricke commented Oct 9, 2026

Copy link
Copy Markdown
Owner

A config's api_key_env could name any variable in the container, and switchyard-server was started with its value. A config naming YARDMASTER_SECRET_KEY with a base URL of the admin's choosing would send YardMaster's master key (or proxy secret, or admin password) to that server as a bearer token. That broke the promise in switchyardEnv that YardMaster's own secrets are never passed on. Anyone with an admin session could do this, including through a proxy role mapped to admin.

  • secrets.ValidName refuses the YARDMASTER_ prefix, so the wizard rejects such names and the UI can't store a key under one.
  • Applier.Preview names the problem for hand-written TOML. Before this, it would have shown up as a missing key.
  • Store.Env skips invalid names. A config already applied with one starts without that key.
  • Store.Status reports invalid names as missing, so /api/admin/keys?names=… no longer tells whether a reserved variable is set.

Tests cover the wizard, the TOML preview, the store, and the environment switchyard-server gets. Each fails without the fix.

A config's api_key_env could name any variable in the container, and
switchyard-server was started with its value. A config naming
YARDMASTER_SECRET_KEY, with a base URL of the admin's choosing, would
send YardMaster's master key (or proxy secret, or admin password) to
that server as a bearer token.

Provider keys can no longer be read from YARDMASTER_* variables: the
wizard and the preview of hand-written TOML refuse such names, the UI
can't store a key under one, and a config already applied with one
starts without it. The key status also reports such names as missing,
so it no longer tells whether one is set.
@bricke
bricke merged commit 1ab27cf into main Oct 9, 2026
3 checks 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