# Data encrypted in transit (TLS 1.2+)

- **Pattern:** `ab-001565` (`gov-cmmc-level-1.system-comms.data-in-transit`)
- **Severity:** high
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-001565
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-001565)

## Why it matters

CMMC 2.0 SC.L1-3.13.8 (NIST 800-171r2 3.13.8) requires that FCI be encrypted during transmission. Any HTTP connection — even for a redirect — transmits cookies, session tokens, and form data in cleartext readable by network observers on shared Wi-Fi, corporate proxies, or compromised routers. The absence of HSTS means browsers will accept HTTP connections rather than insisting on HTTPS, allowing SSL stripping attacks. CWE-319 (Cleartext Transmission of Sensitive Information) and OWASP A02 (Cryptographic Failures) both apply. CMMC assessors treat missing HSTS as a direct compliance gap for SC.L1-3.13.8.

## Severity rationale

High because HTTP transmission of FCI exposes session tokens and contract data to any network-layer observer without requiring any server-side compromise.

## Remediation

Configure HSTS with a two-year `max-age` and `includeSubDomains` in `next.config.ts`. The header must be served on every response — not just the login page:

```ts
// next.config.ts
const nextConfig = {
  async headers() {
    return [{
      source: '/:path*',
      headers: [{
        key: 'Strict-Transport-Security',
        value: 'max-age=63072000; includeSubDomains; preload',
      }],
    }]
  },
}
export default nextConfig
```

Replace all hardcoded `http://` URLs in production code with `https://` equivalents or environment variables:

```ts
// Use an env var — guarantees correct protocol per environment
const API_URL = process.env.NEXT_PUBLIC_API_URL ?? 'https://api.example.com'
```

On non-Vercel hosts, add a server-level redirect from port 80 to 443 and configure `ssl_protocols TLSv1.2 TLSv1.3` in your nginx or Apache config. Vercel enforces HTTPS automatically; the HSTS header is still required for browser-level enforcement.

## Detection

**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](https://auditbuffet.com/audits/gov-cmmc-level-1). The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.

## External references

- cmmc SC.L1-3.13.1
- cmmc SC.L1-3.13.8
- cwe CWE-319
- owasp A02
- nist SP-800-171 3.13.8

Taxons: cryptography-and-secrets, regulatory-conformance

HTML version: https://auditbuffet.com/patterns/ab-001565
