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
According to this article, the .env file appears to be readable.
I'm storing key security information here.
Is there a security problem depending on the blog post? I wonder if it's reliable or if there's a security problem, how can you secure it?
Reacted by HarryAtos, Albert Mañosa, mamadou94Diop, Yasin Arık, Harsh Bangari , Sheikh Samiul Huda and Mamadou Aliou BAH
Thanks for raising the concern.
Please see #51 (comment) for a related discussion on this. In short, you shouldn't use .env on the client side to store sensitive data. Please get back to me if we are missing a point here, especially if you have something in mind we may have not thought of yet.
Operations that involve truly sensitive keys should be proxied through an API call to a service that can securely host and use these values.
There are env libraries that attempt to obfuscate your env variables. We could implement similar on this library, however, I think that would lull people into a false sense of security when in reality, no sensitive keys should be used on the front end of your application.
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!
@java-james The issue has been marked as closed, but the proposed resolution may not be entirely sufficient. Even if the .env file is generated from managed secrets in CI, those values remain accessible once the APK is downloaded.
Should we consider implementing a local symmetric encryption mechanism before packaging these assets into the APK to better protect the secret variables?
Activity
java-james commentedon Oct 2, 2022
Thanks for raising the concern.
Please see #51 (comment) for a related discussion on this. In short, you shouldn't use .env on the client side to store sensitive data. Please get back to me if we are missing a point here, especially if you have something in mind we may have not thought of yet.
iCodePoet commentedon Oct 5, 2022
Thank you for your comment.
Is there an alternative to how sensitive data is managed?
I would appreciate it if other people could suggest a good idea.
java-james commentedon Oct 14, 2024
See suggestion on linked thread
There are env libraries that attempt to obfuscate your env variables. We could implement similar on this library, however, I think that would lull people into a false sense of security when in reality, no sensitive keys should be used on the front end of your application.
java-james commentedon Oct 18, 2024
Thanks for raising it as an issue.
Related issues raised are
#100
#74
#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!
sergembamba commentedon Apr 14, 2026
@java-james The issue has been marked as closed, but the proposed resolution may not be entirely sufficient. Even if the .env file is generated from managed secrets in CI, those values remain accessible once the APK is downloaded.
Should we consider implementing a local symmetric encryption mechanism before packaging these assets into the APK to better protect the secret variables?