
Proof-of-concept and lab for CVE-2026-104773, a CKAN session fixation flaw in RegisterView.post where the session ID is not regenerated on registration.
| CVE | CVE-2026-104773 |
| Component | CKAN — RegisterView.post (ckan/views/user.py) |
| Affected | < 2.10.11, 2.11.0 – 2.11.5 (server-side session storage) |
| Fixed in | 2.10.11 / 2.11.6 / 2.12.0 — commit 6eae4e9c (GHSA-6499-jgj4-2wpf) |
| CWE | CWE-384 (Session Fixation) |
| Impact | The registration view logs the new user in without regenerating the session identifier; with server-side session storage an attacker who fixes a session cookie on the victim's browser (or steals a valid session) keeps that same ID after the victim registers, hijacking the authenticated session |
| Vector | Network — attacker pre-sets a session ID, victim registers through it |
| Trigger | register a new account while carrying an attacker-fixed session ID |
The vulnerable registration logged the user in without rotating the session:
# RegisterView.post — pre-fix
userobj = model.User.get(user_dict["id"])
if userobj:
login_user(userobj) # session ID unchanged
rotate_token()
The fix regenerates the session first:
# fixed (commit 6eae4e9c)
userobj = model.User.get(user_dict["id"])
if userobj:
regenerate_session() # rotate the session ID
login_user(userobj)
rotate_token()
def regenerate_session() -> None:
regenerate = getattr(current_app.session_interface, 'regenerate', None)
if regenerate is not None:
regenerate(session)
RegisterView.post() creates the user and then logs them in programmatically
(login_user) without regenerating the session identifier. When CKAN is
configured with server-side session storage, the session ID is a bearer token
held server-side; an attacker who can set a cookie on the victim's browser (or
who already holds a valid session) can fix a known session ID, let the victim
register and authenticate through it, and then reuse that same ID to hijack the
now-authenticated session. CKAN's default cookie-based session storage is not
affected (the session data travels with the cookie and is not a fixed
server-side key). The fix adds regenerate_session() before login_user() in
the registration flow (and refactors login() to use the same helper), so the
session ID is rotated on registration.
| service | image | role |
|---|---|---|
ckan-vuln | cve-2026-104773:vuln | real RegisterView.post (pre-fix) |
ckan-fixed | cve-2026-104773:fixed | real post + helper (vendor fix 6eae4e9c) |
poc | cve-2026-104773-poc:local | stdlib-only Python driver |
A Python harness drives the real RegisterView.post() verbatim from each tag
through the anonymous successful-registration path. The CKAN/Flask dependencies
are stubbed; a mocked server-side session interface records regeneration. The
harness reports the session ID before and after registration. Both sides differ
only in the upstream method source.
./run-lab.sh build # builds both sides (python:3.12-slim)
./run-lab.sh up # cve104773lab network: ckan-vuln / ckan-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (stdlib only):
A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=ckan-vuln
# exit 1 on confirmed session fixation, 0 on a safe target
| observation | ckan-vuln (pre-fix) | ckan-fixed (6eae4e9c) |
|---|---|---|
| session before | ATTACKER_FIXED_SID | ATTACKER_FIXED_SID |
| session after | ATTACKER_FIXED_SID (preserved) | REGENERATED_xxxxxxxx |
| regenerated | false (fixation) | true |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve104773lab
network.ckan.auth.create_user_via_web); the
default cookie-based session storage is not affected.The fixed RegisterView.post calls regenerate_session() before login_user(),
rotating the session ID on registration so a pre-set attacker session ID cannot
survive into the authenticated session. The login() path also uses the same
regenerate_session() helper. No fixation path remains on the registration flow
(server-side sessions).
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/lab.Dockerfile builds both sides from upstream method source
lab/vendor/ verbatim RegisterView.post (+ helper) from pre-fix / fix
lab/stubs.py minimal CKAN/Flask stubs + session interface mock
lab/gen.py assembles the harness from the verbatim method
lab/service.py HTTP wrapper (POST /register)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)