CVE-2026-9323 Details
Description
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
A vulnerability exists in the Urwid web display backend, specifically in the session ID generation process. The backend uses Python's Mersenne Twister pseudo-random number generator (PRNG) to create web session identifiers. This PRNG is not cryptographically secure, allowing an attacker to predict session IDs. The vulnerability arises because each session ID is generated by concatenating two random numbers from the PRNG, which can be observed through the X-Urwid-ID HTTP response header. An attacker who collects approximately 334 session IDs can reconstruct the internal state of the PRNG and predict all past and future session IDs. Additionally, the session ID is used as the filename for a FIFO (named pipe) created in the world-readable /tmp directory. This exposure allows any local user to enumerate active session tokens directly. With a valid session ID, an attacker can read the victim's terminal screen, inject keystrokes (potentially leading to OS-level code execution if the session runs a shell), and disrupt the session by flooding the FIFO or injecting exit sequences.
The vulnerability has been addressed in Urwid version 4.0.4, which is available on the project's GitHub releases page.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 18, 2026CISA-ADP
Assessed Jul 20, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://lists.debian.org/debian-lts-announce/2026/09/msg00015.html | CVE | |
| https://github.com/urwid/urwid | [email protected] | Vendor |
| https://github.com/urwid/urwid/commit/24acd12f0d0598036d0d577f2ee63e4a27b4a3d9 | [email protected] | Source CodeVendor |
| https://github.com/urwid/urwid/issues/1127 | [email protected] | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/urwid/urwid/pull/1128 | [email protected] | Issue TrackingVendor |
| https://github.com/urwid/urwid/security/advisories/GHSA-rjwp-g85x-gmjv | [email protected] | AdvisoryBroken LinkVendor |
| https://www.vulncheck.com/advisories/insecure-prng-and-information-exposure-in-urwid-web-display-backend | [email protected] | AdvisoryBundleRemedy |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-338 | Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| urwid | <= 24acd12 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 15, 2026 | CVE Modified | [email protected] |
| Sep 15, 2026 | CVE Modified | CVE |
| Jul 20, 2026 | CVE Modified | CISA-ADP |
| Jul 18, 2026 | New CVE Received | [email protected] |
Volerion