Next.js Compliance Scanner: OWASP Headers, Consent Mode v2 & WCAG 2.2
Catch X-Powered-By: Next.js leaks, missing CSP/COOP headers, unlabeled client components, and unblocked next/script analytics in 10 seconds.
Top 4 Compliance Gaps on Next.js Sites
Default Next.js exposes X-Powered-By: Next.js and omits CSP, HSTS, Permissions-Policy, and COOP.
Fix: Set poweredByHeader: false and export async headers() in next.config.ts.
GoogleAnalytics or ThirdParty scripts fire without gtag("consent", "default", ...) initialized first.
Fix: Initialize Consent Mode v2 denied defaults before loading GTM/GA4.
Icon-only Lucide buttons lack aria-label and modals/inputs omit explicit labels or skip links.
Fix: Add skip-to-content link in RootLayout and ensure every icon button has aria-label.
Transactional Resend/Postmark emails lack strict DMARC p=reject or MTA-STS.
Fix: Publish DKIM selectors, DMARC p=reject, and MTA-STS policy.
Next.js Launch Checklist
- Set poweredByHeader: false in next.config.ts
- Configure all 7 OWASP headers including CSP and Cross-Origin-Opener-Policy
- Add a keyboard skip link and <main id="main-content"> in app/layout.tsx
- Gate GA4 / PostHog / Meta Pixel behind Consent Mode v2 / CMP state
- Publish /.well-known/security.txt in public/
- Monitor production TLS and weekly regressions after every Vercel deploy
next.config.ts — Production OWASP Security Headers
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
poweredByHeader: false,
async headers() {
return [
{
source: '/(.*)',
headers: [
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
],
},
];
},
};
export default nextConfig;Frequently Asked Questions
Does ComplyPulse output copy-paste Next.js configs?
Yes. Every audit report and our free Security Headers Builder generate exact next.config.ts TypeScript snippets ready to paste.
Why does Cross-Origin-Opener-Policy matter for Next.js SaaS?
COOP (same-origin) isolates your browsing context against Spectre-style cross-origin leaks and is routinely checked in enterprise vendor security reviews.