Bug 910815 - unable to verify SSL certificate hostname
unable to verify SSL certificate hostname
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: nss_compat_ossl (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Orphan Owner
Fedora Extras Quality Assurance
fst_ping=1
: Security, SecurityTracking
Depends On:
Blocks: 881399 881411
  Show dependency treegraph
 
Reported: 2013-02-13 11:10 EST by Kamil Dudka
Modified: 2017-01-25 07:50 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Release Note
Doc Text:
Story Points: ---
Clone Of: 881411
Environment:
Last Closed: 2016-12-20 07:34:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kamil Dudka 2013-02-13 11:10:50 EST
+++ This bug was initially created as a clone of Bug #881411 +++

--- Additional comment from Kamil Dudka on 2012-12-03 16:59:20 CET ---

This seems to be the upstream fix:

http://repo.or.cz/w/elinks.git/commitdiff/0c3f3e09

--- Additional comment from Kamil Dudka on 2012-12-03 17:14:26 CET ---

nss_compat_ossl does not seem to be ready for the upstream solutioin.  A possible hotfix would be to bypass nss_compat_ossl and call SSL_SetURL() from NSS directly.  The NSS default cert verification callback should then take care of the hostname validation.  But first I need to make sure that the NSS default cert verification callback is actually used by ELinks.

--- Additional comment from Kamil Dudka on 2013-02-13 17:01:55 CET ---

(In reply to comment #6)
> nss_compat_ossl does not seem to be ready for the upstream solutioin.  A
> possible hotfix would be to bypass nss_compat_ossl and call SSL_SetURL()
> from NSS directly.  The NSS default cert verification callback should then
> take care of the hostname validation.  But first I need to make sure that
> the NSS default cert verification callback is actually used by ELinks.

I have checked the sources of nss_compat_ossl and it explicitly ignores the hostname mismatch error:

    err = PORT_GetError();

    switch (err) {
    case SEC_ERROR_CERT_VALID:
    case SSL_ERROR_BAD_CERT_DOMAIN: /* We don't set set the hostname so we can
                                     * safely ignore this. In OpenSSL the
                                     * caller is responsible. */
        err = X509_V_OK;
        break;

Consequently, calling SSL_SetURL() has no effect anyway.
Comment 1 Kamil Dudka 2013-02-13 11:13:34 EST
How can one verify the certificate hostname without <openssl/asn1.h>?

Will nss_compat_ossl wrap the ASN1 decoder provided by NSS?
Comment 2 Fedora End Of Life 2013-07-04 01:25:39 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 3 Matthew Harmsen 2013-09-16 17:08:47 EDT
Kamil,

Looking at the "elink" OpenSSL code used to provide a subject name validity check as described in:

    Bugzilla Bug #881411 - elinks/links: does not properly verify SSL 
                           certificates

It appears that they may be hanging on the call "ASN1_STRING_to_UTF8()" call which is NOT provided by "nss_compat_ossl".

However, upon a closer review of the "elink" OpenSSL code used to provide a subject name validity check, it appears that there were numerous other calls that are not currently provided by "nss_compat_ossl" including:

    * V_ASN1_OCTET_STRING
    * GENERAL_NAMES
    * X509_STORE_CTX_get_error_depth()
    * X509_NAME_ENTRY
    * X509_NAME_get_index_by_NID()
    * X509_NAME_get_entry()
    * X509_NAME_ENTRY_get_data()

In the initial comment above, you had suggested that a workaround for this issue might be to utilize a direct call to NSS via SSL_SetURL(), but then added that this would not work due to the default error code handler provided by "nss_compat_ossl" (note that it may be reasonable for some applications to allow a subject name validity mismatch).  Although not ideal, could it be possibly suggested to use SSL_SetURL() without using the default error code handler provided by "nss_compat_ossl" (e. g. - registry of an alternative error code handler) instead?

I realize that this somewhat defeats the purpose of having a compatibility library, but as there is currently no specific timeline on when/if these calls would be supported by "nss_compat_ossl", this may be a more timely solution for the elinks project.
Comment 4 Kamil Dudka 2013-09-17 04:26:33 EDT
(In reply to Matthew Harmsen from comment #3)
> I realize that this somewhat defeats the purpose of having a compatibility
> library, but as there is currently no specific timeline on when/if these
> calls would be supported by "nss_compat_ossl", this may be a more timely
> solution for the elinks project.

The problem is that the vast majority of (potential?) clients of nss_compat_ossl need to verify the hostname as elinks does.  Are all of them supposed to bypass the compatibility layer and use the NSS API directly in order not to have security issues?
Comment 6 Florian Weimer 2013-09-17 06:10:23 EDT
(In reply to Kamil Dudka from comment #4)
> (In reply to Matthew Harmsen from comment #3)
> > I realize that this somewhat defeats the purpose of having a compatibility
> > library, but as there is currently no specific timeline on when/if these
> > calls would be supported by "nss_compat_ossl", this may be a more timely
> > solution for the elinks project.
> 
> The problem is that the vast majority of (potential?) clients of
> nss_compat_ossl need to verify the hostname as elinks does.  Are all of them
> supposed to bypass the compatibility layer and use the NSS API directly in
> order not to have security issues?

I think this is impossible to fix until OpenSSL gets its own host name validation function.  X509_check_host will be part of the next release, but it won't help until it's actually used by client code.

At present, code that reimplements X509_check_host uses difficult-to-predict parts of the OpenSSL ASN.1 and X.509 support routines, and it doesn't make much sense to support all of that in a compatibility wrapper.
Comment 7 Kamil Dudka 2013-09-18 07:55:00 EDT
Anybody feels like doing a review of attachment #799344 [details]?  Thanks in advance!
Comment 8 pjp 2014-12-03 13:22:59 EST
Hello mharmsen,

Could you please fix this soon?
Comment 9 Matthew Harmsen 2014-12-08 18:46:32 EST
(In reply to pjp from comment #8)
> Hello mharmsen,
> 
> Could you please fix this soon?

Unfortunately, there are no current plans to address the issues outlined in this bug.

As always, we welcome patches!

-- Matt
Comment 10 pjp 2015-04-09 13:32:01 EDT
Hello mharmsen@redhat.com,

You plan to fix this soon?
Comment 11 Florian Weimer 2015-04-09 13:36:36 EDT
This is impossible to fix.  nss_compat_ossl is terminally broken and should be retired.  Its few reverse dependencies can just use OpenSSL instead.
Comment 12 Kamil Dudka 2015-04-09 16:04:11 EDT
ELinks is already switched to use OpenSSL in rawhide:

http://pkgs.fedoraproject.org/cgit/elinks.git/commit/?id=6e8e7242

In stable Fedora, there is a workaround for this bug:

http://pkgs.fedoraproject.org/cgit/elinks.git/commit/?id=8ceec5fa
Comment 13 Fedora Admin XMLRPC Client 2015-04-29 18:36:03 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 14 Fedora Admin XMLRPC Client 2015-05-26 07:03:15 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 15 Fedora Admin XMLRPC Client 2015-05-26 07:26:54 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 16 Fedora Admin XMLRPC Client 2015-05-26 11:33:10 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 17 Jan Kurik 2015-07-15 10:51:43 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
Comment 18 Fedora End Of Life 2016-11-24 05:56:01 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 19 Fedora End Of Life 2016-12-20 07:34:35 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 20 Florian Weimer 2017-01-25 07:08:03 EST
nss_compat_ossl has been retired.
Comment 21 Florian Weimer 2017-01-25 07:12:26 EST
This was fixed upstream as part of tmux 2.2, with commit 64571368dc19219fc1ef9b6c20034ee143cbed0d.
Comment 22 Kamil Dudka 2017-01-25 07:38:09 EST
(In reply to Florian Weimer from comment #21)
> This was fixed upstream as part of tmux 2.2, with commit
> 64571368dc19219fc1ef9b6c20034ee143cbed0d.

It looks like the above comment is misplaced.  I see no relation between the above mentioned tmux commit and nss_compat_ossl.  Switching the resolution back to WONTFIX...
Comment 23 Florian Weimer 2017-01-25 07:50:34 EST
(In reply to Kamil Dudka from comment #22)
> (In reply to Florian Weimer from comment #21)
> > This was fixed upstream as part of tmux 2.2, with commit
> > 64571368dc19219fc1ef9b6c20034ee143cbed0d.
> 
> It looks like the above comment is misplaced.  I see no relation between the
> above mentioned tmux commit and nss_compat_ossl.  Switching the resolution
> back to WONTFIX...

Correct, I updated the wrong bug by accident.  Sorry about that.

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