Bug 1873327 - libcurl: Segfault when HTTPS_PROXY and NO_PROXY is used together
Summary: libcurl: Segfault when HTTPS_PROXY and NO_PROXY is used together
Keywords:
Status: ON_QA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: curl
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: rc
: 8.4
Assignee: Kamil Dudka
QA Contact: Daniel Rusek
URL:
Whiteboard:
Depends On:
Blocks: 1900102 1900103 1875639
TreeView+ depends on / blocked
 
Reported: 2020-08-27 21:09 UTC by Martin Bašti
Modified: 2020-11-25 13:53 UTC (History)
5 users (show)

Fixed In Version: curl-7.61.1-15.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1900102 1900103 (view as bug list)
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)
[PATCH] http_proxy: do not crash with HTTPS_PROXY and NO_PROXY set (1.98 KB, patch)
2020-09-01 15:31 UTC, Kamil Dudka
mbasti: review+
Details | Diff

Comment 1 Kamil Dudka 2020-08-31 15:51:23 UTC
Thank you for the reproducer and patch!  I am able to reproduce it with the upstream git HEAD.  The proposed patch makes sense to me.  I will propose it upstream on your behalf.

Comment 2 Martin Bašti 2020-08-31 16:06:01 UTC
Thank you. I wanted to open PR too but I failed to build it successfully. Thank you for proposing it upstream.

Comment 4 Kamil Dudka 2020-09-01 15:31:14 UTC
Created attachment 1713334 [details]
[PATCH] http_proxy: do not crash with HTTPS_PROXY and NO_PROXY set

Comment 5 Kamil Dudka 2020-09-01 15:38:04 UTC
It turned out that the proposed patch does not work as expected.  There are more places in the code where (conn->http_proxy.proxytype == CURLPROXY_HTTPS) is checked regardless of the conn->bits.httpproxy flag, which resulted in hanging or crashes on other code paths.  So I ended up with attachment #1713334 [details], which seems to work better.  Martin, could you please have a look at it?

If you are fine with attachment #1713334 [details], I will open an upstream pull request for it, either with you as the commit author, or bug reporter, whichever you prefer.

Comment 6 Martin Bašti 2020-09-01 15:42:09 UTC
I'm fine with it, thank you!

Comment 7 Kamil Dudka 2020-09-01 16:34:31 UTC
upstream pull request: https://github.com/curl/curl/pull/5902

Comment 8 Kamil Dudka 2020-09-03 08:00:13 UTC
upstream commit: https://github.com/curl/curl/commit/3eff1c50


Note You need to log in before you can comment on or make changes to this bug.