CVE-2026-9323
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedThe urwid web display backend (urwid/display/web.py) generates web session identifiers (urwid_id) in Screen.start() by concatenating two random.randrange(10**9) calls that use Python's Mersenne Twister PRNG, which is not cryptographically secure. Each call consumes approximately 30 bits of PRNG state, and the Mersenne Twister internal state is approximately 19,937 bits, so an attacker who observes approximately 334 session IDs (for example via the X-Urwid-ID HTTP response header) can fully reconstruct the internal state and predict all past and future session IDs (Path B). The same identifier is also used as the filename of a FIFO created in the world-listable /tmp directory (for example /tmp/urwid375487765176907690.in), so any local user on the host can list /tmp to enumerate active session tokens directly (Path A). With a valid session ID, an attacker can read the victim's terminal screen via the polling endpoint, inject keystrokes into the victim's session (yielding OS-level code execution with the session owner's privileges if the session runs a shell), and inject exit sequences or flood the FIFO to terminate or crash the session. A prior Bandit S311 warning on this usage was suppressed with # noqa: S311 rather than fixed
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceThe urwid web display backend uses Python's non-cryptographic Mersenne Twister PRNG (random.randrange) to generate session identifiers by concatenating two 9-digit numbers. An attacker observing ~334 session IDs can reconstruct the PRNG state and predict all past/future session IDs. Additionally, the session ID is used as a world-readable FIFO filename in /tmp, allowing local users to enumerate active sessions and perform attacks including screen reading, keystroke injection, and session crash/termination.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- High
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Check if urwid package is installedRun 'pip show urwid' or check your package manager for the urwid libraryAffected if urwid is installed and the web display backend feature is in use
-
Identify urwid web display backend processesLook for processes using urwid's web display functionality (often related to curses-based web interfaces); check for applications importing urwid.web modulesAffected if Your application uses urwid.web or similar modules for web-based terminal display
-
Inspect FIFO files in /tmpList files in /tmp matching urwid patterns (ls -la /tmp/*urwid* or similar) and check permissionsAffected if FIFO files exist in /tmp with world-readable permissions (mode 644 or similar, not restricted to owner only)
-
Check for X-Urwid-ID header in web trafficMonitor HTTP requests/responses for the X-Urwid-ID header being set or usedAffected if Your urwid web display generates and transmits X-Urwid-ID session identifiers to clients
-
Verify session ID generation methodExamine urwid library source code (typically in site-packages/urwid/) for usage of random.randrange() in session ID generation, particularly in web display modulesAffected if The code uses random.randrange() or random.random() instead of os.urandom or secrets module for generating session identifiers
You are affected if you use urwid with its web display backend and session IDs are generated using random.randrange or FIFOs are created in world-readable /tmp, allowing observation of X-Urwid-ID headers or local session enumeration.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
From vendor dataReplace random.randrange() with Python's secrets module (secrets.randbelow or secrets.token_hex) for cryptographically secure session ID generation, and ensure the FIFO file in /tmp has restrictive permissions (mode 0600) or use a protected directory.
- Consultation2.0 h
- Implementation4.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,560.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-9323 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-9323 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data