mirror of
https://github.com/AskDavis/cyphernode.git
synced 2026-01-01 04:25:58 -08:00
Underscore in action was detected as potential code injection
This commit is contained in:
@@ -92,8 +92,9 @@ verify_group()
|
|||||||
trace "[verify_group] action=${action}"
|
trace "[verify_group] action=${action}"
|
||||||
|
|
||||||
# Check for code injection
|
# Check for code injection
|
||||||
# action can be alphanum... nothing else
|
# action can be alphanum... and _ and - but nothing else
|
||||||
case $action in (*[![:alnum:]]*|"")
|
local actiontoinspect=$(echo "$action" | tr -d '_-')
|
||||||
|
case $actiontoinspect in (*[![:alnum:]]*|"")
|
||||||
trace "[verify_group] Potential code injection, exiting"
|
trace "[verify_group] Potential code injection, exiting"
|
||||||
return 1
|
return 1
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ test_expiration()
|
|||||||
eval k='$ukey_'$id
|
eval k='$ukey_'$id
|
||||||
|
|
||||||
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+1))}" | base64)
|
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+1))}" | base64)
|
||||||
local s=$(echo "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
local s=$(echo -n "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
||||||
local token="$h64.$p64.$s"
|
local token="$h64.$p64.$s"
|
||||||
|
|
||||||
echo " Sleeping 2 seconds... "
|
echo " Sleeping 2 seconds... "
|
||||||
@@ -41,7 +41,7 @@ test_authentication()
|
|||||||
eval k='$ukey_'$id
|
eval k='$ukey_'$id
|
||||||
|
|
||||||
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+10))}" | base64)
|
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+10))}" | base64)
|
||||||
local s=$(echo "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
local s=$(echo -n "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
||||||
local token="$h64.$p64.$s"
|
local token="$h64.$p64.$s"
|
||||||
|
|
||||||
local rc
|
local rc
|
||||||
@@ -67,8 +67,8 @@ test_authorization_watcher()
|
|||||||
local k
|
local k
|
||||||
eval k='$ukey_'$id
|
eval k='$ukey_'$id
|
||||||
|
|
||||||
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+10))}" | base64)
|
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+20))}" | base64)
|
||||||
local s=$(echo "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
local s=$(echo -n "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
||||||
local token="$h64.$p64.$s"
|
local token="$h64.$p64.$s"
|
||||||
|
|
||||||
local rc
|
local rc
|
||||||
@@ -133,8 +133,8 @@ test_authorization_spender()
|
|||||||
local k
|
local k
|
||||||
eval k='$ukey_'$id
|
eval k='$ukey_'$id
|
||||||
|
|
||||||
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+10))}" | base64)
|
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+20))}" | base64)
|
||||||
local s=$(echo "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
local s=$(echo -n "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
||||||
local token="$h64.$p64.$s"
|
local token="$h64.$p64.$s"
|
||||||
|
|
||||||
local rc
|
local rc
|
||||||
@@ -207,7 +207,7 @@ test_authorization_internal()
|
|||||||
eval k='$ukey_'$id
|
eval k='$ukey_'$id
|
||||||
|
|
||||||
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+10))}" | base64)
|
local p64=$(echo "{\"id\":\"$id\",\"exp\":$((`date +"%s"`+10))}" | base64)
|
||||||
local s=$(echo "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
local s=$(echo -n "$h64.$p64" | openssl dgst -hmac "$k" -sha256 -r | cut -sd ' ' -f1)
|
||||||
local token="$h64.$p64.$s"
|
local token="$h64.$p64.$s"
|
||||||
|
|
||||||
local rc
|
local rc
|
||||||
|
|||||||
Reference in New Issue
Block a user