Skip to content

📝 Add deployment guidance for serving uploaded media safely - #67

Merged
kulesy merged 5 commits into
mainfrom
docs/serving-uploaded-media-safely
Oct 12, 2026
Merged

kulesy merged 5 commits into
mainfrom
docs/serving-uploaded-media-safely

Conversation

@kulesy

@kulesy kulesy commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Pain: repo-based media is served from your site's own domain, so an uploaded file that a browser runs as a page or a script runs with your site's cookies. SVG can still carry script after upload, and nothing documented how to harden the way media is served against it.

Solution: adds a "Serving Uploaded Media Safely" page under Media Storage covering nosniff, a sandboxing CSP on the media path, and serving media from a separate origin, with Next.js, Netlify, Vercel and nginx header snippets. It documents the deployment-hardening acceptance criterion of tinacms/tinacloud#3818, and adds a link to the new page from Repo-based Media.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 12, 2026 12:17am UTC

Request Review

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kulesy

kulesy commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Rendered on the preview:

Serving Uploaded Media Safely, top of page

Figure: the new page and its sidebar entry under Media Storage, live at https://docs-14gpgm53p-tinacms.vercel.app/docs/reference/media/serving-media-safely

Per-platform header snippets

Figure: the Next.js, Netlify, Vercel and nginx header examples, live at https://docs-14gpgm53p-tinacms.vercel.app/docs/reference/media/serving-media-safely

@kulesy
kulesy marked this pull request as ready for review October 11, 2026 21:53
@kulesy
kulesy requested a review from a team as a code owner October 11, 2026 21:53

@joshbermanssw joshbermanssw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header advice looks good. A few inline suggestions, the first one matters most.

Comment thread content/docs/reference/media/serving-media-safely.mdx Outdated
Comment thread content/docs/reference/media/serving-media-safely.mdx Outdated
Comment thread content/docs/reference/media/serving-media-safely.mdx Outdated
Comment thread content/docs/reference/media/serving-media-safely.mdx Outdated
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
joshbermanssw
joshbermanssw previously approved these changes Oct 12, 2026

@joshbermanssw joshbermanssw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All four threads addressed, and you were right about the adapters (s3/dos/cloudinary/azure all got the check in the same fix), thanks for the correction. One optional wording nit inline. LGTM.

Comment thread content/docs/reference/media/serving-media-safely.mdx Outdated
Co-authored-by: Josh Berman [SSW] <137844305+joshbermanssw@users.noreply.github.com>

@joshbermanssw joshbermanssw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit applied, thanks.

@kulesy
kulesy enabled auto-merge (squash) October 12, 2026 00:17
@kulesy
kulesy merged commit 0f1b47d into main Oct 12, 2026
5 of 6 checks passed
@kulesy
kulesy deleted the docs/serving-uploaded-media-safely branch October 12, 2026 00:18

This branch was successfully deployed

1 active deployment
Preview — 00f606b6 Deployed Oct 12, 2026 by vercel[bot]
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.

2 participants