{"id":"GHSA-cp25-j9x5-p5xm","summary":"Urwid: handle_short_request() crashes on non-ASCII POST body (UnicodeEncodeError DoS)","details":"### Summary\nThe `handle_short_request()` function in `urwid/display/web.py` raises an unhandled `UnicodeEncodeError` when processing a POST request body containing non-ASCII bytes. The function reads POST input and encodes it to ASCII before writing to a named pipe. Any byte value above `0x7F` causes the CGI process to exit with an unhandled exception, returning an HTTP 500 error to the client. Additionally, a file descriptor opened earlier in the same function is not closed before the exception propagates, causing a file descriptor leak for the lifetime of the CGI process.\n\nA second instance of missing exception handling exists in the polling update path, where non-UTF-8 socket output causes an unhandled `UnicodeDecodeError`.\n\n### Impact\nAn attacker who observes a valid `X-Urwid-ID` session token (transmitted in plaintext HTTP response headers) can send repeated POST requests containing non-ASCII bytes to the `urwid` CGI endpoint. Each malformed request causes the CGI handler to crash with HTTP 500. This results in a Denial of Service (DoS) for legitimate users using the `urwid` web interface.\n\n### Affected Versions\n`urwid \u003c= 4.0.6`\n\n### Patches\nFixed in `urwid 4.0.7`. Users should upgrade to version `4.0.7` or later.\n\n### Workarounds\nNo direct workaround exists short of disabling the `urwid` web display interface.","aliases":["CVE-2026-103022"],"modified":"2026-11-09T22:15:03.936151642Z","published":"2026-11-09T22:05:06Z","database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-11-09T22:05:06Z","nvd_published_at":"2026-11-06T22:17:49Z","cwe_ids":["CWE-116","CWE-248","CWE-775"]},"references":[{"type":"WEB","url":"https://github.com/urwid/urwid/security/advisories/GHSA-cp25-j9x5-p5xm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-103022"},{"type":"WEB","url":"https://github.com/urwid/urwid/pull/1201"},{"type":"WEB","url":"https://github.com/urwid/urwid/commit/b79d9a96843a6f5950bb2bfab5d059bdc61c538b"},{"type":"PACKAGE","url":"https://github.com/urwid/urwid"},{"type":"WEB","url":"https://github.com/urwid/urwid/releases/tag/4.0.7"}],"affected":[{"package":{"name":"urwid","ecosystem":"PyPI","purl":"pkg:pypi/urwid"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.7"}]}],"versions":["0.8.0","0.8.1","0.8.10","0.8.2","0.8.3","0.8.4","0.8.5","0.8.6","0.8.7","0.8.8","0.8.9","0.9.0","0.9.0-pre2","0.9.0-pre3","0.9.1","0.9.2","0.9.3","0.9.4","0.9.5","0.9.6","0.9.7","0.9.7.2","0.9.8","0.9.8.2","0.9.8.3","0.9.8.4","0.9.9","0.9.9.1","0.9.9.2","1.0.0","1.0.1","1.0.2","1.1.0","1.1.1","1.1.2","1.2.0","1.2.1","1.2.2","1.3.0","1.3.1","2.0.0","2.0.1","2.1.0","2.1.1","2.1.2","2.2.0","2.2.1","2.2.2","2.2.3","2.3.4","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.5.0","2.5.1","2.5.2","2.5.3","2.6.0","2.6.0.post0","2.6.1","2.6.10","2.6.11","2.6.12","2.6.13","2.6.14","2.6.15","2.6.16","2.6.2","2.6.3","2.6.4","2.6.5","2.6.6","2.6.7","2.6.8","2.6.9","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"database_specific":{"last_known_affected_version_range":"\u003c= 4.0.6","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-cp25-j9x5-p5xm/GHSA-cp25-j9x5-p5xm.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"}]}