Skip to content

Keep keys off redirects to another host, and check base-URL variables, --user and cp paths - #27

Open
cory-salad wants to merge 4 commits into
mainfrom
harden-key-and-ssh-input
Open

cory-salad wants to merge 4 commits into
mainfrom
harden-key-and-ssh-input

Conversation

@cory-salad

@cory-salad cory-salad commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hardening for how the CLI handles its keys and the values it passes to ssh and sftp. Normal use is unchanged; the new
checks of what you type are usage errors (exit 2) with rows in the validation table.

Changes

  • A redirect to another host no longer carries the API key, the AI Gateway key or the request's body.
  • SALAD_CLI_API_BASE_URL, SALAD_CLI_STORAGE_BASE_URL and SALAD_CLI_AI_GATEWAY_BASE_URL must be https unless they
    name localhost, and one that names another machine prints a warning: on stderr.
  • --user on container-groups ssh, sftp and cp must be a user name, and an SSH endpoint that is not an address
    and a port is refused (exit 1).
  • container-groups cp refuses a path with a control character.
  • container-groups ssh --config quotes an identity file path that holds a space, and refuses one it cannot write.

Checklist

  • just ci passes (formatting, lint, and the offline tests)
  • docs/ (and the README, if install or getting started changed) and CHANGELOG.md (under Unreleased) reflect the
    change: docs/guide.md, the validation table in AGENTS.md, and CHANGELOG.md.
  • Anything that touches an API call was exercised live, or this pull request says it was not: the live suite was
    not run. The transport change is covered by offline tests against local servers.

🤖 Generated with Claude Code

…, --user and cp paths

A redirect to another host no longer carries the API key or the AI Gateway key. The base-URL variables must be
https unless they name localhost, and one that names another machine prints a warning. --user on ssh, sftp and cp
must be a user name, an SSH endpoint that is not an address and a port is refused, and cp refuses a path with a
control character.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
@cory-salad cory-salad self-assigned this Nov 13, 2026
cory-salad and others added 3 commits November 13, 2026 15:56
Credentials stay off a redirect chain once it has left the first host. Only localhost and loopback addresses count
as this machine for a base-URL variable; login, ai-gateway login and doctor report a bad one before anything else,
and the warning says what each variable carries. ssh --config quotes and checks the identity file path and reports
a malformed endpoint, sftp takes an IPv6 address in brackets, and messages quote an instance ID that is not one.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Also keep the nothing-was-saved hint on ai-gateway login for anything but a usage error, and reword the
base-URL row of the validation table and the guide's line about the warning.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
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