My friend uses Firefox's built-in password manager feature to save passwords for sites. Later, after installing Avast Free Antivirus there was a feature called Passwords on the Avast UI. When accessed it read all the stored passwords from Firefox and gave this report.

This clearly shows that passwords were read and compared by a third party tool (Avast). How does Firefox save the passwords? Is it a bug which is being exploited by Avast? enter image description here

  • 6
    Weak passwords can be determined by brute force
    – david25272
    Commented Apr 15, 2016 at 3:23
  • @david25272 These are buttons actually. When clicked it even showed those weak passwords like p******d and the site used, just like Firefox password manager.
    – RamValli
    Commented Apr 15, 2016 at 9:16
  • 16
    98 duplicate passwords oh boy, a get one, get all the rest free sale! Commented Apr 15, 2016 at 18:26
  • 1
    Possible duplicate of security.stackexchange.com/questions/120044/… Commented Apr 15, 2016 at 22:45
  • 1
    Nearly 70% duplication is what they call average? That's kind of sick.
    – Sebb
    Commented Apr 16, 2016 at 12:22

4 Answers 4


How does Firefox save the passwords?

Previous answers have already presented the general idea, but a more in-depth explanation can be provided.

Firefox stores all user information in the profile folder. On Windows, it's located under %APPDATA%\Mozilla\Firefox\Profiles\; and on Linux, ~/.mozilla/firefox/.
The profile folder is created the first time Firefox is started for the current user, and typically has a cryptic name, like y7ogrp85.default in my case. This name is meant to be unique.

Since version 32 of Firefox, two files residing under the profile folder are responsible for managing saved passwords inside the browser. They are: logins.json and key3.db.

The first file, logins.json, contains actual information such as a list of usernames, passwords, domain names etc. It also lists the websites for which you opted NOT to save a password. However, these are encrypted. You can check for yourself.

The second file, key3.db, holds the key to decrypt the sensitive information found on the previous file, such as usernames and passwords.

Now, this implementation is not a secret (after all, Firefox is open source), and anyone can develop their own means to get someone's passwords by reading these files. In fact, it's been done already. I know of a tool by Nirsoft called PasswordFox for that.

There is one possible caveat, and it's the possibility of the user having implemented a master password within Firefox; this will encrypt the key3.db file itself. But there are means around that too, by brute-forcing the file with utilities made for that purpose, like John the Ripper and others.

Is it a bug which is being exploited by Avast?

Nope, not a bug. It's just the way the browser has been designed (not from scratch though - it's evolved a lot since the first versions). I believe it's reasonably convenient and secure. As long as:

  • Your system isn't compromised;
  • Nobody you don't trust has physical access to your computer, or even yet, unrestricted access to your files / your user account;
  • Your files are protected by Full Disk Encryption, in case your PC is stolen,

you should be fine. In any case I do recommend setting a strong master password or even better, switching to a dedicated password manager such as KeepassXC.

(I'm not personally connected with Nirsoft, Firefox or KeepassXC. I'm just a user.)


Passwords saved by Firefox are not encrypted (they are encrypted but the key can be read out) until you set a master password. I don't think that this is a bug, but every virus could read those passwords nonetheless

  • 3
  • 16
    @Dave It makes no practical difference whether they're unencrypted, or encrypted with a blank key. Consider that Firefox has to be able to decrypt them, then malware can just copy whatever Firefox does. Commented Apr 15, 2016 at 6:52
  • 14
    I will remind everyone here of the first rule of StackExchange: Be Nice.
    – AviD
    Commented Apr 15, 2016 at 8:50
  • 6
    Basically, the keys are encrypted in the file "logins.json" - however, as long as you don't use a master key, the password to decrypt everything is stored in "key3.db". At least they could have used the Windows built-in encryption. That would prevent someone from restoring my Firefox Profile from an old harddisk to get all my passwords.
    – user42838
    Commented Apr 15, 2016 at 14:49
  • 3
    @DanielGilbert Relying on Windows built-in encryption would of course be platform-dependant Commented Apr 16, 2016 at 8:42

Firefox can decrypt the passwords without you entering a password. That means it must have the decryption key--which means any program that knows how Firefox stores things can find them. This applies to any program that stores information on your system. Encryption is only a strong defense if you have to provide the decryption key before accessing the stored data. (Note that this is accomplished by using the supplied password as the decryption key--no password, no decryption, no access to the encrypted data. This inherently means there's no recovery of the password other than by external storage somewhere.)

Encrypting the passwords stops someone from using Notepad to read your passwords, it does not stop a serious attempt to find them.

  • 6
    You could point out that Firefox allows to set a master password to avoid exactly this problem...
    – Bakuriu
    Commented Apr 15, 2016 at 7:26
  • 4
    @Bakuriu: Master passwords are barely any protection at all. Malware can wait until you just type them in…
    – Ry-
    Commented Apr 15, 2016 at 8:38
  • 6
    @RyanO'Hara Malware is just one type of security issue. Having a master password can offer protection against other security breaches e.g. theft/loss of your hard drive. Commented Apr 15, 2016 at 13:24
  • 2
    With a master Password viruses can't read existing passwords
    – RoiEX
    Commented Apr 15, 2016 at 14:53
  • 3
    @RoiEX I think you meant a virus can't read existing passwords, until the user types in the Master Password
    – Patrick M
    Commented Apr 15, 2016 at 19:37

Unfortunately, if everything required to get your site password is stored on your computer then it is potentially vulnerable to malware. The only way to avoid this is to have user input (in some form). It is basically a trade-off between convenience and safety.

If you don't have a password manager you trust and are willing to put some effort into generating site-unique passwords (which is better than using one password for everything or writing them all down or trying to remember them all), I suggest using passwords which involve the encryption of the site name via something like the Playfair cipher (https://en.wikipedia.org/wiki/Playfair_cipher). This is simple enough that you can do it by hand (e.g. when you are not at your own computer) or can be easily programmed (as a separate application that needs youto input the key). If you need to increase the strength, repeat the result or add prefixes or suffixes. Obviously don't just auto-generate these site-unique passwords, or get your browser to remember them.

  • 2
    Playfair cipher is considered like a toy in modern cryptography. It's too weak to be of any serious use.
    – Lie Ryan
    Commented Apr 16, 2016 at 1:57
  • 1
    Not only stored on your computer, but potentially also stored anywhere that your computer has access to. Network storage, internet storage... in a real sense, a networking connection can be viewed as an "extended bus" connection. It's all just signals over wires in essence. Access something via mouse or keyboard clicks, and some programming can also access it. Commented Apr 16, 2016 at 6:35
  • @Lie Ryan. You are correct, Playfair is trivial to crack with computers. But I am not suggesting it is used to encipher text. Instead I suggest using it for the generation of part of a site-unique password if you don't or can't trust a password manager. Think of it as manually-generated and human-recoverable obfuscation. It has to be an improvement to trying to come up with (and remember) many unique site passwords. Commented Apr 18, 2016 at 8:15
  • @user2338816 I absolutely agree. The potential vulnerability isn't just your physical box. If your password is stored anywhere your computer has access to then it is potentially vulnerable.. Commented Apr 18, 2016 at 8:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .