[ CVE-2026-103022 · Published 6 Nov 2026 ]
Urwid: handle_short_request() crashes on non-ASCII POST body (UnicodeEncodeError DoS)
[ Description ]Official description
Urwid is a console user interface library for Python. Prior to 4.0.7, handle_short_request() in urwid/display/web.py performs unguarded character encoding on POST input and unguarded UTF-8 decoding on polling update socket output. A remote attacker who obtains a valid X-Urwid-ID session token can submit non-ASCII POST data that raises UnicodeEncodeError, while non-UTF-8 polling output raises UnicodeDecodeError, causing the CGI handler to return an error and terminate request processing. The POST exception path also leaves an opened file descriptor unclosed for the CGI process lifetime, so repeated requests can cause denial of service for the web display interface. This issue is fixed in version 4.0.7.
[ Fixes ]How to fix it
- urwid 4.0.7Fixed version · GitHub Advisories · pip package urwid: upgrade to 4.0.7 or later (affected <= 4.0.6)
Fixed versions
- urwid: upgrade to 4.0.7 or laterEarlier versions are listed as affected
From the affected-version ranges in the CVE record. Check the vendor's advisory for the exact release for your platform or branch.
Vendor advisories and patches
- Vendor advisorygithub.com
- Patchgithub.com
- Release notesgithub.com
[ Packages ]Affected open-source packages
- urwid pipAffected <= 4.0.6 · fixed in 4.0.7 · GHSA-cp25-j9x5-p5xm