| name | wstg-sess-06 |
| description | Testing for Logout Functionality |
| category | session-management |
| owasp_id | WSTG-SESS-06 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["session","cookies","csrf","token","wstg","sess"] |
| tech_stack | [] |
| cwe_ids | ["CWE-613"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
wstg-sess-06
Test ID
WSTG-SESS-06
Test Name
Testing for Logout Functionality
High-Level Description
Logout functionality must properly terminate user sessions by invalidating session tokens on the server side. Improper logout implementation can allow continued access using old session tokens, session replay attacks, or leave users vulnerable if using shared computers.
What to Check
How to Test
Step 1: Test Session Invalidation
#!/bin/bash
TARGET="https://target.com"
session=$(curl -s -c - -X POST "$TARGET/login" \
-d "username=test&password=test" | grep -oP "SESSIONID=\K[^;]+")
echo "Session: $session"
curl -s -b "SESSIONID=$session" "$TARGET/dashboard" | grep -q "Welcome" && \
echo "[OK] Session authenticated"
curl -s -b "SESSIONID=$session" "$TARGET/logout"
response=$(curl -s -b "SESSIONID=$session" "$TARGET/dashboard")
| grep -q ;