[Aikido] Fix 2 critical issues in pyyaml and 16 other issues#40
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 PyYAML, urllib3, and requests to fix critical RCE vulnerabilities in YAML deserialization and high-severity DoS/SSL verification issues. This update includes breaking changes that require manual migration.
Breaking Change:
requests.packages.urllib3access patternWhere your code is affected:
elastalert/alerts.pylines withrequests.packages.urllib3.disable_warnings()HipChatAlerter class (around line with
if self.hipchat_ignore_ssl_errors)StrideAlerter class (around line with
if self.stride_ignore_ssl_errors)Impact: In urllib3 2.0+, the library is no longer vendored inside requests. The code attempts to access
requests.packages.urllib3.disable_warnings()which will fail with anAttributeErrorbecauserequests.packagesno longer exists in newer versions of requests that use urllib3 2.x.Remediation: Replace
requests.packages.urllib3.disable_warnings()with direct imports:import urllib3; urllib3.disable_warnings()or useimport warnings; warnings.filterwarnings('ignore').Breaking Change: Python 2.7 support dropped
Where your code is affected:
setup.pyline 16 declares'Programming Language :: Python :: 2.7'Impact: The codebase is configured for Python 2.7, but urllib3 2.0+ and requests 2.28+ have dropped Python 2.7 support. The application will fail to run on Python 2.7 with these package versions.
Remediation: Upgrade the codebase to Python 3.7+ (minimum supported version after all deprecations) and update all Python 2-specific code (e.g.,
basestring,unicode,HTMLParserimports,.iteritems(), etc.).Breaking Change: Certificate validation now required by default
Where your code is affected: All HTTPS connections throughout
elastalert/alerts.pyandelastalert/opsgenie.pywhererequests.post()is calledImpact: urllib3 1.25.0+ requires and validates certificates by default. If the codebase connects to servers with self-signed or invalid certificates without explicitly setting
verify=False, connections will fail.Remediation: Ensure all HTTPS endpoints have valid certificates, or explicitly set
verify=Falsein requests calls where needed (though this is not recommended for security reasons).All breaking changes by upgrading urllib3 from version 1.23 to 2.6.3 (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.✅ 18 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