Insecure PRNG and Information Exposure in urwid Web Display Backend
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
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-9323
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 12:14 UTC · Revision 1
Source evidence
Insecure PRNG and Information Exposure in urwid Web Display Backend
core-osv · Original sourcePublished 18 Jul 2026, 13:51 UTC
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
osv:CVE-2026-9323
Complete source record
{
"id": "8d5da99688e2c4f06e62f73c70dee969daa19bbed33381c72c3363c32bb5c06c",
"url": "https://osv.dev/vulnerability/CVE-2026-9323",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Insecure PRNG and Information Exposure in urwid Web Display Backend",
"summary": "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",
"evidence": "osv:CVE-2026-9323",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2026-9323",
"aliases": [
"CVE-2026-9323",
"GHSA-rjwp-g85x-gmjv"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/urwid/urwid",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "24acd12f0d0598036d0d577f2ee63e4a27b4a3d9"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"last_affected": "24acd12"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"fixed": "24acd12f0d0598036d0d577f2ee63e4a27b4a3d9"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"4.0.1",
"4.0.0",
"3.0.5",
"3.0.4",
"3.0.3",
"3.0.2",
"3.0.1",
"3.0.0",
"2.6.16",
"2.6.15",
"2.6.14",
"2.6.13",
"2.6.12",
"2.6.11",
"2.6.10",
"2.6.9",
"2.6.8",
"2.6.7",
"2.6.6",
"2.6.5",
"2.6.4",
"2.6.3",
"2.6.2",
"2.6.1",
"2.6.0.post0",
"2.6.0",
"2.5.3",
"2.5.2",
"2.5.1",
"2.5.0",
"2.4.6",
"2.4.5",
"2.4.4",
"2.4.3",
"2.4.2",
"2.4.1",
"2.4.0",
"2.3.4",
"2.2.3",
"2.2.2",
"2.2.1",
"2.2.0",
"release-2.1.2",
"release-2.1.0",
"release-2.0.1",
"release-2.0.0",
"release-1.3.1",
"release-1.3.0",
"release-1.2.1",
"release-1.2.0",
"release-1.1.0",
"release-1.0.1",
"release-1.0.0",
"release-0.9.8",
"release-0.9.7.2",
"release-0.9.7.1",
"release-0.9.7",
"release-0.9.6",
"release-0.9.5",
"release-0.9.4",
"release-0.9.3",
"release-0.9.2",
"release-0.9.1",
"release-0.9.0",
"release-0.9.0-pre3",
"release-0.9.0-pre2",
"release-0.9.0-pre1",
"release-0.8.10",
"release-0.8.9",
"release-0.8.8",
"release-0.8.7",
"release-0.8.6",
"release-0.8.5",
"release-0.8.4",
"release-0.8.3",
"release-0.8.2",
"release-0.8.1",
"release-0.8.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-9323.json"
}
}
],
"modified": "2026-10-28T02:30:28.420263263Z",
"provider": "osv",
"references": [
"https://lists.debian.org/debian-lts-announce/2026/09/msg00015.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/9xxx/CVE-2026-9323.json",
"https://github.com/urwid/urwid/security/advisories/GHSA-rjwp-g85x-gmjv",
"https://nvd.nist.gov/vuln/detail/CVE-2026-9323",
"https://www.vulncheck.com/advisories/insecure-prng-and-information-exposure-in-urwid-web-display-backend",
"https://github.com/urwid/urwid/issues/1127",
"https://github.com/urwid/urwid/pull/1128",
"https://github.com/urwid/urwid/commit/24acd12f0d0598036d0d577f2ee63e4a27b4a3d9",
"https://github.com/urwid/urwid"
],
"provider_metadata": {
"cwe_ids": [
"CWE-338"
],
"cna_assigner": "VulnCheck",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/9xxx/CVE-2026-9323.json"
}
},
"related_cves": [
{
"value": "CVE-2026-9323",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 495302,
"published_at": "2026-07-18T13:51:06.021+00:00"
}