[Aikido] Fix 2 critical issues in pyyaml and 11 other issues#47
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 PyYAML and urllib3 to fix critical RCE vulnerabilities in YAML deserialization and HIGH severity DoS/SSL verification issues in HTTP client. 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') and uses Python 2-specific imports likefrom HTMLParser import HTMLParserinelastalert/alerts.pyline 14 and.iteritems()throughout multiple files (elastalert/alerts.py,elastalert/elastalert.py,elastalert/ruletypes.py,tests/base_test.py)Impact: urllib3 2.0.0+ requires Python 3.7+, but this codebase is designed for Python 2.7. The application will fail to run as urllib3 2.7.0 cannot be installed or used with Python 2.7
Remediation: Either downgrade urllib3 to a version that supports Python 2.7 (1.26.x is the last version supporting Python 2.7), or migrate the entire codebase to Python 3.7+
2. Accessing urllib3 via requests.packages (Indirect Breaking Change)
Where your code is affected:
elastalert/alerts.pyin two locations within theHipChatAlerter.alert()andStrideAlerter.alert()methods whererequests.packages.urllib3.disable_warnings()is calledImpact: 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. Thedisable_warnings()method signature or behavior may have changedRemediation: Replace
requests.packages.urllib3.disable_warnings()with direct urllib3 import:import urllib3; urllib3.disable_warnings()or use requests' own warning suppression mechanismsAll breaking changes by upgrading urllib3 from version 1.23 to 2.7.0 (CHANGELOG)
✅ 13 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.🔗 Related Tasks