Scrapy: Twisted vulnerable to HTML injection in HTTP redirect body (CVE-2024-41810)
The Twisted web framework's redirectTo function contains an HTML injection vulnerability that can lead to reflected cross-site scripting (XSS) if an attacker controls the redirect URL. This occurs because the redirectTo function reflects the destination URL in the HTML body without encoding, allowing injection of arbitrary HTML/JavaScript. The vulnerability is exploitable only in Firefox due to its handling of the redirect response body. Exploitation could allow malicious scripts to run in the victim's session context, potentially leading to unauthorized access or actions. Affected versions are Twisted versions used by Scrapy from 2.9.0 up to but not including 2.11.2_3. A patch is available for this issue.
AI Analysis
Technical Summary
The Twisted framework's redirectTo function generates an HTTP 302 redirect response containing an HTML body that reflects the redirect URL without output encoding. If an attacker can control the redirect URL (e.g., via an open redirect in application code), they can inject arbitrary HTML/JavaScript, resulting in reflected XSS. This vulnerability is tracked as CVE-2024-41810. It is exploitable primarily in Firefox browsers, which render the HTML body, while other browsers do not. The vulnerability affects Twisted versions >=2.9.0 and <2.11.2_3. A proof of concept demonstrates the injection of a script alert via a crafted URL parameter. The issue is known to maintainers and a patch is available.
Potential Impact
Successful exploitation allows execution of arbitrary JavaScript in the context of the victim's browser session, potentially enabling unauthorized access or modification of user data and unauthorized actions within the victim's session. The impact is limited to browsers that render the injected HTML body in the redirect response, notably Firefox. Other browsers reject or do not render the injected content, reducing the attack surface.
Mitigation Recommendations
A patch is available for this vulnerability and should be applied to affected versions. The vendor advisory confirms the issue and the availability of a fix. If upgrading immediately is not possible, ensure that application code does not allow untrusted input to control redirect URLs to prevent exploitation. Note that the vulnerability is only exploitable in Firefox due to its handling of redirect responses.
Scrapy: Twisted vulnerable to HTML injection in HTTP redirect body (CVE-2024-41810)
Description
The Twisted web framework's redirectTo function contains an HTML injection vulnerability that can lead to reflected cross-site scripting (XSS) if an attacker controls the redirect URL. This occurs because the redirectTo function reflects the destination URL in the HTML body without encoding, allowing injection of arbitrary HTML/JavaScript. The vulnerability is exploitable only in Firefox due to its handling of the redirect response body. Exploitation could allow malicious scripts to run in the victim's session context, potentially leading to unauthorized access or actions. Affected versions are Twisted versions used by Scrapy from 2.9.0 up to but not including 2.11.2_3. A patch is available for this issue.
CVSS v3.1
Score 6.1medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Twisted framework's redirectTo function generates an HTTP 302 redirect response containing an HTML body that reflects the redirect URL without output encoding. If an attacker can control the redirect URL (e.g., via an open redirect in application code), they can inject arbitrary HTML/JavaScript, resulting in reflected XSS. This vulnerability is tracked as CVE-2024-41810. It is exploitable primarily in Firefox browsers, which render the HTML body, while other browsers do not. The vulnerability affects Twisted versions >=2.9.0 and <2.11.2_3. A proof of concept demonstrates the injection of a script alert via a crafted URL parameter. The issue is known to maintainers and a patch is available.
Potential Impact
Successful exploitation allows execution of arbitrary JavaScript in the context of the victim's browser session, potentially enabling unauthorized access or modification of user data and unauthorized actions within the victim's session. The impact is limited to browsers that render the injected HTML body in the redirect response, notably Firefox. Other browsers reject or do not render the injected content, reducing the attack surface.
Mitigation Recommendations
A patch is available for this vulnerability and should be applied to affected versions. The vendor advisory confirms the issue and the availability of a fix. If upgrading immediately is not possible, ensure that application code does not allow untrusted input to control redirect URLs to prevent exploitation. Note that the vulnerability is only exploitable in Firefox due to its handling of redirect responses.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-scrapy-CVE-2024-41810
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
Threat ID: 6aac8e5855bf5e2cf5491ae7
Added to database: 09/18/2026, 01:05:28 UTC
Last enriched: 09/18/2026, 01:50:36 UTC
Last updated: 09/18/2026, 02:07:30 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.