[Aikido] Fix 11 security issues in urllib3, requests#41
Open
aikido-autofix[bot] wants to merge 1 commit intomasterfrom
Open
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 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.
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.ymlline 3,setup.pyline 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 includingelastalert/alerts.py,elastalert/elastalert.py,elastalert/opsgenie.py,elastalert/kibana.py, andelastalert/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.pyinHipChatAlerter.alert()method (around line 1850) andStrideAlerter.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)
All breaking changes by upgrading requests from version 2.32.5 to 2.33.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.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