All sensitive financial data encrypted at rest using AES-256+
Why it matters
Unencrypted financial data at rest — account numbers, SSNs, card tokens, transaction history — is a direct path from database breach to identity theft and fraud. CWE-311 (missing encryption) and CWE-326 (inadequate key length) are both in play when a project stores plaintext or uses AES-128: attackers who exfiltrate the database file get immediately usable cardholder data. NIST SP 800-111 and PCI-DSS 4.0 Req-3.5 require AES-256 or stronger because shorter keys are vulnerable to brute-force as compute costs fall. A single exposed plaintext column is enough to trigger breach notification obligations and PCI fines.
Severity rationale
Critical because a single unencrypted sensitive column converts a database read vulnerability into direct cardholder data exposure with no further attacker effort required.
Remediation
Switch to AES-256-GCM for all sensitive fields in src/lib/encryption.ts or src/utils/crypto.ts. Prefer authenticated encryption (GCM mode) over CBC to also detect tampering. Use the Node.js built-in crypto module — do not add a third-party wrapper for this:
import crypto from 'node:crypto';
const ALGO = 'aes-256-gcm';
export function encryptField(plaintext: string, key: Buffer): string {
const iv = crypto.randomBytes(12);
const cipher = crypto.createCipheriv(ALGO, key, iv);
const encrypted = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
const tag = cipher.getAuthTag();
return [iv.toString('hex'), tag.toString('hex'), encrypted.toString('hex')].join(':');
}
For database-level coverage, enable TDE on your provider (AWS RDS, Supabase) — that covers all columns, including ones you haven't explicitly wrapped. Both approaches together satisfy NIST SC-28 and PCI-DSS 4.0 Req-3.5.
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 Financial Data Encryption Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-311 — Missing Encryption of Sensitive Data
- cwe · CWE-326 — Inadequate Encryption Strength
- owasp:2021 · A02 — Cryptographic Failures
- nist:rev5 · SC-28 — Protection of Information at Rest
- pci-dss:4.0 · Req 3.5 — Primary Account Number protected with strong cryptography
- nist:final · SP-800-111 — Guide to Storage Encryption Technologies for End User Devices
Taxons
History
- 2026-04-18·v1.0.0·Initial import from finserv-encryption·automated