Bug 873318 - if CN matches hostname/IP but does not match explicitly set host subject, the connection should fail
Summary: if CN matches hostname/IP but does not match explicitly set host subject, the...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: mingw-virt-viewer
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.4.0
Assignee: Christophe Fergeau
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On: 871034
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-05 14:38 UTC by David Jaša
Modified: 2015-09-22 13:09 UTC (History)
6 users (show)

Fixed In Version: mingw-virt-viewer-0.5.6-21.el6_5 mingw-spice-gtk-0.20-6.el6_5
Doc Type: Bug Fix
Doc Text:
Previously, it was possible to open consoles to virtual machines using the SPICE protocol even when the canonical name used in the connection matched the host name or IP address but did not match the explicitly set host subject. Now, the logic used to verify connections prioritizes the confirmation of the host subject, preventing connections where the canonical name and host subject do not match.
Clone Of: 871034
Environment:
Last Closed: 2014-06-09 12:51:09 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0644 0 normal SHIPPED_LIVE rhevm-spice-client bug fix and enhancement update 2014-06-09 16:49:53 UTC

Description David Jaša 2012-11-05 14:38:55 UTC
This bug affects windows builds, too.
mingw-virt-viewer-0.5.3-16
mingw-spice-gtk-0.12-9


+++ This bug was initially created as a clone of Bug #871034 +++

Description of problem:
if CN matches hostname/IP but not explicitly set host subject, the connection should fail.

The reason is that externally-provided host subject is likely to be more trustworthy than just check for host/ip == CN equivalence. OpenVPN behaves the suggested way for instance.

Version-Release number of selected component (if applicable):
spice-gtk-0.14-4.el6.x86_64
windows builds affected too

How reproducible:
always

Steps to Reproduce:
1. have a server with 'CN=server.example.org' in its subject
2. connect to a server:
remote-viewer --spice-ca-file=file --spice-host-subject='CN=something-else' spice://server.example.org/?tls-port=sport
3.
  
Actual results:
r-v connects

Expected results:
r-v should print host-subject mismatch error and exit

Additional info:

Comment 3 Marc-Andre Lureau 2013-04-29 14:19:09 UTC
Spice client has always done ssl verify callback by validating any of pubkey, hostname, or subject. I don't know if it's on purpose or a mistake, and I am afraid we are not SSL experts.

Since we have few SSL good practices experience, do you have that openvpn reference or any other information to help us understand and do the right move?

Comment 4 David Jaša 2013-05-02 15:19:04 UTC
(In reply to comment #3)
> Spice client has always done ssl verify callback by validating any of
> pubkey, hostname, or subject. I don't know if it's on purpose or a mistake,
> and I am afraid we are not SSL experts.
> 
> Since we have few SSL good practices experience, do you have that openvpn
> reference or any other information to help us understand and do the right
> move?

open and OpenVPN connection to name-based gateway in nm-connection editor, go to "VPN" tab, press "Advanced..." button, go to "TLS Authentication", overwrite "Subject Match:" field with nonsense string. Save and try to connect, you should get something like this in /var/log/messages:
May  2 17:06:50 cihla nm-openvpn[8442]: TLS_ERROR: BIO read tls_read_plaintext error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
May  2 17:06:50 cihla nm-openvpn[8442]: TLS Error: TLS object -> incoming plaintext read error
May  2 17:06:50 cihla nm-openvpn[8442]: TLS Error: TLS handshake failed

in spite of the subject matching DNS name. That said, if we follow default openvpn trust settings, we should verify only user-defined subject when defined.

Comment 6 Christophe Fergeau 2013-09-20 15:10:28 UTC
I've sent a potential patch for this to http://lists.freedesktop.org/archives/spice-devel/2013-September/014612.html.

Btw, I'm confused by your 'but not explicitly set host subject' in the bug description, as the example you give has an explicitly set host subject. I assume you mean 'but does not match explicitly set host subject' ?

Comment 7 David Jaša 2013-09-21 22:12:02 UTC
Yes, that's what I meant.

Comment 11 errata-xmlrpc 2014-06-09 12:51: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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2014-0644.html


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