Skip to content

fix(blob): switch to private access with auth-gated delivery route#1483

Draft
vvo wants to merge 1 commit intomainfrom
blob-private-access
Draft

fix(blob): switch to private access with auth-gated delivery route#1483
vvo wants to merge 1 commit intomainfrom
blob-private-access

Conversation

@vvo
Copy link
Copy Markdown
Member

@vvo vvo commented Apr 13, 2026

Summary

User-uploaded images are auth-gated content that should not be publicly accessible. This switches from public to private blob storage and adds a delivery route that checks the user's session before serving files.

Changes:

  • Upload: access: "public" -> access: "private", returns /api/files/serve?pathname=... instead of raw blob URL
  • New /api/files/serve route: checks auth, streams private blob with ETag caching support
  • Removed *.public.blob.vercel-storage.com from next.config.ts image patterns
  • vercel-template.json: forces private access in 1-click deploy flow

No client changes needed — the upload response interface ({ url, pathname, contentType }) is preserved, and next/image works with same-origin URLs without remotePatterns.

Test deploy: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fchatbot%2Ftree%2Fblob-private-access

Context

Aligns with the private-by-default direction for Vercel Blob (see vercel/front#65379, vercel/vercel#15375). The CLI now defaults to private-first prompts and requires explicit --access flags.

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 13, 2026

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

Project Deployment Actions Updated (UTC)
ai-chatbot Ready Ready Preview, Comment Apr 16, 2026 3:44pm
chatbot Ready Ready Preview, Comment Apr 16, 2026 3:44pm

Request Review

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 14, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​vercel/​blob@​0.24.1 ⏵ 2.3.371 -110097 +196 +1100

View full report

User-uploaded images should not be publicly accessible. This switches
from public to private blob storage and adds a delivery route that
proxies files through the server.

Changes:
- Upload route: access 'public' -> 'private', addRandomSuffix, returns
  delivery route URL instead of raw blob URL
- New /api/files/serve route: proxies private blobs with ETag caching,
  Content-Disposition: inline for browser display
- next.config.ts: localPatterns for next/image, removed public blob domain
- proxy.ts: skip middleware auth for serve route (image optimizer can't
  forward cookies, pathname unguessability provides security)
- vercel-template.json: force private access in 1-click deploy
- Upgraded @vercel/blob to 2.3.3 for get() support
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.

1 participant