MEDIUM · CVSS 3.1 5.3 EPSS 0.6% · 46th percentile CWE-116CWE-248CWE-775

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

Published 2026-11-09 · Updated 2026-11-09 · Also known as GHSA-cp25-j9x5-p5xm

Summary

The Urwid library contains an unhandled exception vulnerability in its web display module that can lead to Denial of Service (DoS) via malformed POST requests. Organizations using the Urwid web display interface should upgrade to version 4.0.7 or later to address the issue.

Who is affected

Affected deployments are those utilizing the Urwid CGI web interface, which is vulnerable to unhandled UnicodeEncodeError and UnicodeDecodeError exceptions. An attacker can trigger these crashes by sending POST requests with non-ASCII bytes, resulting in HTTP 500 errors and file descriptor leaks. This enables a denial of service attack against legitimate users of the interface.

Exploitability

The vulnerability is rated as medium severity with a CVSS 3.1 score of 5.3, indicating it is network-accessible with low attack complexity. While the EPSS score of 0.005 suggests a relatively low probability of exploitation, the vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
PyPI urwid >= 0, < 4.0.7 4.0.7 python -m pip install 'urwid>=4.0.7'

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Attack vectorNetwork
Attack complexityLow
Privileges requiredNone
User interactionNone
ScopeUnchanged
ConfidentialityNone
IntegrityNone
AvailabilityLow

FAQ

What is the primary cause of the DoS condition?

The handle_short_request function attempts to encode non-ASCII POST input into ASCII, which triggers an unhandled UnicodeEncodeError and crashes the CGI process.

Are there any side effects beyond the service crashing?

Yes, a file descriptor leak occurs because the function fails to close the descriptor before the exception propagates, impacting the CGI process.

Is this vulnerability actively exploited in the wild?

No, this vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

Original advisory description
### Summary 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`. ### Impact 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. This results in a Denial of Service (DoS) for legitimate users using the `urwid` web interface. ### Affected Versions `urwid <= 4.0.6` ### Patches Fixed in `urwid 4.0.7`. Users should upgrade to version `4.0.7` or later. ### Workarounds No direct workaround exists short of disabling the `urwid` web display interface.

References

Source records: GHSA-cp25-j9x5-p5xm (OSV.dev) · EPSS by FIRST, 2026-11-26.