{"id":"GHSA-83x9-8wvq-rrcp","kind":"vulnerability","aliases":["GHSA-83x9-8wvq-rrcp"],"related":[],"title":"Duplicate Advisory: urwid: Insecure PRNG and Information Exposure in Web Display Backend","description":"### Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-rjwp-g85x-gmjv. This link is maintained to preserve external references.\n\n### Original Description\nThe 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","summary":"The urwid web display backend builds session IDs from Python's non-cryptographic random generator, and the same ID names a FIFO in the world-readable /tmp directory. An attacker who can list /tmp or observe enough IDs can read a victim's terminal screen and inject keystrokes, which can mean code execution as the session owner.","severity":"critical","cvss":8.1,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"urwid","fixed":["4.0.6"],"affected":"< 4.0.6","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-338","package","python","self-hosted","urwid"],"not_affected_if":["no-web-display-backend","terminal-only-usage"],"how_to_check":"- Check the installed urwid version with `pip show urwid`\n- Look for `urwid/display/web.py` in the environment and whether the web display backend is used\n- Check for FIFOs named `urwid*.in` in `/tmp`","fix":"- `urwid` `4.0.6` (fixed version per product data)","status":"withdrawn","published_at":"2026-07-18T15:31:50+00:00","first_seen_at":"2026-11-05T15:20:50+00:00","triaged_at":"2026-11-05T15:21:59+00:00","updated_at":"2026-11-05T15:21:59+00:00","category":"package","confidence":0.6,"triage":{"at":"2026-11-05T15:21:59Z","model":"claude-haiku-5-5","output":{"fix":"- `urwid` `4.0.6` (fixed version per product data)","reach":"local","title":"urwid: predictable web session IDs let attackers read and type into terminals","impact":"high","summary":"The urwid web display backend builds session IDs from Python's non-cryptographic random generator, and the same ID names a FIFO in the world-readable /tmp directory. An attacker who can list /tmp or observe enough IDs can read a victim's terminal screen and inject keystrokes, which can mean code execution as the session owner.","audience":"developers","category":"package","nicknames":[],"who_cares":["python","urwid","self-hosted"],"confidence":0.6,"fix_status":"available","needs_auth":"unknown","worst_case":"attacker reads terminal screens and injects keystrokes into shell sessions","analyst_note":"Advisory is withdrawn as a duplicate; confirm the canonical GHSA-rjwp-g85x-gmjv entry for the affected range and reach (local /tmp listing vs network polling).","how_to_check":"- Check the installed urwid version with `pip show urwid`\n- Look for `urwid/display/web.py` in the environment and whether the web display backend is used\n- Check for FIFOs named `urwid*.in` in `/tmp`","plain_action":"","needs_analyst":true,"not_affected_if":["no-web-display-backend","terminal-only-usage"],"who_is_affected":"Only applications that run urwid's web display backend (Screen.start in urwid/display/web.py) are exposed; applications using other urwid display backends are not. The advisory was withdrawn as a duplicate of GHSA-rjwp-g85x-gmjv, so the affected range and fix come from the product data here rather than a standalone advisory.","user_interaction":"unknown","needs_special_setup":"yes","severity_if_unknown":"unknown"},"cost_usd":0.000791,"input_tokens":4708,"output_tokens":640,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-338':25B '/tmp':60B,67B,226C,240C '/tmp/urwid375487765176907690.in':230C '10':137C '19':169C '30':156C '334':178C '83x9':15A,20A '8wvq':16A,21A '9':138C '937':170C 'activ':243C 'advisori':2A,92C,94C 'also':212C 'approxim':155C,168C,177C 'attack':63B,174C,255C 'b':207C 'backend':12A,36B,123C 'bandit':308C 'bit':157C,171C 'build':37B 'call':139C,153C 'code':85B,278C 'concaten':134C 'consum':154C 'crash':303C 'creat':220C 'cryptograph':45B,150C 'cwe':24B 'descript':118C 'direct':246C 'directori':61B,227C 'display':11A,35B,122C 'duplic':1A,91C,102C 'endpoint':266C 'enough':70B 'enumer':242C 'exampl':182C,229C 'execut':86B,279C 'exit':294C 'exposur':8A 'extern':115C 'fifo':54B,219C,299C 'filenam':216C 'fix':321C 'flood':297C 'fulli':193C 'futur':203C 'g85x':107C 'generat':47B,125C 'ghsa':14A,19A,105C 'ghsa-83x9-8wvq-rrcp':13A,18A 'ghsa-rjwp-g85x-gmjv':104C 'gmjv':108C 'header':191C 'host':30B,237C 'http':189C 'id':39B,51B,71B,130C,180C,188C,205C,253C 'identifi':128C,210C 'inform':7A 'inject':80B,267C,293C 'insecur':4A 'intern':165C,196C 'keystrok':81B,268C 'level':277C 'link':110C 'list':66B,239C 'listabl':225C 'local':233C 'maintain':112C 'mean':84B 'mersenn':144C,163C 'name':52B 'non':44B 'non-cryptograph':43B 'noqa':317C 'observ':69B,176C 'origin':117C 'os':276C 'os-level':275C 'owner':90B,283C 'packag':26B 'past':201C 'path':206C,247C 'poll':265C 'predict':199C 'preserv':114C 'prior':307C 'privileg':285C 'prng':5A,146C,159C 'python':27B,41B,142C 'random':46B 'random.randrange':136C 'rather':319C 'read':73B,257C 'readabl':59B 'reconstruct':194C 'refer':116C 'respons':190C 'rjwp':106C 'rrcp':17A,22A 'run':289C 's311':309C,318C 'screen':78B,262C 'screen.start':132C 'secur':151C 'self':29B 'self-host':28B 'sequenc':295C 'session':38B,89B,127C,179C,204C,244C,252C,273C,282C,288C,305C 'shell':291C 'state':160C,166C,197C 'suppress':315C 'termin':77B,261C,301C 'token':245C 'twister':145C,164C 'two':135C 'urwid':3A,23A,31B,33B,120C,129C,187C 'urwid/display/web.py':124C 'usag':313C 'use':141C,213C 'user':234C 'valid':251C 'via':183C,263C 'victim':75B,259C,271C 'warn':310C 'web':10A,34B,121C,126C 'withdrawn':97C 'world':58B,224C 'world-list':223C 'world-read':57B 'x':186C 'x-urwid-id':185C 'yield':274C","nicknames":[],"mitigations":[],"who_affected":"Only applications that run urwid's web display backend (Screen.start in urwid/display/web.py) are exposed; applications using other urwid display backends are not. The advisory was withdrawn as a duplicate of GHSA-rjwp-g85x-gmjv, so the affected range and fix come from the product data here rather than a standalone advisory.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["urwid"],"ptokens":["urwid"],"labels":["critical","cwe338","package","pypi","python","selfhosted","urwid"],"campaign_type":null,"first_public_at":"2026-07-18T15:31:50+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-83x9-8wvq-rrcp","url":"https://github.com/advisories/GHSA-83x9-8wvq-rrcp","severity":"critical","published_at":"2026-07-18T15:31:50+00:00","modified_at":"2026-11-05T15:17:28+00:00","first_seen_at":"2026-11-05T15:20:50+00:00","fetched_at":"2026-11-05T15:20:50+00:00","note":null}],"documents":[{"id":77202,"url":"https://github.com/urwid/urwid/security/advisories/GHSA-rjwp-g85x-gmjv","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":77203,"url":"https://github.com/urwid/urwid/pull/1128","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":77204,"url":"https://github.com/urwid/urwid/commit/24acd12f0d0598036d0d577f2ee63e4a27b4a3d9","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"}],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}