Urwid: handle_short_request() crashes on non-ASCII POST body (UnicodeEncodeError DoS)

State
Published
Severity
5.3 Medium
Published
Nov 6, 2026
Updated
Nov 11, 2026
Reserved
Sep 29, 2026

Read the record on cve.org

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.

ProductVersions
urwid urwid< 4.0.7 Affected

Weaknesses

  • CWE-116 Improper Encoding or Escaping of Output
  • CWE-248 Uncaught Exception
  • CWE-775 Missing Release of File Descriptor or Handle after Effective Lifetime

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.