Not on Windows, but on Linux it's encrypted with your account password (it uses the Gnome Keyring/KDE Wallet APIs).
But none of that is going to help against an attacker with the same permissions.
But none of that is going to help against an attacker with the same permissions.
But as you pointed out, another process with the same privileges can decrypt it making it pretty pointless in both cases. Only way to securely do it is to prompt the user for a decryption key each time they open the browser which has usability issues but Firefox offers it via the Master Password functionality.
[0] https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
On macOS, applications address spaces are isolated and code signing certificates are used for identifying application requests to the keychain.