PQC Wire-Size Rollout Cliffs: 4KB Cookies, SQL VARCHAR(255) & HTTP 431 Headers
Severity: HIGH
Upgrading from 64-byte ECDSA P-256 signatures to FIPS 204 ML-DSA-65 (3,309-byte raw signature; ~4,412+ bytes Base64URL inside a JWT/session cookie) and FIPS 203 ML-KEM-768 (1,184-byte public key; 1,088-byte ciphertext) expands wire artifacts by 15x–50x. Free ciphermap preflight detects three silent production outages before rollout: browser RFC 6265 4,096-byte Set-Cookie drops (PQC-COOKIE-4K), SQL/Prisma/SQLAlchemy/GORM VARCHAR(255)/VARCHAR(512) column truncations on public_key/signature/jwt columns (PQC-SCHEMA-TRUNC), and NGINX large_client_header_buffers / Envoy max_request_headers_kb 4KB–8KB HTTP 431 Request Header Fields Too Large cliffs (PQC-HEADER-431).
Remediation checklist
- PQC-COOKIE-4K: store an opaque 32-byte session ID in the browser cookie backed by server-side Redis/DB state, or split/chunk session tokens below RFC 6265's 4,096-byte per-cookie ceiling before enabling ML-DSA-65.
- PQC-SCHEMA-TRUNC: widen SQL and ORM columns storing public keys, ciphertexts, certificates, or signed tokens from VARCHAR(255)/VARCHAR(512) to TEXT or BYTEA prior to dual-algorithm migration.
- PQC-HEADER-431: raise NGINX large_client_header_buffers (e.g., 4 32k), Envoy max_request_headers_kb (>= 32), and ALB/API-gateway header limits before deploying composite ML-DSA-65 Bearer JWTs or mTLS client-cert headers.
Illustrative Code Examples
These fragments explain migration direction. They are not complete applications or compiler-verified patches for your project.
Flagged by ciphermap preflight — classical-sized cookie, SQL column & NGINX buffer
-- schema.sql (PQC-SCHEMA-TRUNC) CREATE TABLE api_sessions ( jwt_signature VARCHAR(255) NOT NULL, kem_public_key VARCHAR(512) NOT NULL ); # nginx.conf (PQC-HEADER-431) large_client_header_buffers 4 8k;
PQC-safe — unbounded TEXT/BYTEA storage + 32KB ingress header buffers
-- schema.sql: accommodates 3,309B ML-DSA-65 & composite signatures CREATE TABLE api_sessions ( session_id CHAR(43) PRIMARY KEY, jwt_signature TEXT NOT NULL, kem_public_key BYTEA NOT NULL ); # nginx.conf: prevents HTTP 431 on composite PQC Authorization headers large_client_header_buffers 4 32k;
Scan your own repository for PQC-COOKIE-4K locally (0 code egress)
Preview proposed changes free with ciphermap fix . --dry-run --offline --no-telemetry. Eligibility depends on the installed build, call shape, module format, and migration context. The bundled RSA fixture has a classical key-size candidate; that does not make it post-quantum secure. Persisted digests and unsupported contexts may be declined. Applying supported candidates requires an entitlement, explicit verifier consent, and the required project tools. Review the actual verification result before adopting a change.
Other rule families
Quantum-Vulnerable Public Key (RSA / DSA / DH)
PQC-GO-AST-003Quantum-Vulnerable Elliptic Curves (ECC) & Pre-Standard PQC Drafts
PQC-GO-AST-001Deprecated & Broken Cryptographic Primitives
IMM-SQLI-001Dynamic SQL String Interpolation or Concatenation Across Polyglot Drivers
IMM-PATH-001Unjailed Filesystem Path Traversal or Symlink Escape Across Polyglot I/O
IMM-CMD-001Dynamic Shell Command Execution Across Polyglot Process APIs
IMM-BOUND-001Unbounded Stream or Payload Allocation Across Polyglot Boundaries
IMM-DESER-001Unsafe Polymorphic Deserialization or Permissive Boundary Decoding
IMM-AUTH-001Unauthenticated or Unguarded State-Mutating Boundary Endpoint
IMM-TIMING-001Non-Constant-Time Secret, HMAC, or Webhook Signature Comparison
IMM-JWT-001Unverified JWT Signature Decoding Before Claims Trust
IMM-SSRF-001Unvalidated Server-Side Request Forgery (SSRF) & Cloud IMDS Exposure
IMM-AICFG-001AI Coding Agent Instruction & MCP Configuration Poisoning
IMM-CSPRNG-001Weak Non-Cryptographic PRNG in Security Token, OTP, or Secret Generation
IMM-REDIR-001Unvalidated Open Redirect from Raw HTTP Parameter
PQC-FED-001NSA CNSA 2.0 Category-5 Floor, PIV/CAC & Firmware Signatures
PQC-BANK-002Banking TR-31/TR-34 Key Blocks, Mainframe ICSF & Open Banking FAPI 2.0
PQC-IAM-001Identity (OIDC / SAML / FIDO2 WebAuthn) & Cloud KMS Envelope Keys
PQC-OT-001OT/ICS OPC UA, IEC 62443 Secure Boot & Healthcare DICOM/HL7 FHIR