Issue: Trusted strings, shell escaping and backwards compatibility.
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
まず #283 の議論と、test()、capture()、execute() で使用される共通の execute() パスを確認し、その後 with() と default_env を通じた環境の処理を追跡します。提案されている後方互換性のある警告を含め、これらのエントリポイントに対する意図された taint とエスケープの動作を特定します。動作について合意され、その互換性と失敗ケースが仕様化されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
@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 commonexecute()function) - Environment variables, and values when used with
with(){} - Environment variables when used with
default_env
- Arguments to
- Find out if strings are
taintedor 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 はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
capistrano/sshkit のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
capistrano/sshkit#563 · リアクション 6 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
capistrano/sshkit#562 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
capistrano/sshkit#554 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
capistrano/sshkit#543 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
capistrano/sshkit#518 · コメント 1 件 ·
capistrano/sshkit の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
rubocop/ruby-style-guide#984 ·
-
internal product:dev-portal release-docs
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Kong/developer.konghq.com#7393 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
fastlane/fastlane#30286 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
TheOdinProject/curriculum#31432 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/web interface
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信