gitwtfhub

wtf is session-fixation?

qeeqbox/session-fixation — explained in plain English

Analysis updated 2026-08-07 · repo last pushed 2026-08-04

2Audience · developerComplexity · 2/5ActiveSetup · easy

TL;DR

A small Python web app that intentionally contains a session fixation flaw so learners can watch an attacker hijack a logged-in user's session step by step, plus guidance on how to fix it.

Mindmap

mindmap
  root((repo))
    What it does
      Vulnerable web app
      Demonstrates session fixation
      Hands-on attack walkthrough
    How it works
      Python web server
      Test users John and Jane
      Session ID passed via URL
    Use cases
      Learn session hijacking
      Train security teams
      Test session defenses
    Defenses explained
      Regenerate session IDs
      Secure cookie settings
      Enforce HTTPS
    Audience
      Developers
      Security learners
      Product teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Run the vulnerable app locally and follow the walkthrough to see a session hijack happen live.

REASON 2

Teach a security workshop by demoing how an attacker reuses a known session token after the victim logs in.

REASON 3

Practice the fix by regenerating session IDs on login and verifying the attack no longer works.

REASON 4

Show product teams why issuing a fresh session token after authentication matters for account security.

What's in the stack?

Python

How it stacks up

qeeqbox/session-fixation0-bingwu-0/live-interpreter010zx00x1/faresnipe
Stars222
LanguagePythonPython
Last pushed2026-08-04
MaintenanceActive
Setup difficultyeasymoderateeasy
Complexity2/52/52/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Just clone and run a small Python web server locally, no external services or API keys required.

No license information is provided in the repository, so default copyright restrictions apply and usage rights are unclear.

Wtf does this do

This project is a deliberately vulnerable web app that demonstrates a security flaw called "session fixation." It exists to teach developers, security learners, and product teams how attackers can hijack user accounts without ever needing a password. Session fixation works because of a simple mistake: when someone logs in, the app fails to give them a fresh session identifier. A session identifier is a small token your browser uses to prove who you are after you've authenticated. In this attack, a bad actor obtains a valid but unauthenticated token, tricks a victim into using it, and then waits for the victim to log in. Since the app never issues a new token after login, the attacker can reuse the known identifier to step into the victim's authenticated session and take over the account. The repository lets you run a small Python web server that intentionally has this flaw. You clone the code, start the app, and log in as a test user named John. By following the included walkthrough, you can open a separate browser tab, pass John's session identifier through the URL, log in as a different user named Jane, and then refresh John's tab to see Jane's session appear. It's a hands-on way to watch the attack happen step by step. The README also explains how to fix the underlying problem. The primary defense is regenerating session identifiers immediately after a successful login so old tokens become useless. Other recommendations include using secure cookie settings, enforcing HTTPS, monitoring for suspicious session activity, and expiring inactive sessions. The project's value is in making an abstract security concept concrete and visible.

Yoink these prompts

Prompt 1
Clone qeeqbox/session-fixation, start the Python web server, and walk me through logging in as John and then hijacking his session using the URL-based session identifier trick shown in the README.
Prompt 2
Explain how the session fixation attack in qeeqbox/session-fixation works step by step, then show me the code changes needed to regenerate the session ID on login so the attack fails.
Prompt 3
Using qeeqbox/session-fixation as the example, help me set up the vulnerable app and write a short demo script for a security training session covering the attack, the fix, and secure cookie settings.
Prompt 4
Help me add a second defense layer to qeeqbox/session-fixation by implementing session expiration after 10 minutes of inactivity, then test that an old session ID can no longer access the app.

Frequently asked questions

wtf is session-fixation?

A small Python web app that intentionally contains a session fixation flaw so learners can watch an attacker hijack a logged-in user's session step by step, plus guidance on how to fix it.

Is session-fixation actively maintained?

Active — commit in last 30 days (last push 2026-08-04).

What license does session-fixation use?

No license information is provided in the repository, so default copyright restrictions apply and usage rights are unclear.

How hard is session-fixation to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is session-fixation for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.