From 9829b4d3d882c554255eeeea107ae0f858cfd866 Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Fri, 28 Sep 2018 18:05:54 -0600 Subject: pt:Escape ` char in passwords The backtick char can cause all kinds of issues, since it allows for execution of subshell code. --- pt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt b/pt index eb1674a..dbbfab9 100755 --- a/pt +++ b/pt @@ -100,7 +100,7 @@ function main { [[ $? -gt 0 ]] && log "Error: '${@}' is not in the password store" && exit 1 # Parse pass output into appropriate variables - _passpassword=$(printf -- "%s" "${_passentry}" | head -n1) + _passpassword=$(printf -- "%s" "${_passentry}" | head -n1 | sed 's/`/\`/g') _passusername=$(getfield "${_passentry}" ':' username) _passdelim=$(getfield "${_passentry}" ':' delim) _passsubmit=$(getfield "${_passentry}" ':' submit) -- cgit v1.2.3