---
id: "CVE-2026-103022"
page: "https://infrastack.ai/live/CVE-2026-103022"
kind: "vulnerability"
aliases: ["CVE-2026-103022"]
title: "Urwid: crafted web input crashes handler and leaks file descriptors"
severity: "medium"
cvss: 5.3
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["package", "python", "urwid", "web-display"]
not_affected_if: ["auth-required", "console-only-use", "no-web-display"]
published_at: "2026-11-06T22:17:49+00:00"
first_seen_at: "2026-11-06T22:44:32+00:00"
updated_at: "2026-11-06T22:44:51+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-103022", "first_seen_at": "2026-11-06T22:44:32+00:00"}]
exploit_sources: []
---

# Urwid: crafted web input crashes handler and leaks file descriptors

Link for people: https://infrastack.ai/live/CVE-2026-103022 (this .md is for agents)

Urwid is a Python console UI library whose web display handler mishandles non-ASCII POST input and non-UTF-8 output without guards. An attacker holding a valid session token can make the CGI handler error out and leak file descriptors, enabling denial of service of the web display interface.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Urwid version with `pip show urwid` or `python -c "import urwid; print(urwid.__version__)"`
- Look for applications that use the web display module (urwid/display/web.py) and are reachable by users

## Fix

- Urwid: move to `4.0.7` or later

## Timeline

- 2026-11-06T22:44:32+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-103022

## Documents

- [advisory] Vendor advisory: github.com https://github.com/urwid/urwid/security/advisories/GHSA-cp25-j9x5-p5xm
- [fix] Patch: github.com https://github.com/urwid/urwid/commit/b79d9a96843a6f5950bb2bfab5d059bdc61c538b
- [fix] Release notes: github.com https://github.com/urwid/urwid/releases/tag/4.0.7

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
