[Aikido] Fix 2 critical issues in pyyaml and 17 other issues#44
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 dependencies to fix critical RCE vulnerabilities in PyYAML (arbitrary code execution via unsafe YAML loading) and HIGH severity header leakage/SSL verification bypass issues in urllib3. This update includes breaking changes that require manual migration.
Breaking Change: Python 2.7 Support Removed
Where your code is affected:
setup.py:16- Declares Python 2.7 support in classifiersdocs/source/running_elastalert.rst- Documents Python 2.7 as a requirementImpact: The codebase is explicitly designed for Python 2.7 (as declared in setup.py classifiers and documentation). urllib3 2.0.0+ dropped support for Python 2.7, 3.5, and 3.6. The application will fail to install or run with urllib3 2.7.0 on Python 2.7.
Remediation: Upgrade the codebase to Python 3.8 or later (as urllib3 2.7.0 requires Python 3.8+), or pin urllib3 to a version compatible with Python 2.7 (< 2.0.0).
Breaking Change: requests.packages.urllib3 Access Removed
Where your code is affected:
elastalert/alerts.py:1467-requests.packages.urllib3.disable_warnings()in HipChatAlerterelastalert/alerts.py:1947-requests.packages.urllib3.disable_warnings()in StrideAlerterImpact: Since requests 2.16.0, urllib3 was unvendored. The
requests.packages.urllib3namespace no longer exists in modern versions of requests. Calls torequests.packages.urllib3.disable_warnings()will raiseAttributeError.Remediation: Replace
requests.packages.urllib3.disable_warnings()with direct imports:import urllib3; urllib3.disable_warnings().Breaking Change: Certificate Validation Required by Default
Where your code is affected: All HTTPS requests throughout the codebase (multiple alerters use
requests.post()andrequests.get())Impact: urllib3 1.25.0+ requires and validates certificates by default. If the codebase connects to services with self-signed certificates without explicitly setting
verify=False, connections will fail with SSL verification errors.Remediation: Review all HTTPS connections and ensure proper certificate handling - either provide valid certificates or explicitly set
verify=Falsewhere appropriate (already done in some alerters like HipChatAlerter and StrideAlerter).All breaking changes by upgrading urllib3 from version 1.23 to 2.7.0 (CHANGELOG)
All breaking changes by upgrading requests from version 2.0.0 to 2.33.0 (CHANGELOG)
ContentDecodingError. Raised instead ofurllib3DecodeErrorexceptions.timeoutparameter now affects requests with bothstream=Trueandstream=Falseequally.HTTPAdapterhad been configured to use a blocking connection pool.TypeErrorwhen attempting to decode a JSON response that occurred in an error case. Now correctly returns aValueError.iter_contentonly accepts integers andNonefor chunk sizes.IOError, rather than failing at the time of the HTTPS request with a fairly inscrutable certificate validation error.HTTPDigestAuthto only respond to auth challenges made on 4XX responses, rather than to all auth challenges.urllib3.exceptions.InvalidHeaderwithrequests.exceptions.InvalidHeader.UnicodeErrorwithrequests.exceptions.InvalidURLfor URLs with a leading dot (.) in the domain.urllib3.exceptions.SSLErrorwithrequests.exceptions.SSLErrorforcontentanditer_content.✅ 19 CVEs resolved by this upgrade, including 2 critical 🚨 CVEs
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.verify=False, causing all subsequent requests to ignore certificate verification regardless of parameter changes, enabling man-in-the-middle attacks.extract_zipped_paths()utility function uses predictable filenames when extracting zip archives to the temp directory, allowing local attackers to pre-create malicious files that get loaded instead of legitimate ones, resulting in arbitrary code execution.🔗 Related Tasks