Public-accessible subnetworks separated from internal networks
Why it matters
CMMC 2.0 SC.L1-3.13.5 (NIST 800-171r2 3.13.5) requires separation between publicly accessible subnetworks and internal networks. In application terms, this means public-facing routes and protected internal routes must be architecturally separated — not mixed under the same middleware or path structure with inconsistent access controls. OWASP A01 and CWE-284 (Improper Access Control) describe the failure mode: when admin and public endpoints share the same routing layer with no access boundary, a path traversal or misconfigured matcher exposes privileged functionality to public access.
Severity rationale
High because routing architecture that mixes public and protected paths creates a structural bypass risk — a single middleware misconfiguration exposes all internal routes simultaneously.
Remediation
Use Next.js route groups to create a hard architectural boundary between public, protected, and admin routes. Apply middleware targeting each group explicitly rather than relying on path string matching alone:
src/app/
├── (public)/ # No auth — landing, login, about
├── (protected)/ # Auth required — dashboard, documents
└── (admin)/ # Auth + admin role required
// middleware.ts
export function middleware(request: NextRequest) {
const { pathname } = request.nextUrl
const session = request.cookies.get('session')
if (pathname.startsWith('/dashboard') || pathname.startsWith('/documents')) {
if (!session) return NextResponse.redirect(new URL('/login', request.url))
}
if (pathname.startsWith('/admin') || pathname.startsWith('/api/admin')) {
if (!session) return NextResponse.redirect(new URL('/login', request.url))
// Each admin handler must also verify role server-side
}
return NextResponse.next()
}
Verify the middleware matcher pattern does not exclude /api/* paths — that is the most common source of bypass gaps in Next.js applications.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the CMMC Level 1 Readiness Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cmmc:2.0 · SC.L1-3.13.5 — Public-Access System Separation
- cwe · CWE-284 — Improper Access Control
- owasp:2021 · A01 — Broken Access Control
- nist:rev2 · SP-800-171 3.13.5 — Implement subnetworks for publicly accessible system components
Taxons
History
- 2026-04-18·v1.0.0·Initial import from gov-cmmc-level-1·automated