All vulnerabilities

PyPI

CVE-2026-103022

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

Severity
Medium 5.3
Published
9 Nov 2026
Last changed
9 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
4.0.7
Exploit chance
0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Improper output encoding (CWE-116)Uncaught exception (CWE-248)CWE-775
Attack
Over the network · No login needed · No user action needed
Attacker can
Slow it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Also known as
GHSA-cp25-j9x5-p5xm
Sources
OSV.dev and GitHub

Description

The 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.

A second instance of missing exception handling exists in the polling update path, where non-UTF-8 socket output causes an unhandled UnicodeDecodeError.

An 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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

No direct workaround exists short of disabling the urwid web display interface.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
urwidPyPI · osv:PyPI:urwid
  • Every version before 4.0.7

About urwid

This is the only vulnerability in urwid in our list.

References