Bug 1873327

Summary: libcurl: Segfault when HTTPS_PROXY and NO_PROXY is used together
Product: Red Hat Enterprise Linux 8 Reporter: Martin Bašti <mbasti>
Component: curlAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Daniel Rusek <drusek>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 8.3CC: adam.kaplan, kdudka, kwalker, sdodson, yselkowi
Target Milestone: rcKeywords: ZStream
Target Release: 8.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: curl-7.61.1-15.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1900102 1900103 (view as bug list) Environment:
Last Closed: 2021-05-18 14:53:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1875639, 1900102, 1900103    
Attachments:
Description Flags
[PATCH] http_proxy: do not crash with HTTPS_PROXY and NO_PROXY set mbasti: review+

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

Comment 25 errata-xmlrpc 2021-05-18 14:53:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: curl security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1610