Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Issue: Trusted strings, shell escaping and backwards compatibility.

オープン
#333 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
ruby, shell
領域
devops, security

調査の方向性

まず #283 の議論と、test()、capture()、execute() で使用される共通の execute() パスを確認し、その後 with() と default_env を通じた環境の処理を追跡します。提案されている後方互換性のある警告を含め、これらのエントリポイントに対する意図された taint とエスケープの動作を特定します。動作について合意され、その互換性と失敗ケースが仕様化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

discuss!

@ncreuschling @mattbrictson /cc

Continuing from the discussion in #283 I'd like to raise the general issue of shell escaping (shellwords) and what we mean/expect about "escaping strings" and so forth, whilst closing #283 it came to my mind that Rails using Object#taint, Object#tainted? and family works mostly pretty well.

I want to unify behavior.

I would propose the following:

  • Identify where we want to escape things, if at all:
    • Arguments to test(), capture(), execute() etc (via the common execute() function)
    • Environment variables, and values when used with with(){}
    • Environment variables when used with default_env
  • Find out if strings are tainted or not by default in the Capistrano context.
  • Find a backwards compatible way to:
    • Issue a release with warnings for "tainted" strings in the places we care about, warning that behavior will change
  • See if it makes sense to compare untrusted (the trust vernacular is deprecated) against their shellescaped counterparts, and exit with an error in that case.

I'm afraid that strings coming from the same file that is running will be trusted by default, so the whole plan falls apart, I'd have to look more closely at the API to see if the default taint value for a string is tainted, untainted, or (ideally) none.

Ideally, this would mean, I could do something like this:

SSHKit.config.default_env = {
   "$MY_LITTLE_PONY".untaint => "i should however be escaped" 
}

This would lead to us calling a literal export $MY_LITTLE_PONY=i should however be escaped, for better or worse.

主要言語
Ruby
スター
1.2k
フォーク
257
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

capistrano/sshkit のほかの issue

capistrano/sshkit の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。