The urwid web display backend (urwid/display/web.py) generates web session identifiers (urwid_id)...
Summary
Vulnerability reported (CVE-2026-9323). Successful exploitation can lead to full system takeover.
Original description
The description as published by the source.
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
Source: NIST National Vulnerability Database NVD GitHub Advisory
AI summary
Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.
urwidのWebディスプレイバックエンドにおいて、PythonのMersenne Twisterを用いて生成されるセッションIDが暗号学的に安全でないため、攻撃者がセッションIDを予測できる可能性があります。334のセッションIDを観測することで内部状態を再構成でき、過去および将来のセッションIDを予測可能となります。これにより、攻撃者は被害者のセッションを乗っ取り、OSレベルのコード実行が可能です。
セッションIDが暗号学的に安全でない方法で生成され、予測可能。
urwidのWebディスプレイバックエンド (urwid/display/web.py)。
攻撃者がセッションIDを予測し、セッションを乗っ取りOSレベルのコード実行が可能。
セッションIDの生成には暗号学的に安全な乱数生成器を使用する。
セッションIDの生成方法を一時的に変更し、予測されにくい方法を用いる。
セッションIDが予測可能であるかをテストし、安全でない生成方法を識別する。
Fix status by distribution
Fixed packages published by each distribution for this CVE
- BellSoft Alpaquita BELL-CVE-2026-9323 py3-urwid Fixed in: 2.2.3-r1