Issue: Trusted strings, shell escaping and backwards compatibility.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia esaminando la discussione in #283 e il percorso comune di execute() utilizzato da test(), capture() ed execute(), quindi traccia la gestione dell’ambiente attraverso with() e default_env. Determina il comportamento previsto per taint ed escaping di questi punti di ingresso, inclusi gli avvisi proposti compatibili con le versioni precedenti. Il lavoro è completato quando il comportamento è concordato e sono specificati la relativa compatibilità e i casi di errore.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
@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.
- Lingua principale
- Ruby
- Stelle
- 1.2k
- Fork
- 257
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di capistrano/sshkit
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
capistrano/sshkit#563 · 6 reazioni ·
-
No redaction for with values Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
capistrano/sshkit#562 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
capistrano/sshkit#554 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
capistrano/sshkit#543 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
capistrano/sshkit#518 · 1 commento ·
Tutte le issue di capistrano/sshkit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
TheOdinProject/curriculum#31417 · 2 commenti ·
-
Allow faraday-http-cache 3.x Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
glossarist/glossarist-ruby#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/rails8-app-on-gcp#145 ·