Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpClient] Fix checking for private IPs before connecting#59013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.4fromnicolas-grekas:hc-pre-resolve
Nov 27, 2024

Conversation

nicolas-grekas
Copy link
Member

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Issues-
LicenseMIT

The patch forCVE-2024-50342 isn't enough.

As reported by@cs278:

A DNS name which presents multiple A records can be used to bypass the new fix due to a TOCTOU
condition where the decorator is performing the DNS lookup but curl is then performing its own
DNS query and getting a private IP address.

In addition:

A DNS record which presents a public A record and a private AAAA record can be used to workaround
the protection measures if certain conditions are present

As a first reminder, NoPrivateNetworkHttpClient DOES prevent requests to unwanted servers, but it doesn't prevent connecting to them, allowing to use timings to scan private network topologies.

As a second reminder,according to our security policy, we shouldn't have considered this as a security issue in the first place, but as a security hardening that could be handled without a CVE. Yet we did so we're going to update the already published CVE/advisory/blog post after this PR.

This patch rewritesNoPrivateNetworkHttpClient to make it responsible for resolving DNS and following redirections. I tried usingCURLOPT_RESOLVE instead, but this setting is ignored during a curl transaction apparently so we have no other choices.

In addition, the decorator will refuse to connect to IPv6/IPv4 hosts if the configured$subnets doesn't block any IPs for the corresponding version of the protocol.

Because the DNS check is made earlier, the decorator now also rejects relative URLs when the base URI is unknown to it.

cs278 reacted with thumbs up emoji
@carsonbotcarsonbot added this to the5.4 milestoneNov 27, 2024
@nicolas-grekasnicolas-grekas merged commit4677f32 intosymfony:5.4Nov 27, 2024
11 of 12 checks passed
@nicolas-grekasnicolas-grekas deleted the hc-pre-resolve branchNovember 27, 2024 11:57
This was referencedNov 27, 2024
@fabpotfabpot mentioned this pull requestNov 29, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

2 participants
@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp