Fixes · Security holes
No security headers: Content-Security-Policy, HSTS and X-Frame-Options
Without security headers, other sites can frame your app to trick clicks and injected scripts run freely. Three lines of config close whole classes of attack.
What you see
A security scan or a customer's review flags missing headers, or your app can be shown inside someone else's page.
Why it happens
Browsers only enforce these protections when the server asks for them in response headers. AI tools and starter templates rarely add them, and hosts don't add most of them for you.
How to fix it
- Next.js: return the headers from
headers()innext.configfor every path (source: "/(.*)"). Vite and other static apps: set them invercel.json, a_headersfile on Cloudflare Pages, or your server. - Start with
Strict-Transport-Security: max-age=63072000; includeSubDomains,X-Frame-Options: DENY(orframe-ancestors 'none'in the policy),X-Content-Type-Options: nosniffandReferrer-Policy: strict-origin-when-cross-origin. - Add a
Content-Security-Policylast, listing the scripts, styles and connections your app really uses (your database, payments, analytics). Try it asContent-Security-Policy-Report-Onlyfirst, so nothing breaks while you tune it. - Check the result in your browser's developer tools (Network, the page's response headers).
Or ask your AI tool to fix it
Paste this into Lovable, Bolt, v0, Replit or Cursor, and let it make the change.
Add security headers to every response: Strict-Transport-Security, X-Frame-Options DENY, X-Content-Type-Options nosniff, Referrer-Policy strict-origin-when-cross-origin, and a Content-Security-Policy that allows only the scripts, styles, images and connections this app actually uses. Put them in the framework's headers config, not in individual pages.
Don't change what the app does.
Never put a secret key or password in the code: read it from an environment variable.
If a step has to be done outside the code, like revoking a key in a provider's dashboard, list it for me at the end instead of skipping it.How Launchpad helps
The launch check looks for these headers in your code and config. Launchpad doesn't set them on your app: they belong in your code, where the request above puts them.
Check your app for this, freeStart free