Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only expose NEXT_PUBLIC_* and TINA_PUBLIC_* ENV vars #3584

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

logan-anderson
Copy link
Contributor

@logan-anderson logan-anderson commented Feb 6, 2023

Fixes #3579 by exposing NODE_ENV, NEXT_PUBLIC_*, TINA_PUBLIC_*, and HEAD (for integration with Netifly) environment vars in the admin.

--
Update:

To address this, update @tinacms/cli to the latest patch 1.0.9. If you're on a version prior to 1.0.0 this vulnerability does not affect you.

Tina credentials like the API token are not considered especially vulnerable because they're for read-only access. Nevertheless, it may be a good idea to update them.

More importantly, if your Tina-enabled website has other credentials (eg. Algolia API keys) you should rotate those keys immediately.

Going forward, if you're using environment variables in any field customization (ie. ui.component functions), you'll need to make sure those are prefixed with TINA_PUBLIC_ (NEXT_PUBLIC_ is also supported).

@logan-anderson logan-anderson requested a review from a team as a code owner February 6, 2023 20:52
@vercel
Copy link

vercel bot commented Feb 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
rich-text-sanbox ❌ Failed (Inspect) Feb 6, 2023 at 8:52PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2023

🦋 Changeset detected

Latest commit: 61f8c0e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@tinacms/app Patch
@tinacms/cli Patch
starter-empty Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

Warnings
⚠️

packages/@tinacms/app was modified but its README.md was not updated. Please check if any changes should be reflected in the documentation.

Modified Packages

The following packages were modified by this pull request:

  • @tinacms/app

Generated by 🚫 dangerJS against 61f8c0e

@jeffsee55 jeffsee55 merged commit a5f69fc into main Feb 6, 2023
@jeffsee55 jeffsee55 deleted the fix/exposed-env-vars branch February 6, 2023 21:10
@jsntv200
Copy link

jsntv200 commented Feb 6, 2023

Will this need some documentation for the whitelist? Looks like TINA__CLIENT_ID and TINA__TOKEN are now TINA_PUBLIC_CLIENT_ID and TINA_PUBLIC_TOKEN which I assume would be a breaking change for many.

Also unclear what your policies are around security leaks, but as a user I would want to know that my secure build credentials may have leaked to publicly accessible files so I could deal with it and roll credentials if required.

@jamespohalloran jamespohalloran changed the title no long express all env vars to the frontend no longer expose all env vars to the frontend Feb 8, 2023
@logan-anderson logan-anderson changed the title no longer expose all env vars to the frontend Only exposes NEXT_PUBLIC_* and TINA_PUBLIC_* ENV vars Feb 8, 2023
@logan-anderson logan-anderson changed the title Only exposes NEXT_PUBLIC_* and TINA_PUBLIC_* ENV vars Only expose NEXT_PUBLIC_* and TINA_PUBLIC_* ENV vars Feb 8, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exposed ENV vars
3 participants