Cloudanix VulnDB

CVE-2024-49768

None

CVSS

—

EPSS

0.5%

Published

Oct 29, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in a Python web server component can let an attacker sneak an extra request through when the server is set to look ahead for more requests, though the issue is avoided by the normal settings used by most sites.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Full Compromise
Component
Network Service
Class
Race Condition
Remediation
Upgrade
Effort
Low
Patch risk
Low

What it actually does

Race condition in request handling allows a pipelined secondary HTTP request to be processed by a worker thread after the primary request triggers a parsing error and the connection should have been closed, when channel_request_lookahead is enabled.

Why it matters to the business

Organizations using the affected WSGI server with lookahead enabled face a risk of unintended request processing that bypasses connection closure logic, potentially leading to resource misuse or exposure of application behavior; default configuration leaves most deployments unaffected.

How an attack unfolds

An attacker sends an initial request exactly recv_bytes long that causes a parsing failure, immediately followed by a pipelined secondary request; with lookahead enabled the server begins error response handling while queuing and servicing the secondary request on the same connection that should have closed.

How to fix it

Upgrade pylons/waitress to the fixed commit ae949bb428e50cf04152db56460f31c1e6d3a2a9 (version 3.0.1) or later; for affected Moodle packages on Ubuntu 16.04 and 18.04 upgrade to 3.0.3+dfsg-0ubuntu1 or newer; as a workaround ensure channel_request_lookahead remains disabled (default value of 0).

How to confirm the fix worked

Verify installed Waitress version is 3.0.1 or newer via package metadata or pip show; confirm channel_request_lookahead setting is 0 in configuration; test request handling with a malformed request followed by pipelined traffic to ensure connection closure occurs as expected.

Typical attack path

  1. Craft and send first HTTP request of exactly recv_bytes length designed to trigger a parsing error
  2. Immediately pipeline a secondary valid request using HTTP pipelining
  3. Observe processing of the secondary request despite the error state on the primary request
  4. Continue interaction with the application via the worker thread handling the secondary request

How to detect it

Review application and WSGI server logs for sequences of parsing errors immediately followed by successful processing of subsequent pipelined requests on the same connection; monitor for unexpected worker thread activity after error responses.

What your security team should do

  • Immediately audit all deployments for enabled channel_request_lookahead and disable where found
  • Prioritize upgrade of Waitress to 3.0.1 across all Python WSGI environments
  • Update affected Moodle packages on Ubuntu 16.04/18.04 to 3.0.3+dfsg-0ubuntu1
  • Add version checks for Waitress to regular dependency scanning and CI pipelines

The record

Waitress is a Web Server Gateway Interface server for Python 2 and 3. A remote client may send a request that is exactly recv_bytes (defaults to 8192) long, followed by a secondary request using HTTP pipelining. When request lookahead is disabled (default) we won't read any more requests, and when the first request fails due to a parsing error, we simply close the connection. However when request lookahead is enabled, it is possible to process and receive the first request, start sending the error message back to the client while we read the next request and queue it. This will allow the secondary request to be serviced by the worker thread while the connection should be closed. Waitress 3.0.1 fixes the race condition. As a workaround, disable channel_request_lookahead, this is set to 0 by default disabling this feature.

Affected packages

Ecosystem Package Introduced Fixed
PyPI waitress 0 e4359018537af376cf24bd13616d861e2fb76f65
PyPI waitress 2.0.0 3.0.1
Debian:11 waitress 0 No fix
Debian:12 waitress 0 No fix
Debian:13 waitress 0 No fix
Debian:14 waitress 0 3.0.1-1
Mageia:9 python-waitress 0 2.1.2-1.1.mga9
Red Hat:openshift_ironic:4.12::el9 python-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.12::el9 python3-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.13::el9 python-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.13::el9 python3-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.14::el9 python-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.14::el9 python3-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.15::el9 python-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.15::el9 python3-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.16::el9 python-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.16::el9 python3-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.17::el9 python-waitress 0 0:3.0.1-1.el9
Red Hat:openshift_ironic:4.17::el9 python3-waitress 0 0:3.0.1-1.el9
Red Hat:openstack:16.2::el8 python-waitress 0 0:2.0.0-4.el8ost
Red Hat:openstack:16.2::el8 python3-waitress 0 0:2.0.0-4.el8ost
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python-waitress 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python-waitress-doc 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python-waitress 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python-waitress-doc 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise Module for Python 3 15 SP5 python-waitress 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise Module for Python 3 15 SP5 python-waitress-doc 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise Module for Python 3 15 SP6 python-waitress 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise Module for Python 3 15 SP6 python-waitress-doc 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python-waitress 0 2.1.2-150400.12.7.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python-waitress-doc 0 2.1.2-150400.12.7.1
Ubuntu:20.04:LTS waitress 0 1.4.1-1ubuntu0.2
Ubuntu:22.04:LTS waitress 0 1.4.4-1.1ubuntu1.1
Ubuntu:24.04:LTS waitress 0 No fix
Ubuntu:24.10 waitress 0 3.0.0-1ubuntu0.1
Ubuntu:Pro:24.04:LTS waitress 0 2.1.2-2ubuntu0.1~esm1
openSUSE:Leap 15.5 python-waitress 0 2.1.2-150400.12.7.1
openSUSE:Leap 15.5 python-waitress-doc 0 2.1.2-150400.12.7.1
pypi waitress 2.0.0 No fix

Related vulnerabilities