---
id: CVE-2026-103022
title: >-
  Urwid: handle_short_request() crashes on non-ASCII POST body
  (UnicodeEncodeError DoS)
summary: >-
  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 remo…
severity: medium
cvss: 5.3
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'
cvssSource: cna
cwe:
  - CWE-116
  - CWE-248
  - CWE-775
vendor: urwid
product: urwid
affected:
  - urwid < 4.0.7
published: '2026-11-06'
updated: '2026-11-06'
sourceUpdated: '2026-11-06T21:33:37.028Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-103022'
references:
  - url: 'https://github.com/urwid/urwid/security/advisories/GHSA-cp25-j9x5-p5xm'
    label: 'https://github.com/urwid/urwid/security/advisories/GHSA-cp25-j9x5-p5xm'
  - url: 'https://github.com/urwid/urwid/pull/1201'
    label: 'https://github.com/urwid/urwid/pull/1201'
  - url: >-
      https://github.com/urwid/urwid/commit/b79d9a96843a6f5950bb2bfab5d059bdc61c538b
    label: >-
      https://github.com/urwid/urwid/commit/b79d9a96843a6f5950bb2bfab5d059bdc61c538b
  - url: 'https://github.com/urwid/urwid/releases/tag/4.0.7'
    label: 'https://github.com/urwid/urwid/releases/tag/4.0.7'
tags:
  - cve.org
ingestedAt: '2026-11-06T22:04:56.311Z'
epss: 0.00472
epssPercentile: 0.4107
---

## Overview

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.

## Affected

- `urwid < 4.0.7`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
