Bug 871034

Summary: if CN matches hostname/IP but does not match explicitly set host subject, the connection should fail
Product: Red Hat Enterprise Linux 6 Reporter: David Jaša <djasa>
Component: spice-gtkAssignee: Christophe Fergeau <cfergeau>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: cfergeau, dblechte, jjongsma, marcandre.lureau, mkrcmari, pvine, rbalakri, tlavigne
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spice-gtk-0.22-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: For SSL connections, we considered the connection to be successful if the certificate subject matched the hostname even if a user-specified host certificate subject was given that didn't match. Consequence: Remote-viewer connected to the remote host even if the user-specified certificate subject did not match. Fix: Make the user-specified certificate subject check have priority over the hostname check. Result: Connections fail if user-specified cert subject doesn't match.
Story Points: ---
Clone Of:
: 873318 (view as bug list) Environment:
Last Closed: 2014-10-14 06:46:25 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: 873318    

Description David Jaša 2012-10-29 13:13:30 UTC
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 1 Christophe Fergeau 2013-09-20 15:10:54 UTC
I've sent a potential patch for this to http://lists.freedesktop.org/archives/spice-devel/2013-September/014612.html .

Comment 5 errata-xmlrpc 2014-10-14 06:46:25 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-1487.html