CVE-2021-41124: Vulnerability in scrapy-splash

scrapy-splash Updated 02 Oct 2025

Summary

05/10/2021
Yes i
High
7.4

CVE-2021-41124: Scrapy-splash is a library which provides Scrapy and JavaScript integration. Affects scrapy-splash across 2 version ranges.

< 0.8.0 < 2b253e57fe64ec575079c8cdc99fe2013502ea31

Fixed in 2b253e57fe64ec575079c8cdc99fe2013502ea31. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

scrapy-splash is a library that integrates Scrapy and JavaScript, allowing users to combine the two for web scraping purposes. It provides functionality for handling authentication with Splash, a headless browser. However, in certain versions of scrapy-splash, there is a vulnerability related to the usage of HttpAuthMiddleware for Splash authentication. This vulnerability exposes user credentials to the request target when non-Splash requests are made, including robots.txt requests sent by Scrapy when the ROBOTSTXT_OBEY setting is enabled.

Vulnerability Detail

The vulnerability in scrapy-splash arises from the use of HttpAuthMiddleware for Splash authentication. When this middleware is used with the http_user and http_pass spider attributes, non-Splash requests can expose the user's credentials to the request target. This includes requests for robots.txt files, which are automatically made by Scrapy when the ROBOTSTXT_OBEY setting is enabled. The impact of this vulnerability is that an attacker who has access to the request target can potentially obtain the user's credentials. This can lead to unauthorized access to sensitive information or accounts.

How To Fix

Minimum fixed version

2b253e57fe64ec575079c8cdc99fe2013502ea31

This is the first release that contains the fix.

pip install --upgrade "scrapy-splash==2b253e57fe64ec575079c8cdc99fe2013502ea31"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you are unable to upgrade to scrapy-splash 0.8.0 or implement the recommended changes, you can use the following workaround to mitigate the vulnerability. Instead of using HttpAuthMiddleware for authentication, you can set the Splash request credentials on a per-request basis using the splash_headers parameter. Here is an example of how to do this in a Scrapy spider:

import scrapy

class MySpider(scrapy.Spider):
    name = 'myspider'

    def start_requests(self):
        yield scrapy.Request(
            url='http://example.com',
            meta={
                'splash': {
                    'args': {
                        'splash_headers': {
                            'Authorization': 'Basic base64encodedcredentials'
                        }
                    }
                }
            }
        )

    def parse(self, response):
        # Parse the response
        pass

In this example, the Splash request credentials are set in the splash_headers parameter within the meta field of the Request object.

Conclusion

The vulnerability in scrapy-splash exposes user credentials to the request target when non-Splash requests are made. To mitigate this vulnerability, it is crucial to upgrade to scrapy-splash 0.8.0 or later and use the new SPLASH_USER and SPLASH_PASS settings for Splash authentication. If upgrading is not possible, the workaround of setting the Splash request credentials on a per-request basis using the splash_headers parameter can be employed. For further assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for scrapy-splash →

Share this vulnerability

FAQ

scrapy-splash is a library that integrates Scrapy, a web scraping framework, with Splash, a headless browser. It allows users to combine the power of Scrapy and JavaScript to scrape dynamic websites.

HttpAuthMiddleware is a downloader middleware in Scrapy that handles HTTP authentication. It allows users to specify credentials for accessing protected resources.

The vulnerability in scrapy-splash can lead to the exposure of user credentials to the request target. This can result in unauthorized access to sensitive information or accounts.

To fix this vulnerability, it is recommended to upgrade to scrapy-splash version 0.8.0 or later. Alternatively, you can set the Splash request credentials on a per-request basis using the splash_headers parameter.

Yes, if you are unable to upgrade or implement the recommended changes, you can set the Splash request credentials on a per-request basis using the splash_headers parameter. Refer to the provided code example for more details.

How To Fix

Minimum fixed version

2b253e57fe64ec575079c8cdc99fe2013502ea31

This is the first release that contains the fix.

pip install --upgrade "scrapy-splash==2b253e57fe64ec575079c8cdc99fe2013502ea31"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback