From meta
Detect and exploit session fixation (WSTG-SESS-01, WSTG-SESS-03) and session exposure (WSTG-SESS-04) by testing whether the server issues a new session token post-authentication, whether pre-login tokens remain valid after login, and whether session IDs are transmitted over HTTP or included in GET parameters. Analyze token randomness via Burp Sequencer. Test JSESSIONID, ASP.NET Forms Auth cookies. Tools: OWASP ZAP, Burp Suite Repeater/Sequencer, JHijack.
npx claudepluginhub securityfortech/hacking-skills --plugin metaThis skill uses the workspace's default tool permissions.
Session fixation occurs when an application authenticates a user but retains the pre-authentication
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Session fixation occurs when an application authenticates a user but retains the pre-authentication session token rather than issuing a fresh one. An attacker who plants a known token (via URL parameter, XSS, or network manipulation) can then authenticate as the victim by using that same token once the victim logs in. Session token exposure extends the attack surface by allowing tokens to be harvested from HTTP traffic, proxy logs, browser history, and caches when tokens are transmitted without encryption or appear in GET request URLs. Predictable session tokens that can be forged complete the trifecta of session management failures.
Set-Cookie header upon successful authentication?JSESSIONID=... or ?session=...Set-Cookie lacks Secure flag on session cookiesSet-Cookie lacks HttpOnly flag on session cookiesSameSite attributeCache-Control headers on authenticated pages do not include no-store.ASPXAUTH) used without server-side session storeSet-Cookie: __Host- or __Secure- prefixes absent (weaker binding guarantees)Set-Cookie headers, cookie names, values).Set-Cookie headers.Secure flag.Cache-Control, Pragma, and Expires headers on authenticated
responses.# Step 1: Capture pre-login token
PRE_TOKEN=$(curl -s -c /tmp/pre_cookies.txt "https://TARGET/login" \
-D - | grep -i "set-cookie" | grep -i "session\|jsession\|sid")
echo "Pre-login token: $PRE_TOKEN"
# Step 2: Authenticate while keeping pre-login token
curl -s -b /tmp/pre_cookies.txt -c /tmp/post_cookies.txt \
-X POST "https://TARGET/login" \
-d "username=VICTIM&password=VICTIM_PASS" \
-D - | grep -i "set-cookie"
# Step 3: Compare pre and post tokens
echo "=== Pre-login cookies ===" && cat /tmp/pre_cookies.txt
echo "=== Post-login cookies ===" && cat /tmp/post_cookies.txt
# Step 4: Test if pre-login token grants authenticated access
curl -s -b "JSESSIONID=PRE_LOGIN_TOKEN_VALUE" \
"https://TARGET/account/dashboard" -o /dev/null -w "%{http_code}"
# Transport exposure test
curl -v "http://TARGET/account/profile" \
-b "SessionID=VALID_TOKEN" 2>&1 | grep -iE "set-cookie|location|HTTP/"
# GET parameter session ID test
curl -s "https://TARGET/page;jsessionid=SESSION_ID_VALUE" \
-D - | grep -i "set-cookie\|200\|302"
# Cache header audit on authenticated page
curl -sI "https://TARGET/account/dashboard" \
-b "SessionID=VALID_TOKEN" | grep -iE "cache-control|pragma|expires"
# Token entropy collection for Burp Sequencer
# (In Burp: Proxy > HTTP History > select login response > right-click > Send to Sequencer)
# Collect 100+ tokens, run analysis for effective bits of randomness
# ASP.NET Forms Auth cookie decode (check if user ID is embedded)
python3 -c "
import base64, sys
token = 'TOKEN_VALUE_HERE'
try:
decoded = base64.b64decode(token + '==')
print(decoded)
except Exception as e:
print(f'Error: {e}')
"
__Host- or __Secure- prefixed cookies are absent, attacker can potentially set cookies
via HTTP subdomain or path injection to fix the session.#) are not sent to servers but may leak via Referer headers.Scenario 1 — Classic Session Fixation
Setup: Application issues session token on first visit; does not rotate after login.
Trigger: Attacker tricks victim into visiting https://TARGET/login?sessionid=KNOWN_VALUE
(if app accepts session via URL); victim logs in; attacker uses same KNOWN_VALUE to access
victim's authenticated session.
Impact: Full account takeover without knowing victim's credentials.
Scenario 2 — Network Attacker Cookie Forcing
Setup: Application accepts cookies over HTTP for legacy endpoints; no __Host- prefix protections.
Trigger: Attacker on same network injects a known session cookie via HTTP response manipulation;
victim authenticates; attacker uses planted cookie to access authenticated session.
Impact: Session hijacking of any user on the same network segment.
Scenario 3 — ASP.NET Cookie Restoration After Logout
Setup: Application uses encrypted Forms Authentication cookie without server-side session store;
machine key is static.
Trigger: Post-logout, attacker restores captured .ASPXAUTH cookie (still cryptographically
valid, only blacklisted client-side); sends it to authenticated-only endpoint.
Impact: Session restoration after logout; authentication state bypass.
Set-Cookie with the same value as the pre-login token may be a refresh/expiry update,
not a true rotation; only a different value confirms proper rotation.Cache-Control: private appears protective but still allows browser-local caching; only
no-store prevents all local caching.session_regenerate_id(true) in PHP; Session.Abandon() + new session in ASP.NET).Secure, HttpOnly, and SameSite=Strict (or Lax) on all session cookies.__Host- prefix for session cookies to enforce secure origin, host-only scope, and Path=/.Cache-Control: no-cache, no-store and Pragma: no-cache on all authenticated responses.Session fixation and [[cookie-attacks]] are two sides of the same session management problem — fixation exploits the lack of rotation on login, while cookie-attacks exploit weak attributes after the session is established. [[csrf]] can be used to fix a session: if a login form accepts a GET with a sessionid parameter, a CSRF payload can force the victim's browser to submit it. Missing __Host- or __Secure- prefixes (covered in [[cookie-attacks]]) are also prerequisites for session fixation via HTTP subdomain injection.