Closed
Bug 508577
Opened 17 years ago
Closed 17 years ago
mostly universal wildcard certificate in |port_RegExpMatch| when NSS_USE_SHEXP_IN_CERT_NAME is set
Categories
(NSS :: Libraries, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 504456
People
(Reporter: guninski, Unassigned)
Details
(Whiteboard: [sg:dupe 504456])
universal wildcard certificate in |port_RegExpMatch| when NSS_USE_SHEXP_IN_CERT_NAME is set
http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/util/portreg.c#275
exp[x] = '\0';
this null terminates the regexp totally changing its content allowing universal wildcard certificate.
gdb log:
Breakpoint 2, port_RegExpMatch (str=0x7f06c94267a0 "localhost",
xp=0x7f06c9444940 "***~guninski.com", case_insensitive=1) at portreg.c:270
270 if(!exp)
Current language: auto; currently c
(gdb) p exp
$1 = 0x7f06c9444900 "***~guninski.com"
(gdb) cont
Continuing.
Breakpoint 1, port_RegExpMatch (str=0x7f06c94267a0 "localhost",
xp=0x7f06c9444940 "***~guninski.com", case_insensitive=1) at portreg.c:276
276 if(_shexp_match(str,&exp[++x], case_insensitive) == MATCH)
(gdb) p exp
$2 = 0x7f06c9444900 "***"
(gdb) next
278 break;
(gdb) next
281 if(_shexp_match(str,exp, case_insensitive) == MATCH) {
(gdb) next
282 PORT_Free(exp);
(gdb) next
283 return 0;
(gdb) next
289 }
| Reporter | ||
Updated•17 years ago
|
Component: General → Libraries
Product: Firefox → NSS
Version: Trunk → trunk
| Reporter | ||
Updated•17 years ago
|
QA Contact: general → libraries
| Reporter | ||
Updated•17 years ago
|
Whiteboard: [sg:investigate]
Comment 1•17 years ago
|
||
Only "mostly" universal: it wouldn't work for any site with "guninski.com" in it. Of course you could use "example.invalid" and be sure you're not excluding anything worthwhile.
Given any CA that allows a null probably allows a tilde, yeah, this would be bad. We fixed this when we fixed bug 159483, disallowing these old-style regexps. The code is still present for server shops who require backward compatibility for internal reasons, but should be turned off in clients.
Updated•17 years ago
|
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
| Reporter | ||
Comment 3•17 years ago
|
||
> Only "mostly" universal: it wouldn't work for any site with "guninski.com"
this is pedantically right and i will add "almost universal" to the subject unless i manage to include multiple CN / altsubjectname to make it truely universal.
> Of course you could use "example.invalid"
fighting pedantism with pedantism, getting cert for "example.invalid" is not trivial without some other kind of other attack. playing with CAs suggest the CA must *suspect* one have control over "example.invalid" and i don't see a way to make it suspect this without some other attack.
of course s/example.invalid/onetimedomain${RAND}.com/ would work.
| Reporter | ||
Updated•17 years ago
|
Summary: universal wildcard certificate in |port_RegExpMatch| when NSS_USE_SHEXP_IN_CERT_NAME is set → mostly universal wildcard certificate in |port_RegExpMatch| when NSS_USE_SHEXP_IN_CERT_NAME is set
Comment 4•17 years ago
|
||
Georgi,
You're looking at obsolete source. Look at
http://mxr.mozilla.org/security/source/security/nss/lib/util/portreg.c
| Reporter | ||
Comment 5•17 years ago
|
||
> You're looking at obsolete source. Look at
the gdb breakpoints are authentic.
Comment 6•17 years ago
|
||
Georgi, you're looking at old source code, not the current NSS sources.
You're looking at code that doesn't have the current fixes. Reporting
bugs in code that has already been fixed isn't a good use of anyone's time.
Comment 7•17 years ago
|
||
Why doesn't mozilla-central (trunk) have these fixes yet then?
Comment 8•17 years ago
|
||
Because someone in MoCo doesn't want to take NSS 3.12.4
Comment 9•17 years ago
|
||
(In reply to comment #8)
> Because someone in MoCo doesn't want to take NSS 3.12.4
Stop making stuff up, Nelson.
Bug 504080 supposedly took mozilla-central to NSS_3_12_4_FIPS4. Does that tag not include the fixes that are already on NSS trunk? If not, what do we need to do to get mozilla-central to a tag of 3.12.4 that has these fixes?
Comment 10•17 years ago
|
||
Reed, let's not waste any more time on this.
FF 3.5.1 is not vulnerable UNLESS the user sets an environment variable
named NSS_USE_SHEXP_IN_CERT_NAME, and I estimate the total number of
users in the world who've done that to be 2 (both reading this bug, BTW).
Comment 11•17 years ago
|
||
So, if only 2 people in the world use NSS_USE_SHEXP_IN_CERT_NAME, can we just remove that code completely so there's no possible way users could be vulnerable to this problem?
Comment 12•17 years ago
|
||
Firefox is not the only code that uses NSS.
Comment 13•17 years ago
|
||
(In reply to comment #12)
> Firefox is not the only code that uses NSS.
What consumers of NSS actually use that environmental variable?
Comment 14•17 years ago
|
||
Server products running in intranet environments, acting as clients.
| Reporter | ||
Comment 15•17 years ago
|
||
> UNLESS the user sets an environment variable named NSS_USE_SHEXP_IN_CERT_NAME
i wrote this in the subject of the bug.
nelson: are you saying that the new uberleet code is safe in this scenario even if it is used by less than 2 followers?
Comment 16•17 years ago
|
||
Georgi,
I don't know what you mean by "followers", but I suggest you try the new
code yourself. The files with the fixes are public and may be seen at
http://mxr.mozilla.org/security/find?text=&kind=text&string=portreg
| Reporter | ||
Comment 17•17 years ago
|
||
looking at the new code, i suspect it is still vulnerable if the env. var is set.
is this true?
Comment 18•17 years ago
|
||
You suspect?
If you can find a test case that fails, please report the failing test case
in a comment in this bug, or in bug 509175.
If you only suspect there is a problem, but cannot give a test case that
fails, that doesn't help us.
| Reporter | ||
Comment 19•17 years ago
|
||
the bug is in firefox.
to reproduce:
export NSS_USE_SHEXP_IN_CERT_NAME=WHO_FIPS_CERTIFIED_THIS\?
visit a site presenting a certificate with CN=***~bolyard.meme signed by a fips certified ca
i suggest this bug be opened since it is resolved and nelson still pretends to not get it
| Reporter | ||
Comment 20•17 years ago
|
||
fyi information i didn't see the memory corruption bug when deleting silently installed in mofo advisories - nelson downplayed it too ;)
| Reporter | ||
Comment 21•17 years ago
|
||
... deleting silently installed *user certificates*...
Comment 22•17 years ago
|
||
The test case suggested in comment 19 causes absolutely no problem with
the portreg code in NSS at the URL given in comment 16.
Georgi, the shexp code is not crypto code.
It's not part of any FIPS certified library.
CA's aren't FIPS certified either.
Updated•17 years ago
|
Whiteboard: [sg:investigate] → [sg:dupe 504456]
Updated•17 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•