CVE-2023-46137
JSON

5.3medium

twisted.web has disordered HTTP pipeline response

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.88% (higher than 60% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-xc8x-vp79-p3wmPYSEC-2023-224

Description

Twisted is an event-based framework for internet applications. Prior to version 23.10.0rc1, when sending multiple HTTP requests in one TCP packet, twisted.web will process the requests asynchronously without guaranteeing the response order. If one of the endpoints is controlled by an attacker, the attacker can delay the response on purpose to manipulate the response of the second request when a victim launched two requests using HTTP pipeline. Version 23.10.0rc1 contains a patch for this issue.

Affected

Product or packageVersionsReported by
twisted twisted23.10.0rc1, before 23.8.0, up to 22.8.0CVE List, NVD
twisted (PyPI)before 23.10.0rc1GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
PyPA Advisory Database5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-444

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Twisted is an event-based framework for internet applications. Prior to version 23.10.0rc1, when sending multiple HTTP requests in one TCP packet, twisted.web will process the requests asynchronously without guaranteeing the response order. If one of the endpoints is controlled by an attacker, the attacker can delay the response on purpose to manipulate the response of the second request when a victim launched two requests using HTTP pipeline. Version 23.10.0rc1 contains a patch for this issue.

GitHub Advisory Database

Twisted is an event-based framework for internet applications. Prior to version 23.10.0rc1, when sending multiple HTTP requests in one TCP packet, twisted.web will process the requests asynchronously without guaranteeing the response order. If one of the endpoints is controlled by an attacker, the attacker can delay the response on purpose to manipulate the response of the second request when a victim launched two requests using HTTP pipeline. Version 23.10.0rc1 contains a patch for this issue.

Details

There's an example faulty program:

from twisted.internet import reactor, endpoints
from twisted.web import server
from twisted.web.proxy import ReverseProxyResource
from twisted.web.resource import Resource

class Second(Resource):
    isLeaf = True
    def render_GET(self, request):
        return b'SECOND\n'

class First(Resource):
    isLeaf = True
    def render_GET(self, request):
        def send_response():
            request.write(b'FIRST DELAYED\n')
            request.finish()
        reactor.callLater(0.5, send_response)
        return server.NOT_DONE_YET

root = Resource()

root.putChild(b'second', Second())
root.putChild(b'first', First())

endpoint = endpoints.TCP4ServerEndpoint(reactor, 8080)
endpoint.listen(server.Site(root))
reactor.run()

When two requests for /first and /second are sent in the same order, the second request will be responded to first.

echo -en "GET /first HTTP/1.1\r\nHost: a\r\n\r\nGET /second HTTP/1.1\r\nHost: a\r\n\r\n" | nc localhost 8080
NVD (es)

Twisted es un framework basado en eventos para aplicaciones de Internet. Antes de la versión 23.10.0rc1, al enviar múltiples solicitudes HTTP en un paquete TCP, twisted.web procesará las solicitudes de forma asincrónica sin garantizar el orden de respuesta. Si uno de los endpoints está controlado por un atacante, el atacante puede retrasar la respuesta a propósito para manipular la respuesta de la segunda solicitud cuando una víctima lanzó dos solicitudes utilizando una canalización HTTP. La versión 23.10.0rc1 contiene un parche para este problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-46137 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-xc8x-vp79-p3wm changed 2025-11-04CC-BY-4.0
NVDCVE-2023-46137 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2023-224 changed 2023-11-08CC-BY-4.0