Netlify
Security FAQ

What are Netlify security best practices?

Get instant answers about your app's security.

Short Answer

Netlify security best practices are dictated by Netlify's actual risk profile, not a generic checklist. The top three: use netlify functions for runtime secrets; password-protect deploy previews in site settings; create _headers file with csp, x-frame-options, hsts.

Detailed Answer

The best practices specific to Netlify (not generic OWASP)

Every "security best practices" list tells you to use HTTPS and rotate keys. Those are table stakes. The list below is what actually matters for Netlify apps, based on the risks that appear in real Netlify deployments.

1. Use Netlify Functions for runtime secrets

*Why:* Build-time env vars get baked into static HTML, visible to anyone. *Do this:* Use Netlify Functions for runtime secrets. Never build-time for secrets.

2. Password-protect deploy previews in Site settings

*Why:* Preview deployments expose unreleased features publicly. *Do this:* Password-protect deploy previews in Site settings.

3. Create _headers file with CSP, X-Frame-Options, HSTS

*Why:* Security headers not configured by default. *Do this:* Create _headers file with CSP, X-Frame-Options, HSTS.

4. Enable Akismet or reCAPTCHA on all forms

*Why:* Netlify Forms are public endpoints vulnerable to spam. *Do this:* Enable Akismet or reCAPTCHA on all forms.

5. Add rate limiting

*Why:* 10s timeout (26s paid) can be exploited for resource exhaustion. *Do this:* Add rate limiting. Set appropriate timeout limits.

Netlify-specific: audit every table for RLS before every deploy

The failure mode in Netlify + Supabase apps is always the same: a table gets added during a feature push, RLS never gets turned on, the full table becomes queryable via the anon key. Bake a pre-deploy check: `select tablename from pg_tables where schemaname = 'public' and not rowsecurity` — the result must be empty.

Verification

Even perfect best practices don't prove themselves — the only way to confirm the list above is implemented is to scan a deployed Netlify app. VAS probes each of environment config, functions security, headers setup, form security by actually attempting the attack, not just reading headers or docs.

Security Research & Statistics

10.3%

of Lovable applications (170 out of 1,645) had exposed user data in the CVE-2025-48757 incident

Source: CVE-2025-48757 security advisory

4.45 million USD

average cost of a data breach in 2023

Source: IBM Cost of a Data Breach Report 2023

500,000+

developers using vibe coding platforms like Lovable, Bolt, and Replit

Source: Combined platform statistics 2024-2025

Expert Perspectives

Vibe coding your way to a production codebase is clearly risky. Most of the work we do as software engineers involves evolving existing systems, where the quality and understandability of the underlying code is crucial.

Simon WillisonSecurity Researcher, Django Co-creator

The problem with AI-generated code isn't that it doesn't work - it's that it works just well enough to ship, but contains subtle security flaws that are hard to spot.

Security Research CommunityCollective wisdom from security researchers

Check Your Netlify App's Security

VAS scans for all the security issues mentioned above. Get a comprehensive security report in minutes.

Get Starter Scan

More Questions About This Topic

What's the single most important Netlify security step?

Use Netlify Functions for runtime secrets. Never build-time for secrets. This closes build-time secret exposure, which is the #1 critical-impact finding in Netlify apps. Everything else is secondary — if this one gap exists, the rest doesn't matter.

Should I follow Netlify's docs or a third-party best-practices list?

Both, for different things. Netlify's docs tell you *how* to configure their specific features — that's authoritative. Third-party best practices (including this one) tell you *which* failure modes show up in real Netlify deployments — that's where Netlify's docs under-deliver, because Netlify doesn't advertise what its own users misconfigure. Use docs for syntax, external guidance for priority.

How often should I re-audit Netlify app security?

Before every production release, without exception. Netlify's AI-assisted workflow means database schemas, API endpoints, and auth logic can change in a single chat session — any of which can introduce an issue from the list above. Weekly automated scans for live Netlify apps are a reasonable baseline; post-feature scans are non-negotiable.