Repository navigation
Conversation
|
An alternative would be restoring the previous parser that didn't require the newer libcurl: c2ba87b#diff-40aa21688f1ac58ddf8ef5f0f4e472e6075411f5c4f75b9c1d512b7e03a2cbabL91-L122. Plus enable it conditionally when the newer libcurl is not available. That would still cause worker crashes on malformed headers but users that want the fix could upgrade. |
edbdcb0 to
b3c399f
Compare
Collect response headers with CURLOPT_HEADERFUNCTION instead of curl_easy_nextheader and curl_easy_header, which need libcurl 7.83. Fall back to a generic message where curl_url_strerror is missing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
b3c399f to
586ec3e
Compare
|
I went ahead and added some CI testing to this PR. Looks like the CI for curl 1.76.1 is failing 3 tests consistently, checked locally. |
Fail a response with a header line that has no colon, as libcurl 7.83 does. Do not depend on the URL error text, which differs by version. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the CI job. I updated the code to fix the two of the failures.
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
test_http_get_ipv6: the nix curl 7.76.1 was built without IPv6, so |
|
@AndrewJackson2020 I think we addressed all the problems. Please review. |
Thank you for fixing.
That is easy to say on the Supabase platform but outside of that context users of rocky 9 linux (for example) will be stuck with crashes until 2032. In many organizations "just upgrade libcurl" is not an option. While I like the idea of conditionally enabling the new behavior it does increase overall complexity. On the one hand using curl_easy_header is safer and once available on LTS will allow us to shed 40 LOC, on the other hand we are now responsible for 2 different implementations of header parsing until 2032. Maybe this is okay because now we have CI that covers old and now methods. Right now I'm leaning towards the conditional implementation that you are describing. |
Hm, the same argument can be applied for us supporting pg_net on pg versions older than 14 yet we don't do it.
Even Ubuntu 22.04 (released on 2022) has the required libcurl ( I'm not sure about the state of rockylinux, but we have to pick our battles otherwise where going to be left with much legacy to support. libcurl 7.80 was released on 2021 and given the recent influx of CVEs it had maybe that will also push more stable distros to upgrade faster? My proposal would be to just keep enforcing the libcurl version. And if #283 is also a problem on the supabase platform, that can surely be solved by Nix? |
Rockylinux is basically just RHEL. Very popular in non tech enterprise environments. I would say RHEL and Debian are probably the 2 most important/widespread linux distros and in an ideal world we would support any non EOL'd distros for both. That said I have not been in a rush to close this gap because of the downsides (extra CI job, more code written by us, etc).
The LTS distros, like rockylinux, will backpatch CVE fixes implemented on more recent releases of software without any of the breaking changes associated with new functionality so the recent influx of CVE's is not an issue as long as they keep up with that work. See for example their gitlab repo with various curl patches [0].
The difference is that our policy is that we only support postgres that is within the official EOL guidelines, which means postgres >= 14 [1]. This policy of ours currently stops with postgres though, currently we require bleeding edge libcurl. With this PR (and with the supautils PR [2]) we are basically saying that we extend this policy to LTS linux distros. [0] https://gitlab.com/redhat/centos-stream/rpms/curl |
Thanks for elaborating, I understand the motivation now.
If it's only about building on more platforms, I think we should go with the option I mentioned above and just bring the old parser back where the malformed bug is present. Otherwise we'd have to keep maintaining that new parser if new bugs arise. Possibly we can raise a warning telling users the newer libcurl version is recommended too. |
|
Closing pending pg_net backport decision. Feel free to reopen. |
Lowers the minimum libcurl from 7.83 to 7.76.
CURLOPT_HEADERFUNCTION. Only the last response's headers are kept.curl_url_strerrorfalls back to a generic message below 7.80.test_get_bad_urlandtest_http_header_injectionaccept the older libcurl behavior.Closes #283