Bug 910815 - unable to verify SSL certificate hostname
Summary: unable to verify SSL certificate hostname
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: nss_compat_ossl
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Orphan Owner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: fst_ping=1
Depends On:
Blocks: CVE-2012-6709 881411
TreeView+ depends on / blocked
 
Reported: 2013-02-13 16:10 UTC by Kamil Dudka
Modified: 2017-01-25 12:50 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Release Note
Doc Text:
Clone Of: 881411
Environment:
Last Closed: 2016-12-20 12:34:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Kamil Dudka 2013-02-13 16:10:50 UTC
+++ 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 16:13:34 UTC
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 05:25:39 UTC
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 21:08:47 UTC
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 08:26:33 UTC
(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 10:10:23 UTC
(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 11:55:00 UTC
Anybody feels like doing a review of attachment #799344 [details]?  Thanks in advance!

Comment 8 pjp 2014-12-03 18:22:59 UTC
Hello mharmsen,

Could you please fix this soon?

Comment 9 Matthew Harmsen 2014-12-08 23:46:32 UTC
(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 17:32:01 UTC
Hello mharmsen,

You plan to fix this soon?

Comment 11 Florian Weimer 2015-04-09 17:36:36 UTC
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 20:04:11 UTC
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 22:36:03 UTC
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 11:03:15 UTC
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 11:26:54 UTC
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 15:33:10 UTC
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 14:51:43 UTC
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 10:56:01 UTC
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 12:34:35 UTC
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 12:08:03 UTC
nss_compat_ossl has been retired.

Comment 21 Florian Weimer 2017-01-25 12:12:26 UTC
This was fixed upstream as part of tmux 2.2, with commit 64571368dc19219fc1ef9b6c20034ee143cbed0d.

Comment 22 Kamil Dudka 2017-01-25 12:38:09 UTC
(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 12:50:34 UTC
(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.