镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(security): constrain ProxyCommand endpoint token expansion - #342

Merged
inureyes merged 2 commits into
mainfrom
fix/issue-326-proxy-token-boundary
Oct 22, 2026
Merged

inureyes merged 2 commits into
mainfrom
fix/issue-326-proxy-token-boundary

Conversation

@inureyes

@inureyes inureyes commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Prevent endpoint data from changing a trusted ProxyCommand shell program by validating %h, %n, %r, and %k at the common expansion boundary before spawning. CLI, inventory, environment-derived and public library inputs share this check; errors identify the token without echoing unsafe data.

Only substituted values are checked; unused fields and escaped literal tokens such as %%h are unrestricted. Substituted values must be nonempty ASCII letters/digits or ., _, :, @, -, without a leading -. Whitespace, substitutions, wildcards, quotes, non-ASCII names, raw bracketed IPv6 and scoped IPv6 are rejected even inside quoted tokens. Ordinary aliases, CLI-normalized IPv6 and authored shell quoting/pipelines remain supported. README (English/Korean), man page and API docs explain these restrictions; templates themselves remain trusted code.

Validation

  • Ten targeted proxy tests pass, including 348 unsafe value/quoting combinations, YAML host/user injection, isolated subprocess environment expansion, a real IPv6/alias pipeline, and unused-field/escaped-token compatibility.
  • Formatting, diff checks and cargo clippy --lib -- -D warnings pass. Broader integration checks are handled by the orchestration gate.

Closes #326

Validate all endpoint tokens at the common expansion boundary before launching the local shell, preventing inventory, environment and library input from adding shell syntax or arguments. Preserve trusted command quoting and pipelines, and document the restricted token alphabet and IPv6 compatibility.

Add no-side-effect regressions for host, username and alias tokens, resolved YAML/environment inputs, and a successful IPv6 pipeline. The nine proxy tests pass locally.

Refs #326
@inureyes inureyes added priority:high High priority issue type:security Security vulnerability or fix status:review Under review status:done Completed and removed status:review Under review labels Oct 22, 2026
Keep the pre-spawn shell data boundary while allowing unused endpoint fields to retain their original values. Escaped literal tokens do not trigger validation. Add regression coverage and update compatibility documentation.

Refs #326
@inureyes
inureyes merged commit 6d1f7da into main Oct 22, 2026
5 checks passed
@inureyes
inureyes deleted the fix/issue-326-proxy-token-boundary branch October 22, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high High priority issue status:done Completed type:security Security vulnerability or fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(security): constrain ProxyCommand endpoint token expansion

1 participant