[Aikido] Fix security issue in urllib3 via major version upgrade from 1.23.0 to 2.6.3#39
Open
aikido-autofix[bot] wants to merge 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade urllib3 to fix information disclosure via HTTP redirects, SSL certificate verification bypass, decompression bomb DoS attacks, and CRLF injection vulnerabilities. This update includes breaking changes that require manual migration.
The urllib3 upgrade from 1.23 to 2.6.3 has breaking changes that affect this codebase:
1. Breaking Change:
requests.packages.urllib3access pattern no longer worksWhere your code is affected:
elastalert/alerts.pyin theHipChatAlerter.alert()method (around line 1850) andStrideAlerter.alert()method (around line 2450)Impact: The code uses
requests.packages.urllib3.disable_warnings()to suppress SSL warnings. In urllib3 2.x, the vendored urllib3 inside requests is no longer accessible viarequests.packages.urllib3. This will cause anAttributeErrorwhenhipchat_ignore_ssl_errorsorstride_ignore_ssl_errorsis set toTrue.Remediation: Replace
requests.packages.urllib3.disable_warnings()with direct urllib3 import:import urllib3; urllib3.disable_warnings()or use the warnings module to suppress specific warning categories.2. Breaking Change: Python 2.7 support removed
Where your code is affected: The entire codebase is written for Python 2.7 as indicated in
setup.py(classifier:'Programming Language :: Python :: 2.7'), uses Python 2.7 specific imports likefrom HTMLParser import HTMLParser, and has Python 2.6 compatibility code inelastalert/util.pyandelastalert/elastalert.py.Impact: urllib3 2.0+ requires Python 3.7+. The application will fail to install or run with urllib3 2.6.3 on Python 2.7, which is the only supported Python version according to the setup.py configuration.
Remediation: Either keep urllib3 pinned to <2.0 (e.g.,
urllib3<2.0) or migrate the entire codebase to Python 3.7+, which would require significant refactoring of Python 2-specific code.All breaking changes by upgrading urllib3 from version 1.23 to 2.6.3 (CHANGELOG)
✅ 10 CVEs resolved by this upgrade
This PR will resolve the following CVEs:
Proxy-Authorizationheader 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.🔗 Related Tasks