RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1737910 - Name Constraints validation: CN treated as DNS name even when syntactically invalid as DNS name [rhel-7.9.z]
Summary: Name Constraints validation: CN treated as DNS name even when syntactically i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nss
Version: 7.7
Hardware: All
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Bob Relyea
QA Contact: Alicja Kario
URL:
Whiteboard:
Depends On: 1804262
Blocks: 1825270
TreeView+ depends on / blocked
 
Reported: 2019-08-06 11:31 UTC by Fraser Tweedale
Modified: 2022-11-14 09:40 UTC (History)
13 users (show)

Fixed In Version: nss-3.53.1-3.el7_9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1825270 (view as bug list)
Environment:
Last Closed: 2020-09-29 21:18:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Mozilla Foundation 1571677 0 P2 ASSIGNED Name Constraints validation: CN treated as DNS name even when syntactically invalid as DNS name 2021-02-15 15:09:59 UTC
Red Hat Bugzilla 1670239 0 urgent CLOSED libpkix name constraints check treats CN as DNS name when it should not 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2020:4076 0 None None None 2020-09-29 21:19:20 UTC

Description Fraser Tweedale 2019-08-06 11:31:11 UTC
Description of problem:

Client certificate verification, where client cert has "CN=IPA RA,O=IPA.LOCAL", EKU with id-kp-serverAuth and id-kp-clientAuth, and no SAN. Issuer has DNS Name Constraint permittedSubtree of "ipa.local".


Actual results:

Certificate verification fails due to name constraint violation.


Expected results:

This bug is on similar lines to https://bugzilla.mozilla.org/show_bug.cgi?id=1523484 / https://bugzilla.redhat.com/show_bug.cgi?id=1670239, but a different issue. The CN is syntactically not a valid DNS name. Therefore the "treat CN as a DNS name" heuristic should not apply in this case. Certificate verification should succeed.


Additional info:

Upstream BZ: https://bugzilla.mozilla.org/show_bug.cgi?id=1571677

Comment 2 Alicja Kario 2019-08-06 14:24:51 UTC
Reproducer:
# get a helper library
git clone https://github.com/redhat-qe-security/certgen.git
. certgen/certgen/lib.sh
# generate the certificates
x509KeyGen ca
x509KeyGen server
x509KeyGen client
x509SelfSign --ncExclude '.com' --ncPermit localhost ca

x509CertSign --CA ca server
x509CertSign --CA ca -t webclient \
--extendedKeyUsage serverAuth,clientAuth,emailProtection client
# print the generated certificates
x509DumpCert ca
x509DumpCert server
x509DumpCert client

# set up the NSS databases for client and server
mkdir nssdb-srv
mkdir nssdb-clnt
certutil -N -d nssdb-srv/ --empty-password
certutil -N -d nssdb-clnt --empty-password
certutil -A -n ca -i $(x509Cert ca) -t 'cTC,cTC,' -a -d nssdb-srv
certutil -A -n ca -i $(x509Cert ca) -t 'cTC,cTC,' -a -d nssdb-clnt
pk12util -d nssdb-srv -i $(x509Key --with-cert --pkcs12 server) -W ''
pk12util -d nssdb-clnt -i $(x509Key --with-cert --pkcs12 client) -W ''

# start server that requires client certificates
NSS_ENABLE_PKIX_VERIFY=1 /usr/lib64/nss/unsupported-tools/selfserv -d nssdb-srv -p 4433 -V tls1.2: \
-H 1 -n server -rr -v

#!! run in separate console, same directory
# client that will trust the server cert and has a certificate trusted by 
# server:
SSL_DIR=nssdb-clnt curl https://localhost:4433
# or using tstclnt:
tstclnt -d nssdb-clnt -h localhost -p 4433 -n client <<<"GET / HTTP/1.0

"

Comment 4 Fraser Tweedale 2019-08-07 04:26:00 UTC
I've tested Bob's patch, it works correctly.

Comment 7 Bob Relyea 2019-08-07 20:09:55 UTC
Builds with fix: nss-3.44.0-5.el7
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=945972

I'm not sure who handles the hotfix portion of this..

bob

Comment 48 errata-xmlrpc 2020-09-29 21:18:42 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: nss and nspr security, bug fix, and enhancement 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-2020:4076


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