Skip to content

.env is available in plain text via web! #111

Closed

Description

@lukyanov

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.

Activity

  1. java-james commented on Oct 12, 2024

    @java-james
    Owner

    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)

  2. java-james commented on Oct 14, 2024

    @java-james
    Owner

    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.

  3. java-james commented on Oct 18, 2024

    @java-james
    Owner

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions