Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log cookie names without HttpOnly or secure flags #1496

Open
wants to merge 2 commits into
base: 3.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions testssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3022,6 +3022,16 @@ run_cookie_flags() { # ARG1: Path
else
fileout "cookie_httponly" "INFO" "$nr_secure/$nr_cookies at \"$1\" marked as HttpOnly$msg302_"
fi
IFS=$'; ' read -r -a not_secure <<< $(awk -F"=" '{print$1}' <<< $(awk -F" " '{print$2}' <<< $(grep -iav secure $TMPFILE)))
if [[ -v not_secure ]]; then
not_secure_cookies=$(printf '%s,' "${not_secure[@]}")
fileout "cookie_not_secure" "INFO" "The cookie(s) with name(s) '${not_secure_cookies::-1}' does not have the secure flag set."
fi
IFS=$'; ' read -r -a not_httponly <<< $(awk -F"=" '{print$1}' <<< $(awk -F" " '{print$2}' <<< $(grep -iav httponly $TMPFILE)))
if [[ -v not_httponly ]]; then
not_httponly_cookies=$(printf '%s,' "${not_httponly[@]}")
fileout "cookie_not_httponly" "INFO" "The cookie(s) with name(s) '${not_httponly_cookies::-1}' does not have the httponly flag set."
fi
outln "$msg302"
allcookies="$(awk '/[Ss][Ee][Tt]-[Cc][Oo][Oo][Kk][Ii][Ee]:/ { print $2 }' "$TMPFILE")"
sub_f5_bigip_check "$allcookies" "$spaces"
Expand Down