Skip to content

[Snyk] Security upgrade urllib3 from 1.26.13 to 2.6.0 - #1

Open
dextrorsal wants to merge 1 commit into
masterfrom
snyk-fix-2327237f8ab80332b4eee3ec5b34769c
Open

[Snyk] Security upgrade urllib3 from 1.26.13 to 2.6.0#1
dextrorsal wants to merge 1 commit into
masterfrom
snyk-fix-2327237f8ab80332b4eee3ec5b34769c

Conversation

@dextrorsal

Copy link
Copy Markdown
Owner

snyk-top-banner

Snyk has created this PR to fix 2 vulnerabilities in the pip dependencies of this project.

Snyk changed the following file(s):

  • requirements.txt
⚠️ Warning
equests 2.28.1 requires urllib3, which is not installed.
flake8 5.0.4 has requirement importlib-metadata<4.3,>=1.1.0; python_version < "3.8", but you have importlib-metadata 6.7.0.
flake8 5.0.4 has requirement pycodestyle<2.10.0,>=2.9.0, but you have pycodestyle 2.10.0.
flake8 5.0.4 has requirement pyflakes<2.6.0,>=2.5.0, but you have pyflakes 3.0.1.

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Some vulnerabilities couldn't be fully fixed and so Snyk will still find them when the project is tested again. This may be because the vulnerability existed within more than one direct dependency, but not all of the affected dependencies could be upgraded.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Allocation of Resources Without Limits or Throttling

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedurllib3@​1.26.13 ⏵ 2.6.097 +2100 +31100100100

View full report

Comment thread requirements.txt
@@ -79,7 +79,7 @@ types-cachetools==4.2.10
types-requests==2.28.11.5
types-urllib3==1.26.25.4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Upgrading urllib3 to 2.6.0 with requests==2.28.1 causes AttributeError due to missing HTTPResponse methods.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

Upgrading urllib3 to version 2.6.0 introduces an incompatibility with the pinned requests version 2.28.1. urllib3 2.6.0 removed HTTPResponse.getheaders() and HTTPResponse.getheader(), which requests 2.28.1 internally relies on in its HTTPAdapter.build_response() method. This will lead to an AttributeError: 'HTTPResponse' object has no attribute 'getheaders' whenever an HTTP request is made using requests.get(), causing the application to crash as there is no error handling.

💡 Suggested Fix

Upgrade requests to version 2.30.0 or newer, which officially supports urllib3 2.x. Alternatively, downgrade urllib3 to a 1.x version compatible with requests==2.28.1.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: requirements.txt#L80

Potential issue: Upgrading `urllib3` to version 2.6.0 introduces an incompatibility with
the pinned `requests` version 2.28.1. `urllib3` 2.6.0 removed
`HTTPResponse.getheaders()` and `HTTPResponse.getheader()`, which `requests` 2.28.1
internally relies on in its `HTTPAdapter.build_response()` method. This will lead to an
`AttributeError: 'HTTPResponse' object has no attribute 'getheaders'` whenever an HTTP
request is made using `requests.get()`, causing the application to crash as there is no
error handling.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6416724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants