Search for packages
purl | pkg:pypi/twisted@16.3.1 |
Vulnerability | Summary | Fixed by |
---|---|---|
VCID-54jv-na1n-aaac
Aliases: CVE-2019-12387 GHSA-6cc5-2vg4-cc7m PYSEC-2019-128 PYSEC-2019-58 |
In Twisted before 19.2.1, twisted.web did not validate or sanitize URIs or HTTP methods, allowing an attacker to inject invalid characters such as CRLF. |
Affected by 11 other vulnerabilities. |
VCID-atn1-v3d1-aaag
Aliases: CVE-2020-10109 GHSA-p5xh-vx83-mxcj PYSEC-2020-260 |
In Twisted Web through 19.10.0, there was an HTTP request splitting vulnerability. When presented with a content-length and a chunked encoding header, the content-length took precedence and the remainder of the request body was interpreted as a pipelined request. |
Affected by 9 other vulnerabilities. Affected by 6 other vulnerabilities. |
VCID-c8g2-tksq-aaab
Aliases: CVE-2022-39348 GHSA-vg46-2rrj-3647 |
Twisted vulnerable to NameVirtualHost Host header injection |
Affected by 3 other vulnerabilities. Affected by 3 other vulnerabilities. |
VCID-j9j7-9v69-aaas
Aliases: CVE-2024-41671 GHSA-c8m8-j448-xjx7 |
twisted.web has disordered HTTP pipeline response ### Summary The HTTP 1.0 and 1.1 server provided by twisted.web could process pipelined HTTP requests out-of-order, possibly resulting in information disclosure. ### PoC 0. Start a fresh Debian container: ```sh docker run --workdir /repro --rm -it debian:bookworm-slim ``` 1. Install twisted and its dependencies: ```sh apt -y update && apt -y install ncat git python3 python3-pip \ && git clone --recurse-submodules https://github.com/twisted/twisted \ && cd twisted \ && pip3 install --break-system-packages . ``` 2. Run a twisted.web HTTP server that echos received requests' methods. e.g., the following: ```python from twisted.web import server, resource from twisted.internet import reactor class TheResource(resource.Resource): isLeaf = True def render_GET(self, request) -> bytes: return b"GET" def render_POST(self, request) -> bytes: return b"POST" site = server.Site(TheResource()) reactor.listenTCP(80, site) reactor.run() ``` 3. Send it a POST request with a chunked message body, pipelined with another POST request, wait a second, then send a GET request on the same connection: ```sh (printf 'POST / HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\nPOST / HTTP/1.1\r\nContent-Length: 0\r\n\r\n'; sleep 1; printf 'GET / HTTP/1.1\r\n\r\n'; sleep 1) | nc localhost 80 ``` 4. Observe that the responses arrive out of order: ``` HTTP/1.1 200 OK Server: TwistedWeb/24.3.0.post0 Date: Tue, 09 Jul 2024 06:19:41 GMT Content-Length: 5 Content-Type: text/html POST HTTP/1.1 200 OK Server: TwistedWeb/24.3.0.post0 Date: Tue, 09 Jul 2024 06:19:42 GMT Content-Length: 4 Content-Type: text/html GET HTTP/1.1 200 OK Server: TwistedWeb/24.3.0.post0 Date: Tue, 09 Jul 2024 06:19:42 GMT Content-Length: 5 Content-Type: text/html POST ``` ### Impact See [GHSA-xc8x-vp79-p3wm](https://github.com/twisted/twisted/security/advisories/GHSA-xc8x-vp79-p3wm). Further, for instances of twisted.web HTTP servers deployed behind reverse proxies that implement connection pooling, it may be possible for remote attackers to receive responses intended for other clients of the twisted.web server. |
Affected by 0 other vulnerabilities. |
VCID-m52d-p5ms-aaak
Aliases: GHSA-8r99-h8j2-rw64 GMS-2022-5173 |
Twisted vulnerable to HTTP Request Smuggling Attacks |
Affected by 6 other vulnerabilities. |
VCID-m7xg-ermr-aaae
Aliases: CVE-2023-46137 GHSA-xc8x-vp79-p3wm PYSEC-2023-224 |
twisted.web has disordered HTTP pipeline response |
Affected by 3 other vulnerabilities. Affected by 2 other vulnerabilities. |
VCID-q7nj-ndhs-aaaf
Aliases: CVE-2020-10108 GHSA-h96w-mmrf-2h6v PYSEC-2020-259 |
In Twisted Web through 19.10.0, there was an HTTP request splitting vulnerability. When presented with two content-length headers, it ignored the first header. When the second content-length value was set to zero, the request body was interpreted as a pipelined request. |
Affected by 9 other vulnerabilities. Affected by 6 other vulnerabilities. |
VCID-q9z9-b3dx-aaah
Aliases: CVE-2024-41810 GHSA-cf56-g6w6-pqq2 PYSEC-2024-75 |
Twisted vulnerable to HTML injection in HTTP redirect body ### Summary The `twisted.web.util.redirectTo` function contains an HTML injection vulnerability. If application code allows an attacker to control the redirect URL this vulnerability may result in Reflected Cross-Site Scripting (XSS) in the redirect response HTML body. ### Details Twisted’s `redirectTo` function generates an `HTTP 302 Redirect` response. The response contains an HTML body, built for exceptional cases where the browser doesn’t properly handle the redirect, allowing the user to click a link, navigating them to the specified destination. The function reflects the destination URL in the HTML body without any output encoding. ```python # https://github.com/twisted/twisted/blob/trunk/src/twisted/web/_template_util.py#L88 def redirectTo(URL: bytes, request: IRequest) -> bytes: # ---snip--- content = b""" <html> <head> <meta http-equiv=\"refresh\" content=\"0;URL=%(url)s\"> </head> <body bgcolor=\"#FFFFFF\" text=\"#000000\"> <a href=\"%(url)s\">click here</a> </body> </html> """ % { b"url": URL } return content ``` If an attacker has full or partial control over redirect location due to an application bug, also known as an “Open Redirect”, they may inject arbitrary HTML into the response’s body, ultimately leading to an XSS attack. It’s worth noting that the issue is known to maintainers and tracked with GitHub [Issue#9839](https://github.com/twisted/twisted/issues/9839). The issue description, however, does not make any mention of exploitability and simply states: “…Browsers don't seem to actually render that page…” ### PoC The issue can be reproduced by running the following Twisted-based HTTP server locally: ```python from twisted.web import server, resource from twisted.internet import reactor from twisted.web.util import redirectTo class Simple(resource.Resource): isLeaf = True def render_GET(self, request): url = request.args[b'url'][0] # <-- open redirect return redirectTo(url, request) site = server.Site(Simple()) reactor.listenTCP(9009, site) reactor.run() ``` Once running, navigate to the following URL: `http://127.0.0.1:9009?url=ws://example.com/"><script>alert(document.location)</script>`, and verify that the “alert” dialog was displayed. **Note**: Due to the different ways browsers validate the redirect Location header, this attack is possible only in **Firefox**. All other tested browsers will display an error message to the user and will not render the HTML body. ### Impact If successfully exploited, the issue will allow malicious JavaScript to run in the context of the victim's session. This will in turn lead to unauthorized access/modification to victim's account and information associated with it, or allow for unauthorized operations to be performed within the context of the victim's session. |
Affected by 0 other vulnerabilities. |
VCID-shy4-bwc3-aaar
Aliases: CVE-2022-21712 GHSA-92x2-jw7w-xvvx PYSEC-2022-27 |
twisted is an event-driven networking engine written in Python. In affected versions twisted exposes cookies and authorization headers when following cross-origin redirects. This issue is present in the `twited.web.RedirectAgent` and `twisted.web. BrowserLikeRedirectAgent` functions. Users are advised to upgrade. There are no known workarounds. |
Affected by 6 other vulnerabilities. Affected by 0 other vulnerabilities. |
VCID-sy9d-ubrb-aaak
Aliases: CVE-2019-12855 GHSA-65rm-h285-5cc5 PYSEC-2019-129 PYSEC-2019-59 |
In words.protocols.jabber.xmlstream in Twisted through 19.2.1, XMPP support did not verify certificates when used with TLS, allowing an attacker to MITM connections. |
Affected by 10 other vulnerabilities. Affected by 10 other vulnerabilities. |
VCID-udmg-vnpc-aaag
Aliases: CVE-2022-24801 GHSA-c2jg-hw38-jrqq PYSEC-2022-195 |
Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to version 22.4.0rc1, the Twisted Web HTTP 1.1 server, located in the `twisted.web.http` module, parsed several HTTP request constructs more leniently than permitted by RFC 7230. This non-conformant parsing can lead to desync if requests pass through multiple HTTP parsers, potentially resulting in HTTP request smuggling. Users who may be affected use Twisted Web's HTTP 1.1 server and/or proxy and also pass requests through a different HTTP server and/or proxy. The Twisted Web client is not affected. The HTTP 2.0 server uses a different parser, so it is not affected. The issue has been addressed in Twisted 22.4.0rc1. Two workarounds are available: Ensure any vulnerabilities in upstream proxies have been addressed, such as by upgrading them; or filter malformed requests by other means, such as configuration of an upstream proxy. |
Affected by 4 other vulnerabilities. |
VCID-yqut-y2a8-aaag
Aliases: GHSA-32gv-6cf3-wcmq GMS-2022-410 |
HTTP/2 DoS Attacks: Ping, Reset, and Settings Floods |
Affected by 9 other vulnerabilities. |
Vulnerability | Summary | Aliases |
---|---|---|
VCID-rmb8-9sp1-aaac | Twisted before 16.3.1 does not attempt to address RFC 3875 section 4.1.18 namespace conflicts and therefore does not protect CGI applications from the presence of untrusted client data in the HTTP_PROXY environment variable, which might allow remote attackers to redirect a CGI application's outbound HTTP traffic to an arbitrary proxy server via a crafted Proxy header in an HTTP request, aka an "httpoxy" issue. |
CVE-2016-1000111
GHSA-3gqj-cmxr-p4x2 PYSEC-2020-214 |