Skip to content

Security issue - create @tanstack/start with neon db exposes database url to client #287

@billy-the-ape

Description

@billy-the-ape

Which project does this relate to?

Create Tanstack App

Describe the bug

Creating a new tanstack start project with pnpm create @tanstack/start@latest per the docs will generate a project with the environment variables for the database prefixed with VITE_ -- this means that they are sent to the client.

Being new to vite I had no idea this was the case. Luckily my app is not to production yet, but I'd expect a lot of people might overlook this when building a new app with this tool.

Your Example Website or App

https://tanstack.com/start/latest/docs/framework/react/quick-start

Steps to Reproduce the Bug or Issue

  1. Follow the quick start instructions
  2. Expose your DB variables to the client

Expected behavior

Do not expose sensitive variables to the client

Screenshots or Videos

No response

Platform

Any

Additional context

No response

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