Skip to content

[Aikido] Fix 11 security issues in urllib3, requests#41

Open
aikido-autofix[bot] wants to merge 1 commit intomasterfrom
fix/aikido-security-AIKIDO-460-AIKIDO-1260-update-packages-20838805-jqus
Open

[Aikido] Fix 11 security issues in urllib3, requests#41
aikido-autofix[bot] wants to merge 1 commit intomasterfrom
fix/aikido-security-AIKIDO-460-AIKIDO-1260-update-packages-20838805-jqus

Conversation

@aikido-autofix
Copy link

@aikido-autofix aikido-autofix bot commented Mar 27, 2026

Upgrade urllib3 and requests to fix cookie leakage via redirects, SSL verification bypass, decompression bomb DoS attacks, and CRLF injection vulnerabilities. This update includes breaking changes that require manual migration.

⚠️ Code affected by breaking changes.

This codebase is currently running on Python 2.7, which creates critical compatibility issues with the proposed package upgrades:

Breaking Change 1: Python Version Incompatibility

  • Where affected: Entire codebase (.travis.yml line 3, setup.py line 16)

  • Impact: urllib3 2.0+ requires Python 3.7+ (dropped support for Python 2.7, 3.5, 3.6), and requests 2.33.0 requires Python 3.10+ (dropped support for Python 3.9). The codebase is currently configured for Python 2.7 and uses Python 2-specific syntax (basestring, unicode(), from HTMLParser, .iteritems()) throughout multiple files including elastalert/alerts.py, elastalert/elastalert.py, elastalert/opsgenie.py, elastalert/kibana.py, and elastalert/config.py.

  • Remediation: Upgrade the entire codebase to Python 3.10+ before upgrading these packages, including migrating all Python 2 syntax to Python 3 equivalents.

Breaking Change 2: requests.packages.urllib3 Access Pattern

  • Where affected: elastalert/alerts.py in HipChatAlerter.alert() method (around line 1850) and StrideAlerter.alert() method (around line 2650)

  • Impact: The code uses requests.packages.urllib3.disable_warnings() which accesses urllib3 through the requests package. In newer versions of requests with urllib3 2.x, this access pattern may not work as urllib3 is no longer vendored within requests.

  • Remediation: Replace requests.packages.urllib3.disable_warnings() with direct urllib3 imports and calls, or use requests' built-in warning suppression mechanisms.

All breaking changes by upgrading urllib3 from version 1.23 to 2.6.3 (CHANGELOG)

Version Description
1.24.0
Drop support for EOL Python 2.6
1.25.0
Require and validate certificates by default when using HTTPS
1.25.0
Upgraded urllib3.utils.parse_url() to be RFC 3986 compliant
1.25.0
Switched the default multipart header encoder from RFC 2231 to HTML 5 working draft
1.25.0
Drop ciphers using DSS key exchange from default TLS cipher suites
2.0.0
Removed support for Python 2.7, 3.5, and 3.6
2.0.0
Removed fallback on certificate commonName in match_hostname() function
2.0.0
Removed support for Python with an ssl module compiled with LibreSSL, CiscoSSL, wolfSSL, and all other OpenSSL alternatives
2.0.0
Removed support for OpenSSL versions earlier than 1.1.1 or that don't have SNI support
2.0.0
Removed the list of default ciphers for OpenSSL 1.1.1+ and SecureTransport
2.0.0
Removed urllib3.contrib.appengine.AppEngineManager and support for Google App Engine Standard Environment
2.0.0
Removed deprecated Retry options method_whitelist, DEFAULT_REDIRECT_HEADERS_BLACKLIST
2.0.0
Removed urllib3.HTTPResponse.from_httplib
2.0.0
Removed default value of None for the request_context parameter of urllib3.PoolManager.connection_from_pool_key
2.0.0
Removed the urllib3.request module
2.0.0
Removed support for SSLv3.0 from the urllib3.contrib.pyopenssl
2.0.0
Removed the deprecated urllib3.contrib.ntlmpool module
2.0.0
Removed DEFAULT_CIPHERS, HAS_SNI, USE_DEFAULT_SSLCONTEXT_CIPHERS from the private module urllib3.util.ssl_
2.0.0
Removed urllib3.exceptions.SNIMissingWarning
2.0.0
Removed the _prepare_conn method from HTTPConnectionPool
2.0.0
Removed tls_in_tls_required property from HTTPSConnection
2.0.0
Removed the strict parameter/attribute from HTTPConnection, HTTPSConnection, HTTPConnectionPool, HTTPSConnectionPool, and HTTPResponse
2.0.0
Changed urllib3.response.HTTPResponse.read to respect the semantics of io.BufferedIOBase regardless of compression
2.0.0
Changed urllib3.HTTPConnection.getresponse to return an instance of urllib3.HTTPResponse instead of http.client.HTTPResponse
2.0.0
Changed default SSLContext.minimum_version to be TLSVersion.TLSv1_2
2.0.0
Changed urllib3.util.create_urllib3_context to not override the system cipher suites with a default value
2.0.0
Changed multipart/form-data header parameter formatting matches the WHATWG HTML Standard as of 2021-06-10
2.0.0
Changed the error raised when connecting via HTTPS when the ssl module isn't available from SSLError to ImportError
2.0.0
Changed enforce_content_length default to True
2.0.0
Changed all parameters in the HTTPConnection and HTTPSConnection constructors to be keyword-only except host and port
2.0.0
Changed HTTPResponse.read() to raise an error when calling with decode_content=False after using decode_content=True
2.1.0
Removed support for the deprecated urllib3[secure] extra
2.1.0
Removed support for the deprecated SecureTransport TLS implementation
2.1.0
Removed support for the end-of-life Python 3.7
2.3.0
Removed support for Python 3.8
2.6.0
Removed the HTTPResponse.getheaders() method in favor of HTTPResponse.headers
2.6.0
Removed the HTTPResponse.getheader(name, default) method in favor of HTTPResponse.headers.get(name, default)
2.6.0
The number of allowed chained encodings is now limited to 5

All breaking changes by upgrading requests from version 2.32.5 to 2.33.0 (CHANGELOG)

Version Description
2.33.0
Dropped support for Python 3.9 following its end of support.
✅ 11 CVEs resolved by this upgrade

This PR will resolve the following CVEs:

Issue Severity           Description
CVE-2023-43804
MEDIUM
[urllib3] A vulnerability allows unintended cookie leakage via HTTP redirects to different origins when users specify a Cookie header without explicitly disabling redirects. This can lead to information disclosure as sensitive cookie data may be exposed to unintended recipients.
CVE-2019-11324
LOW
[urllib3] SSL certificate verification can be bypassed when custom CA certificates are specified, allowing connections that should fail to succeed due to improper handling of certificate validation contexts.
CVE-2025-66471
LOW
[urllib3] The Streaming API improperly handles highly compressed data, allowing attackers to cause excessive CPU usage and massive memory allocation through decompression of small compressed payloads. This results in a denial-of-service vulnerability via resource exhaustion.
CVE-2026-21441
LOW
[urllib3] Decompression bomb vulnerability in streaming API for HTTP redirects. Malicious servers can trigger excessive resource consumption by sending compressed redirect responses that are fully decompressed without respecting read limits.
CVE-2020-26137
LOW
[urllib3] before 1.25.9 allows CRLF injection if the attacker controls the HTTP request method, as demonstrated by inserting CR and LF control characters in the first argument of putrequest(). NOTE: this is similar to CVE-2020-26116.
CVE-2024-37891
LOW
[urllib3] The Proxy-Authorization header is not stripped during cross-origin redirects when set manually without using urllib3's proxy support, potentially leaking authentication credentials to malicious origins. This vulnerability requires manual header configuration, enabled redirects, and specific redirect conditions to be exploited.
CVE-2018-25091
LOW
[urllib3] Authorization header is not removed when following cross-origin redirects, potentially exposing credentials to unintended hosts or transmitting them in cleartext.
CVE-2019-11236
LOW
[urllib3] In the urllib3 library through 1.24.1 for Python, CRLF injection is possible if the attacker controls the request parameter.
CVE-2025-50181
LOW
[urllib3] A vulnerability allows disabling redirects for all requests through improper PoolManager instantiation with retries configuration, potentially bypassing SSRF and open redirect mitigations. Applications relying on disabled redirects to prevent these vulnerabilities remain exposed to attacks.
CVE-2023-45803
LOW
[urllib3] HTTP redirect responses (301, 302, 303) fail to remove request bodies when changing POST to GET, potentially leaking sensitive data to malicious redirect destinations. This information disclosure vulnerability requires a compromised trusted service to exploit.
CVE-2026-25645
LOW
[requests] A predictable filename vulnerability in the extract_zipped_paths() utility function allows local attackers to pre-create malicious files in the temp directory that would be loaded instead of legitimate ones, enabling arbitrary code execution.
🔗 Related Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants