Why this matters
Keeping PAN out of your environment reduces PCI scope and breach impact.
For web/mobile payment forms, send PAN and CVV directly to the PCI-compliant gateway to obtain a single-use token; submit only the token to your backend. Validate that backend APIs reject requests containing PAN/SAD. (PCI DSS scoping & SAQ A)
Keeping PAN out of your environment reduces PCI scope and breach impact.
Side-by-side examples engineers can pattern-match during review.
// ❌ raw PAN sent to backend
await fetch('/api/pay', { method:'POST', body: JSON.stringify({ pan, cvv }) });// ✅ tokenize in client; backend sees token only
const token = await gateway.tokenize({ pan, cvv });
await fetch('/api/pay', { method:'POST', body: JSON.stringify({ token }) });formData.append('pan', cardNumber)const token = await gateway.tokenize({pan, cvv}); formData.append('token', token)From the same buckets as this rule.
Never emit Primary Account Number (PAN) or Sensitive Authentication Data (SAD: CVV/CVC, full track data, PIN) to application or audit logs. Per PCI DSS 4.0 Req. 3 and 10, always mask PAN as first6last4 and fully redact SAD before logging.
Reject PRs adding real PAN/CVV in fixtures, seeds, or mocks. Only use Luhn-valid test PANs from the gateway or opaque tokens (e.g., tok_) and never include CVV. Add a check to fail if a PAN regex is matched. (PCI DSS data minimization)