From 270db974919311a581534e5ddbe6c96a61c4fec0 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 14 Mar 2026 04:20:41 +1000 Subject: [PATCH 1/2] Prevent credential leakage via curl process information Use a heredoc to pass the SID, password and totp to curl so they don't appear in process list. Signed-off-by: Rob Gill --- padd.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/padd.sh b/padd.sh index 21e3c4c..d20fb3c 100755 --- a/padd.sh +++ b/padd.sh @@ -274,7 +274,13 @@ DeleteSession() { # SID is not null (successful authenthication only), delete the session if [ "${validSession}" = true ] && [ "${SID}" != null ]; then # Try to delete the session. Omit the output, but get the http status code - deleteResponse=$(curl --connect-timeout 2 -skS -o /dev/null -w "%{http_code}" -X DELETE "${API_URL}auth" -H "Accept: application/json" -H "sid: ${SID}") + # SID is passed via stdin config (-K -) to prevent leakage via process information + deleteResponse=$(curl --connect-timeout 2 -skS -o /dev/null -w "%{http_code}" -X DELETE "${API_URL}auth" \ + -H "Accept: application/json" \ + -K - <>%{http_code}" -X GET "${API_URL}$1$2" -H "Accept: application/json" -H "sid: ${SID}" ) + # SID is passed via stdin config (-K -) to prevent leakage via process information + response=$(curl --connect-timeout 2 -sk -w ">>%{http_code}" -X GET "${API_URL}$1$2" \ + -H "Accept: application/json" \ + -K - <> delim From 2b63af4b138a3c319f8e03a566ad5a4e0b4fdf10 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Sat, 21 Mar 2026 20:49:13 +0100 Subject: [PATCH 2/2] Add comment about password/totp as binary data Signed-off-by: yubiuser --- padd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/padd.sh b/padd.sh index 39576f0..8e28ab5 100755 --- a/padd.sh +++ b/padd.sh @@ -295,6 +295,7 @@ EOF } Authenticate() { + # password and totp are passed via stdin as binary-data to prevent leakage via process information sessionResponse="$(curl --connect-timeout 2 -skS -X POST "${API_URL}auth" \ --user-agent "PADD ${padd_version}" \ -H "Content-Type: application/json" \