GHSA-cp25-j9x5-p5xm

Suggest an improvement
Source
https://github.com/advisories/GHSA-cp25-j9x5-p5xm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-cp25-j9x5-p5xm/GHSA-cp25-j9x5-p5xm.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-cp25-j9x5-p5xm
Aliases
Published
2026-11-09T22:05:06Z
Modified
2026-11-09T22:15:03Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L CVSS Calculator
Summary
Urwid: handle_short_request() crashes on non-ASCII POST body (UnicodeEncodeError DoS)
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-116",
        "CWE-248",
        "CWE-775"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-09T22:05:06Z",
    "nvd_published_at": "2026-11-06T22:17:49Z",
    "severity": "MODERATE"
}
References

Affected packages

PyPI / urwid

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
4.0.7

Affected versions

0.*
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.8.5
0.8.6
0.8.7
0.8.8
0.8.9
0.8.10
0.9.0-pre2
0.9.0-pre3
0.9.0
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.6
0.9.7
0.9.7.2
0.9.8
0.9.8.2
0.9.8.3
0.9.8.4
0.9.9
0.9.9.1
0.9.9.2
1.*
1.0.0
1.0.1
1.0.2
1.1.0
1.1.1
1.1.2
1.2.0
1.2.1
1.2.2
1.3.0
1.3.1
2.*
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.2.0
2.2.1
2.2.2
2.2.3
2.3.4
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
2.4.6
2.5.0
2.5.1
2.5.2
2.5.3
2.6.0
2.6.0.post0
2.6.1
2.6.2
2.6.3
2.6.4
2.6.5
2.6.6
2.6.7
2.6.8
2.6.9
2.6.10
2.6.11
2.6.12
2.6.13
2.6.14
2.6.15
2.6.16
3.*
3.0.0
3.0.1
3.0.2
3.0.3
3.0.4
3.0.5
4.*
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
4.0.5
4.0.6

Database specific

last_known_affected_version_range
"<= 4.0.6"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-cp25-j9x5-p5xm/GHSA-cp25-j9x5-p5xm.json"