security: replace advocate with champion and upgrade urllib3 to 2.x#7746
Draft
wtfiwtz wants to merge 1 commit into
Draft
security: replace advocate with champion and upgrade urllib3 to 2.x#7746wtfiwtz wants to merge 1 commit into
wtfiwtz wants to merge 1 commit into
Conversation
Replace the deprecated advocate library with champion (modern fork) and upgrade urllib3 to 2.x. SSRF protection is now opt-in via the champion package. Changes: - Remove advocate from core dependencies - urllib3: 1.26.19 → 2.7.0 - boto3: 1.28.8 → 1.43.7 (botocore 1.31.x pinned urllib3 <1.27) - botocore: 1.31.8 → 1.43.7 - Add transitive dependencies: azure-core, grpcio, h11, httpcore, marshmallow - Add optional [tool.poetry.group.ssrf] with champion pinned to git rev 74cf301 - Change ENFORCE_PRIVATE_ADDRESS_BLOCK default: true → false - SSRF protection now requires explicit opt-in + champion install Code changes: - Replace requests_or_advocate with requests_or_champion throughout - Conditional champion import with helpful error message when unavailable - Update imports in query_runner/__init__.py, csv.py, excel.py - Update settings/__init__.py with new default and documentation - Update tests/query_runner/test_http.py CVEs Addressed: - CVE-2023-43804 (urllib3): Cookie header injection - CVE-2024-37891 (urllib3): Proxy-authorization header leak on redirect - Multiple urllib3 1.26.x → 2.x security fixes SSRF protection is now opt-in: - Set REDASH_ENFORCE_PRIVATE_IP_BLOCK=true - Install with: poetry install --with ssrf - Or: pip install git+https://github.com/Gee19/champion.git Breaking Changes: - SSRF protection is now OFF by default (was ON with advocate) - Deployments that relied on advocate must explicitly enable champion Testing: - ✅ Python tests pass - ✅ Frontend tests pass - ✅ poetry lock regenerates successfully Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Replace the deprecated
advocatelibrary withchampion(modern fork) and upgrade urllib3 to 2.x. SSRF protection is now opt-in via the champion package.Changes
advocatefrom core dependencies (unmaintained, blocks urllib3 2.x)urllib3: 1.26.19 → 2.7.0boto3: 1.28.8 → 1.43.7 (botocore 1.31.x pinned urllib3 <1.27, blocking upgrade)botocore: 1.31.8 → 1.43.7azure-core,grpcio,h11,httpcore,marshmallow[tool.poetry.group.ssrf]withchampionpinned to git rev 74cf301Code Changes
requests_or_advocate→requests_or_championthroughoutquery_runner/__init__.py,csv.py,excel.pysettings/__init__.pywith new default and documentationtests/query_runner/test_http.pyCVEs Addressed
SSRF Protection (Now Opt-In)
To enable SSRF protection:
REDASH_ENFORCE_PRIVATE_IP_BLOCK=truepoetry install --with ssrfpip install git+https://github.com/Gee19/champion.gitBreaking Changes
Why:
advocatelibrary is unmaintained and blocks urllib3 2.x upgrade (requiresurllib3 <2.0)championis a modern fork that supports urllib3 2.x but is not yet stable (no PyPI release, pinned to git commit)Impact:
advocatebeing always installed with blocking enabled by default must explicitly:REDASH_ENFORCE_PRIVATE_IP_BLOCK=truepoetry install --with ssrf(or addssrfto Dockerfileinstall_groups)Testing
poetry lockregenerates successfullyDependencies
Release Notes
Made with Cursor