You are here

[HOW-TO] Secure your Firefox profile from data-thief

19 posts / 0 new
Last post
m-p-3
m-p-3's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2006-06-17 21:25
[HOW-TO] Secure your Firefox profile from data-thief

Scenario:
Someone stole your USB thumbdrive, which contain some sensitive data, including some passwords and/or session informations. The thief could then access some of your accounts you previously logged in.

Solution:
The default Firefox's behavior is insecure for a roaming profile like the one used in Firefox Portable. Here are my recommendations:

Use a Master Password (Tools -> Options -> Security -> Master Password), the stronger the password is, the better (use the strength indicator, it's not there for coolness factor). This will encrypt the passwords in the signons3.txt file so they won't be viewable without the Master Password.

because the cookies and session informations are NOT encrypted using the Master Password, this is a security threat that could grant access to your account if you activated the auto-login options, even if there is a Master Password. Also, if someone move your cookies.sqlite file from Firefox Portable profile to another profile, they will be able to use the cookies to gain access to some accounts with your saved credentials.

In order to avoid this, we will have to make sure that all sensitive datas and session informations will be cleared when Firefox is closed. To do so, we will have to use the option "Always clear my private data when I close Firefox" combined with the following options checked in the Settings:
-Saved Form and Search History
-Cache
-Cookies
-Offline Web Site Data
-Authenticated Sessions

This way, no cookies will be kept in Firefox, and the only way to gain access to your accounts will be to know the Master Password. Take note that because the cookies are not saved, you will lose the cookie-based website settings and the ability to auto-login to websites. The saved usernames and passwords will however be auto-completed in the login pages. This is in my opinion a good trade-off between security and usability.

By using those settings, it should give you at least enough time to change your password before a thief manage to brute force your Master Password, making the stored passwords useless.

Please leave some comments if you think there is something missing, or to give some feedback.

Thanks !

m-p{3}

Tim Clark
Tim Clark's picture
Offline
Last seen: 13 years 4 months ago
Joined: 2006-06-18 13:55
You did ask for comments

You did ask for comments,
I thought all of this was pretty well known,
I don't use it on my hard drive,
but have had it set that way on my flash since day one of 1.5

Tim

Things have got to get better, they can't get worse, or can they?

m-p-3
m-p-3's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2006-06-17 21:25
Thanks for the comment, I'm

Thanks for the comment,

I'm pretty sure I won't learn anything to you and most power-users.
I hope this will become useful for users will less computer/Firefox experience, as data-thief is usually due to lack of knowledge.

How can you protect yourself if you don't know what you should protect first? Blum

Tim Clark
Tim Clark's picture
Offline
Last seen: 13 years 4 months ago
Joined: 2006-06-18 13:55
Mathew

I sense from your reply that you might have taken offense Sad
I assure you none was intended Smile
I was sincere in my comment,
I "thought" that this was pretty well known.
That is, I am "surprised" if it is not common knowledge,
That's all I meant Smile

Tim

Things have got to get better, they can't get worse, or can they?

m-p-3
m-p-3's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2006-06-17 21:25
Haha, there is absolutely no

Haha, there is absolutely no offense Smile

I'm grateful you replied to my original post Smile

RMB Fixed
Offline
Last seen: 14 years 7 months ago
Joined: 2006-10-24 10:30
Excellent how-to ..

This is extremely useful information for the
non-technical users, the overwhelming majority Sad
Experience has taught me that there is no such thing as "common knowledge" where computers are involved .

USBman
Offline
Last seen: 2 years 3 months ago
Joined: 2006-10-11 17:43
Password

Aside from the session manager and cookie issue, I would like to suggest KeePass Password Safe Portable for password management: https://portableapps.com/apps/utilities/keepass_portable

It stores all your passwords in an encrypted (AES or TwoFish) file that can easily be used on any number of locations, such as your home machine, office machine, USB drive, etc. It also has the added security measure of offering the requirement of a keyfile - without that file, even if they did somehow get the password, a would-be thief would still get absolutely nowhere.

Additionally, this program offers the advantage of working on "any" password field, not just in Firefox - you could use it in Firefox, your IM client, etc.

Besides, I think I had read somewhere that there were ways to get around Firefox's master password (sorry about the lack of a reference)...

gjjh25
Offline
Last seen: 5 months 1 day ago
Joined: 2006-04-03 07:38
Will keepsafe, work in a

Will keepsafe, work in a similar way to roboform? i.e. open web site and fill in password details?

Graham Yates

m-p-3
m-p-3's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2006-06-17 21:25
KeePass don't auto-fill forms

KeePass don't auto-fill forms at the moment, but I'm pretty sure this could be done through a communication layer between the browser and the application with an extension. Unfortunately, no one has taken the business of doing it, and I don't feel like I have neither the programming knowledge or time to do it.

m-p-3
m-p-3's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2006-06-17 21:25
There is a possibility of

There is a possibility of accessing the encrypted passwords through brute-force, but the timeframe should be big enough between the moment you discover that you lost the thumbdrive so you can do a password change.

I should verify what kind of encryption is used by the Master Password feature (AES, Twofish, Serpent ?). Somebody know that information just in case before I start searching ?

One thing I'd like to see is an extension that encrypt the cookies and session information with the Master Password key. That would be awesome for portable users like us, if the encryption is secure enough.

EDIT: Downloading Firefox 3.0 final source code, I'm really curious about this. I'll post about it later.

USBman
Offline
Last seen: 2 years 3 months ago
Joined: 2006-10-11 17:43
Encrypting the cookies & session info

Yeah! If anyone could help with pointing out such an extension, or maybe write on... wow! That would be awesome!

Dr Zaius
Offline
Last seen: 16 years 2 months ago
Joined: 2008-06-18 22:02
Brute Forcing

I'm not sure what particular encryption algorithm is used but I know that the brute force time becomes impractical if you're using a password of decent complexity.

Anyone who is concerned can try brute forcing their own password:
http://www.securityxploded.com/firemaster.php

Dr Zaius
Offline
Last seen: 16 years 2 months ago
Joined: 2008-06-18 22:02
Truecrypt?

Nice guide, I'm sure it will help concerned users get a grasp of securing their profile. I've seen far too many people being complacent with what data they leave on their flash drives.

I personally just put all my applications into a Truecrypt volume on my flash drive, I know quite a lot of other people do this too. This way I don't have to worry about sensitive data somewhere that I may have overlooked and I can enjoy the convenience of saved form history etc.

With all the new features in Firefox 3 collecting more and more personal data I'd rather not let anyone near my profile directory at all. There's also other potentially sensitive information like your bookmarks and information stored by extensions to be worried about. Maybe I'm just paranoid. Smile

Saying that there are downsides to using Truecrypt as a solution:

  • Requires administrator privileges (Only needed if Truecrypt isn't already installed locally)
  • Performance - a lot heavier disk writing and CPU usage

What I see as key advantages to Truecrypt:

  • Seamless security for all data
  • Deniabilty/Privacy - A thief wouldn't even know I had Firefox on my flash drive

If you've got a reasonably fast flash drive and won't be using too many low end computers I'd recommend people take a look at Truecrypt. Otherwise a master password and clearing private data is the next best thing.

www.truecrypt.org

OliverK
OliverK's picture
Offline
Last seen: 3 years 2 months ago
Developer
Joined: 2007-03-27 15:21
Hate to break it to you, but

Hate to break it to you, but this has been discussed so many times it makes me dizzy.

Truecrypt requires admin rights to run.

No offense to you, but as a general warning before we all run out and install our FF into a truecrpyt container.

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

Dr Zaius
Offline
Last seen: 16 years 2 months ago
Joined: 2008-06-18 22:02
No offense taken, I know that

No offense taken, I know that Truecrypt has been discussed to death all over the internet. However if a user doesn't know about the master password then chances are they don't know about Truecrypt either.

I did mention the administrator privilege problem in my post. You don't need administrator privileges to run it if it has been installed locally, but I know it isn't easy to convince the IT people at your work/university/cafe etc that Truecrypt is a good thing.

m-p-3
m-p-3's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2006-06-17 21:25
My concern is that I don't

My concern is that I don't always have administrative privileges on some systems, which stop me from using TrueCrypt as it need a system-level driver to be executed to decrypt and encrypt on-the-fly.

I'd like to see an effort from the Mozilla team to increase the sight of the Master Password to several other items like the cookies, history and bookmarks.

If they can do it for passwords, why not for these sensitive data too ?

m-p-3
m-p-3's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2006-06-17 21:25
Found the encryption method

I've finally found the information regarding the password encryption in Firefox.

Source (securityfocus.com)
4.2.2 Firefox 0.7-1.5 and 2.0

Storage Construct: Text File (signons.txt)
Format: ASCII, using Base64 encoding (except URL and fields)

URL (clear text, i.e. www.gmail.com)
Field name (in cleartext, e.g. username, email, userid, etc.)
Encrypted and Base64 encoded value of above information
Field name (i.e. password, pass, etc.)
Encrypted and Base64 encoded value of above information
...etc... (Could have many entries for one URL)
.
(Each URL entry ends with period on separate to line)

Encryption: TripleDES (CBC mode) [ref 16]
Access: Network Security Services (NSS) API [ref 17]
Requirements for Access: User logged in and the Master Password (if set)
Relevant files: Certificates (Signed Public Keys) stored as certN.db, Private Key Database stored as keyN.db, and Security Modules stored as secmod.db [ref 18]

Note that files locations were previously addressed in section 4.1.

Firefox uses the Network Security Services API to perform its cryptographic operations. As it relates to the Password Manager Firefox makes use of Public Key Cryptography Standard (PKCS) #11 [ref 19] which defines an API for third party security modules that are either software or hardware based. It also uses PKCS#5 for password based encryption. [ref 19] Firefox also has an option of using an alternative security module for the password manager that is Federal Information Processing Standard (FIPS) 140-1 compliant. [ref 20] The Master Password is used in conjunction with a salt (found in the keyN.db file) is used to derive a Master Key. The Master Key is then in turn used to decrypt the usernames, passwords that are stored in the Password Manager.

The NSS API, although not easily tackled, has some vital functions that let Firefox or a related program to gain access to the password database. Setting the password is handled by (PK11_SetPasswordFunc), decoding base64 data (NSSBase64_DecodeBuffer), and decrypting (PK11SDR_Decrypt) allows a related program to access usernames and associated passwords; this is of course a simplified example. The real code would need to initialize NSS, declare variables, manage buffers and so forth. The security of the entire system, however, weights on the cryptographic strength of the Master Password (created by the user), and accessibility to the key3.db file (which contains the salt), and is stored in the user's profile.

The FIPS 140-1 security module can be enabled by navigating to the following location:

Firefox 1.5 on Windows:

Tools | Options | Advanced | Security Devices | NSS Internal FIPS PKCS #11

Firefox 2.0 on Windows:

Tools | Options | Advanced | Encryption | Security Devices | NSS Internal FIPS PKCS #11

USBman
Offline
Last seen: 2 years 3 months ago
Joined: 2006-10-11 17:43
Nice work!

Wow, that's a heck of a post. Thanks for sharing so much great info!

KickButts
KickButts's picture
Offline
Last seen: 14 years 2 months ago
Joined: 2008-03-13 09:58
Thumbs up!

Nice tutorial. Smile

Alive and kicking!
"If you were a robot, and I knew but you didn't, would you want me to tell you?"

Log in or register to post comments