You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently decided to build and run a web version of my app. I was really surprised to find out that your env file is clearly visible in the Google Dev Console as plain text.
If this behavior is expected, it should be clearly stated in the documentation with a big WARNING sign.
.env is not for storing anything you can't expose to the public and this should be clearly communicated.
Reacted by Christopher Perry, Rohith Premachandran, Matheus Geiser, Abdul Basit Rana and CH1GU1
Environment variables used by your front end application at runtime cannot be reliably protected. They are required to be bundled into the code. Sensitive variables should be stored on your server/backend for example.
There are libraries that will obfuscate them and make them "harder" to extract. We can add this to flutter_dotenv but it comes with the con of lulling people into a false sense of security when they should be focused on not putting sensitive keys in their frontend application in the first place.
Please see related issue and discussion #51 (comment)
Obfuscation is something I would be happy to consider along as it's clear to the users of this and any frontend env lib that the bundled keys can be extracted and people don't have a false sense of security and therefore store sensitive info.
I am going to close the issues for now but if someone would like to discuss if there is value in obfuscation or has another better idea please feel free to open or re open!
Activity
java-james commentedon Oct 12, 2024
Environment variables used by your front end application at runtime cannot be reliably protected. They are required to be bundled into the code. Sensitive variables should be stored on your server/backend for example.
There are libraries that will obfuscate them and make them "harder" to extract. We can add this to flutter_dotenv but it comes with the con of lulling people into a false sense of security when they should be focused on not putting sensitive keys in their frontend application in the first place.
Please see related issue and discussion #51 (comment)
java-james commentedon Oct 14, 2024
I have added a new section to the readme. https://github.com/java-james/flutter_dotenv/blob/master/README.md#security-considerations
Obfuscation is something I would be happy to consider along as it's clear to the users of this and any frontend env lib that the bundled keys can be extracted and people don't have a false sense of security and therefore store sensitive info.
java-james commentedon Oct 18, 2024
Thanks for raising the issue!
Related issues raised are
#100
#73
#111
I am going to close the issues for now but if someone would like to discuss if there is value in obfuscation or has another better idea please feel free to open or re open!