Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url: reject URLs with hostnames longer than 65535 bytes #9317

Closed
wants to merge 2 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Aug 15, 2022

It probably causes other problems too since DNS can't resolve such
long names, but the SNI field in TLS is limited to 16 bits length.

@bagder bagder added the URL label Aug 15, 2022
It *probably* causes other problems too since DNS can't resolve such
long names, but the SNI field in TLS is limited to 16 bits length.
@bagder bagder closed this in 657101e Aug 15, 2022
@bagder bagder deleted the bagder/long-hostname branch August 15, 2022 08:58
@MarcelRaad
Copy link
Member

Unfortunately, the new test fails on all Windows CI builds with

curl returned 126, when expecting 3

[...]
sh: ../src/curl.exe: Argument list too long

Windows is probably not the only platform with that problem, but I'm not exactly sure how to fix this in a generic way. My MinGW-w64 defines ARG_MAX to 14500 and _POSIX_ARG_MAX to 4096. I cannot find it at all in MSVC headers, but https://docs.microsoft.com/en-US/troubleshoot/windows-client/shell-experience/command-line-string-limitation says it's 8191 characters for the Windows command prompt.

emilengler added a commit to emilengler/curl that referenced this pull request Aug 17, 2022
This commit changes the failf message to output the maximum length,
when curl refuses to process a URL because it is too long.

See: curl#9317
Closes: #XXXX
emilengler added a commit to emilengler/curl that referenced this pull request Aug 18, 2022
This commit changes the failf message to output the maximum length,
when curl refuses to process a URL because it is too long.

See: curl#9317
Closes: curl#9327
bagder pushed a commit that referenced this pull request Aug 22, 2022
This commit changes the failf message to output the maximum length, when
curl refuses to process a URL because it is too long.

See: #9317
Closes: #9327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants