| name | wstg-sess-07 |
| description | Testing for Session Timeout |
| category | session-management |
| owasp_id | WSTG-SESS-07 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["session","cookies","csrf","token","wstg","sess"] |
| tech_stack | [] |
| cwe_ids | ["CWE-384"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
wstg-sess-07
Test ID
WSTG-SESS-07
Test Name
Testing for Session Timeout
High-Level Description
Session timeout controls how long a session remains valid after periods of inactivity or absolute time limits. Improper timeout configuration can leave sessions vulnerable to hijacking if users don't explicitly logout, especially on shared computers or public networks.
What to Check
How to Test
Step 1: Test Idle Timeout
#!/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"
echo "Waiting for idle timeout..."
for i in {1..60}; do
sleep 60
response=$(curl -s -b "SESSIONID=$session" "$TARGET/dashboard")
if echo "$response" | grep -qi "login\|expired\|timeout"; then
0