-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
docs(start): add security FAQ #6564
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
Open
tannerlinsley
wants to merge
2
commits into
main
Choose a base branch
from
claude/tanstack-security-research-GASeA
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+88
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| id: security | ||
| title: Security FAQ | ||
| --- | ||
|
|
||
| Answers to common security questions about TanStack Start. | ||
|
|
||
| ## Is TanStack Start secure by default? | ||
|
|
||
| Yes. TanStack Start includes built-in protections against common web vulnerabilities: | ||
|
|
||
| | Attack Vector | Protection | | ||
| | --------------------- | ------------------------------------------------------------------------------------------------------------ | | ||
| | CSRF | POST enforcement, custom headers, SameSite cookie support | | ||
| | Serialization attacks | Hardened serializer tested against all known CVEs and proactively researched against emerging attack vectors | | ||
| | SSRF | Origin derived from `request.url`, not client headers | | ||
| | Open redirects | URL sanitization (CR/LF stripping, protocol-relative URL prevention) | | ||
| | XSS | CSP nonce support for inline scripts | | ||
| | DoS | Payload size limits on requests | | ||
|
|
||
| ## What's automatic vs what do I need to configure? | ||
|
|
||
| **Automatic (zero configuration):** | ||
|
|
||
| - POST enforcement for server function mutations | ||
| - Custom header requirement (`x-tsr-serverFn`) on server function requests | ||
| - Origin validation from `request.url` | ||
| - Serialization hardening | ||
| - URL sanitization | ||
| - Payload size limits | ||
|
|
||
| **You configure (app-specific):** | ||
|
|
||
| - **SameSite cookie policy** - we provide the option, you choose `'lax'` or `'strict'` based on your app's cross-site requirements | ||
| - **Input validation schemas** - we provide `.inputValidator()`, you define what valid data looks like for your domain | ||
| - **CSP nonce** - we propagate your nonce to all scripts; you generate and configure it per-request | ||
| - **Authentication & authorization** - session management is provided, but auth logic is app-specific | ||
| - **Rate limiting** - depends on your infrastructure and traffic patterns | ||
|
|
||
| **Optional (if needed):** | ||
|
|
||
| - **CSRF tokens** - only needed for legacy browsers that don't support SameSite cookies; implement via middleware if required | ||
|
|
||
| We can't make every security decision for you because the right choice depends on your specific application. A banking app needs `sameSite: 'strict'`, while an app with legitimate cross-site embeds might need `'lax'`. Your validation schemas depend on your data model. Auth depends on your user system. | ||
|
|
||
| ## What about RSC (React Server Components) security? | ||
|
|
||
| TanStack Start's server function architecture uses a unidirectional data flow - the server sends data to the client, but the client does not send serialized component payloads back to the server for parsing. | ||
|
|
||
| This architecture is not susceptible to the class of RSC vulnerabilities disclosed in late 2025, including: | ||
|
|
||
| - [CVE-2025-55182](https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components) - Remote code execution via RSC payload deserialization | ||
| - [CVE-2025-55184](https://react.dev/blog/2025/12/11/denial-of-service-and-source-code-exposure-in-react-server-components) - Denial of service | ||
| - [CVE-2025-55183](https://react.dev/blog/2025/12/11/denial-of-service-and-source-code-exposure-in-react-server-components) - Source code exposure | ||
|
|
||
| These vulnerabilities affect frameworks that parse RSC Flight payloads on the server from client requests. | ||
|
|
||
| ## How should I validate user input? | ||
|
|
||
| Use the `.inputValidator()` method on server functions. See [Server Function Validation](./server-functions#validation). | ||
|
|
||
| ## How do I keep secrets safe? | ||
|
|
||
| Use `createServerFn()` or `createServerOnlyFn()` to ensure code only runs on the server. See [Execution Model](./execution-model). | ||
|
|
||
| ## How do I report a security issue? | ||
|
|
||
| Do not open a public GitHub issue. Email security concerns to the maintainers and allow time for a fix before public disclosure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| id: security | ||
| title: Security FAQ | ||
| --- | ||
|
|
||
| See the [Security FAQ](../../react/guide/security.md) - the security architecture is identical for React and Solid. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use docs-style relative link (drop
.md).Internal docs links should follow the extensionless docs-relative format.
♻️ Proposed fix
As per coding guidelines, Use relative links to
docs/folder format (e.g.,./guide/data-loading) for internal documentation references.📝 Committable suggestion
🤖 Prompt for AI Agents