Skip to content
ShipSecurelySecurity reference
Menu

13 tools · 88 fixes · 22 incidents tracked · Updated Oct 13, 2026 · Sources: Supabase, GitHub, OWASP, Stripe + 9

Next.js

Unsafe file uploads in Next.js

highUpdated Oct 12, 2026

Limit size before you buffer the whole file. Allow a short list of types you actually need (for example PNG, JPEG, WebP).

Fix for Next.js

Limit size before you buffer the whole file. Allow a short list of types you actually need (for example PNG, JPEG, WebP). Detect type from the bytes if you can, and still do not trust the extension alone.

Store a generated name (userId/random-id), never the raw filename. Serve user files from a different host when you can, or with Content-Disposition: attachment and X-Content-Type-Options: nosniff. Do not serve user SVG or HTML as an image preview on your origin.

The five-minute check, the other platforms, and the agent prompt are on the full guide. More Next.js fixes are on the Next.js page.