Closed Bug 185243 Opened 23 years ago Closed 9 years ago

Importing own p12 ID plus dumps Authoritiy "Root Certificates"

Categories

(Core Graveyard :: Security: UI, defect, P3)

1.0 Branch
x86
Windows 2000
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: hauser, Unassigned)

Details

(Whiteboard: [kerh-coz])

When an ID has a certificate identical to a Root CA, a previously imported root certificate gets dumped without warning. Suggestion add a warning! Background: I am trying to use OpenSSL-generated self signed certificates to encrypt mail to myself. It works if I only import the certificate without the private key (*.crt) and edit the "CA certificate trust" to allow all 3 (identify web sites/mail users/software). However when I want to decrypt them and import also the private key (*.pfx), the cert in "Authority" gets dumped and I no longer can send mail to that e-mail address (under "view security info" - the status for that recipient is "Not Found"). As per discussions in news://netscape.public.mozilla.crypto one might be of different opinion to whether self-signed certificates are acceptable. But just forcing wanna-be users of them to an alternating import of pfx then crt and back and forth (sometimes it only gets enforced after a Mozilla restart) doesn't appear to be a clean solution!
Another free alternative is to get a Black Helicopter cert - http://www.black-helicopter.org/bh/getone.html?
Priority: -- → P3
Version: 2.1 → 2.4
This may or may not be a bug. Please provide steps to reproduce. Mozilla was designed and intended to be used with REAL PKI. In real PKI, email certs are not CA certs. Suggestion, make yourself a CA cert and an email cert issued by your own CA. Import the CA cert as a CA cert, and the email cert as your personal cert (with private key).
How to reproduce: 1) Import a .crt certificate (since OpenSSL enables all purposes on its self-signed certifcates: <<- Ensures the identity of a remote computer - Proves your identity to a remote computer - Ensures software came from software publisher - Protects software from alteration after publication - Protects e-mail messages - Allows data to be signed with the current time - Allows you to digitally sign a certificate trust list - Allows secure communication on the Internet - Allows data on disk to be encrypted - Windows Hardware Driver Verification - Windows System Component Verification - OEM Windows System Component Verification - Embedded Windows System Component Verification - Key Pack Licenses - License Server Verification - Smart Card Logon - Digital Rights>>), it will end up in the CA. 2) Import the corresponding .pfx or p12 file and the crt imported under step 1 is gone. ----- Fine - you suggestion to create a two level certificate may well work. However, if you only want to support the interaction with a REAL CAs, I would make sure that a user who inadvertently clicks on a file coming from a non-REAL source doesn't mess up your Root CA store unrecoverably, otherwise, with the currently implemented functionality, it might be (easily) possible to write a denial-of-service attack kicking out all built-in root-CA certificates without the user really noticing. See also suggestion 3 in http://bugzilla.mozilla.org/show_bug.cgi?id=185198#c2
Thanks for the hint on black helicopter. Unfortunately, even though in the certificate manager all looks fine, build 2002121008 refuses to encrypt to my bh key (Encryption not possible, key not found???)
Please create files that can demo this bug, and attach them to it. Regarding your hypothesis about a DOS attack, please describe it further. Do you think a user could import a .p12 file without really noticing? BH certs seem to work OK for me.
Do it like download.com when you click on their download button: First the download (in a DOS of the p12 file) starts and then the page gets redirected to an innocuous landing page. This way, since Mozilla doesn't provide any user feedback upon certificate replacement (at least when a p12 has the same certificate ID as a root certificate), a user browsing a site could with each click replace a root certificate with a bogus ID and at the end all the user's e-banking certificates, etc. would no longer be verifiable. As described in the original post, it can be reproduced with openssl self-signed certificates: 1) First import the crt as a root certificate 2) Then import the corresponding p12 and without any warning, the crt is gone. Obviously, a DOS attacker would not do step 1), but carefully craft the p12 such that step 2) occurs with the same effect on a built-in root-certificate.
Are you saying that there is some MIME type that mozilla uses to interpret the download from a server as a .p12 file? If so, what MIME type is that? AFAIK, the only way to import a .p12 file is via a cert import dialog in the cert manager, and the .p2 file has to be accessible via the local system's file system.
One more thing: importing a .p12 file involves entering a password. This is not going to happen without a user noticing.
Nelson, you are right, the originally reported error only occurs when with a file import, but not with a MIME type over http. Therefore, this makes a DOS still possible, but a lot harder and thus unlikely. The p12 file first must be downloaded to the user's hard-disk and then, the user must be convinced to import it which admittedly is not that likely. The passwords you mention, however, do not add much protection: 1) p12 files can be created to require only empty passwords upon import. 2) The software security device will not say why it asks for the password upon this import/restore (since I only cache this password for 10 minutes, I get asked for it about 6 times an hour) sometimes this password dialog even pops up when I am not really on Mozilla, but switch between let's say emacs and excel. Anyway, I use to always enter it without bothering why it asks for it because i) it doesn't volunteer why and ii) because one my avg. 5 open Mozilla windows just might have hit a page with a login field that the password manager desperately wants to fill even though I don't intend to log in at this very time. 3) Still, the "Your Certificates - Import" will only say that it will restore a certificate backup, but never give you the idea that at the same time, it might dump the Verisign Root Certificate. One more missing dialog I encountered when focusing on this question (http://bugzilla.mozilla.org/show_bug.cgi?id=186192)
Mass reassign ssaux bugs to nobody
Assignee: ssaux → nobody
Product: PSM → Core
Whiteboard: [kerh-coz]
QA Contact: junruh → ui
Version: psm2.4 → 1.0 Branch
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.