[Aikido] Fix security issue in urllib3 via major version upgrade from 1.23.0 to 2.7.0#45
Open
aikido-autofix[bot] wants to merge 1 commit into
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 sensitive header leakage in cross-origin redirects, cookie exposure via redirects, SSL verification bypass, and decompression bomb DoS vulnerabilities. This update includes breaking changes that require manual migration.
1. Python 2.7 Support Removed (2.0.0)
Where your code is affected: The entire codebase is written for Python 2.7 as indicated in
setup.pyline 17 ('Programming Language :: Python :: 2.7'),.travis.ymlline 2 (python: '2.7'), andtox.iniline 3 (envlist = py27,docs)Impact: urllib3 2.0.0+ requires Python 3.8 or higher (as of version 2.3.0). The codebase uses Python 2.7 syntax throughout (e.g.,
basestring,iteritems(),HTMLParserfrom Python 2, etc.), making it incompatible with urllib3 2.xRemediation: Either keep urllib3 < 2.0.0 or migrate the entire codebase to Python 3.8+, updating all Python 2-specific syntax and dependencies
2. Access to urllib3 via requests.packages (Indirect Breaking Change)
Where your code is affected:
elastalert/alerts.pylines 1766 and 2644 userequests.packages.urllib3.disable_warnings()Impact: While not explicitly listed in the urllib3 changelog, accessing urllib3 through
requests.packages.urllib3is a requests library implementation detail that may break with newer urllib3 versions. Therequestslibrary may not be compatible with urllib3 2.x depending on its versionRemediation: Import urllib3 directly (
import urllib3; urllib3.disable_warnings()) and ensure the requests library version is compatible with urllib3 2.x3. Certificate Validation Required by Default (1.25.0)
Where your code is affected: Throughout the codebase where HTTPS connections are made via the
requestslibrary (which uses urllib3 internally)Impact: urllib3 1.25.0+ requires and validates certificates by default. The code has options to ignore SSL errors (
hipchat_ignore_ssl_errors,stride_ignore_ssl_errors) but the default behavior change may affect existing configurationsRemediation: Ensure all SSL certificates are valid or explicitly configure certificate validation settings in the application configuration
All breaking changes by upgrading urllib3 from version 1.23 to 2.7.0 (CHANGELOG)
✅ 11 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