CWE-338Weakness · CWE-338

CVE-2026-9323

HIGH · 8.1 CVSS v3.1 Published 2026-07-18
Patch available
A vendor patch is available. No clean upgrade release — apply the published patch.
See remediation →
90/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click Patch available

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 · unedited
The 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 confidence

The 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.

MitigationReplace 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.

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 checks

Work through these to decide whether this CVE applies to you.

  1. Check if urwid package is installed
    Run 'pip show urwid' or check your package manager for the urwid library
    Affected if urwid is installed and the web display backend feature is in use
  2. Identify urwid web display backend processes
    Look for processes using urwid's web display functionality (often related to curses-based web interfaces); check for applications importing urwid.web modules
    Affected if Your application uses urwid.web or similar modules for web-based terminal display
  3. Inspect FIFO files in /tmp
    List files in /tmp matching urwid patterns (ls -la /tmp/*urwid* or similar) and check permissions
    Affected if FIFO files exist in /tmp with world-readable permissions (mode 644 or similar, not restricted to owner only)
  4. Check for X-Urwid-ID header in web traffic
    Monitor HTTP requests/responses for the X-Urwid-ID header being set or used
    Affected if Your urwid web display generates and transmits X-Urwid-ID session identifiers to clients
  5. Verify session ID generation method
    Examine urwid library source code (typically in site-packages/urwid/) for usage of random.randrange() in session ID generation, particularly in web display modules
    Affected 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 data
Patch available Apply the vendor patch
Vendor patch github.com →
Interim mitigation

Replace 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.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing2.0 h
  • Review / QA1.0 h
9.0 hours of engineering $1,600
Get the patch applied

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-9323 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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