🌐

Netlify Security Guide

Web development platform for modern sites

low risk level

Netlify handles static site hosting, serverless functions, and form handling. Security risks include exposed serverless function endpoints, insecure form handling, and misconfigured redirect rules that can be exploited.

Common Vulnerabilities

high

Exposed serverless function endpoints

Netlify Functions at /.netlify/functions/* are publicly accessible by default.

Add authentication checks inside every function. Never rely on obscurity.

medium

Form spoofing via Netlify Forms

Netlify's built-in form handling can be abused for spam if not protected.

Add honeypot fields and enable reCAPTCHA on Netlify Forms.

medium

Open redirect via _redirects

Misconfigured redirect rules can enable open redirect attacks.

Validate redirect destinations. Avoid wildcard redirects to external domains.

medium

Missing Content Security Policy

Default Netlify deployments don't include CSP headers.

Add security headers via netlify.toml or _headers file.

high

Build logs exposing secrets

Build commands that echo environment variables can leak secrets in public build logs.

Never echo secrets in build scripts. Mark sensitive logs as restricted.

Pre-Launch Security Checklist

Add authentication to all serverless functionsRequired
Enable honeypot and CAPTCHA on Netlify Forms
Review _redirects for open redirect vulnerabilities
Add security headers via _headers or netlify.toml
Check build logs don't expose environment variablesRequired
Use environment variable scoping (production vs deploy preview)
Enable branch protection for production deploys
Verify no source maps are deployed to productionRequired
Review connected Git repository permissions
Test all form submissions for injection attacks

Security Tips

1.

Use Netlify's environment variable scoping to prevent staging secrets from leaking to production.

2.

Always authenticate inside your serverless functions — URL obscurity is not security.

3.

Add a _headers file to your site root for easy security header configuration.

Scan your Netlify app now

Erzo automatically detects these vulnerabilities and gives you actionable fixes.

    Erzo — AI Code Security Scanner | Error Zero