You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(privacy): avoid logging raw email payloads, BCC recipients, and unredacted PII in smtp-server and web logs (CWE-532) #533
While auditing log hygiene across useSend, I noticed a few places where full email bodies, attachments, BCC lists, and plaintext recipient email addresses are written directly to production logs without redaction (CWE-532 / GDPR Art. 5(1)(c) data minimization):
1. Full raw email payload & attachments dumped on SMTP relay errors (apps/smtp-server)
apps/smtp-server/src/server.ts:41-45: When the useSend API returns any non-2xx response (e.g. 400, 429 rate limit, or 500), console.error prints the full serialized emailDataText JSON:
console.error("useSend API error response: error:",JSON.stringify(errorData,null,4),`\nemail data: ${emailDataText}`,);
emailDataText contains from, to, cc, bcc, subject, full text/html bodies (including transactional OTPs, password-reset links, or sensitive customer messages), and base64-encoded attachments.
apps/smtp-server/src/server.ts:123: Every successful SMTP relay logs plaintext recipient addresses:
.then(()=>console.log("Email sent successfully to: ",emailObject.to))
apps/web/src/server/logger/log.ts:11-23: rootLogger initializes pino(...) without a redact configuration, while several production services log raw recipient addresses and BCC lists:
apps/web/src/server/service/campaign-service.ts:1312-1319, 1363-1384 — logs contactEmail, originalCc, filteredCc, originalBcc, and filteredBcc
apps/web/src/server/service/contact-queue-service.ts:106-120 — logs contactEmail: contact.email on every queued contact job (processing, success, and failure)
apps/smtp-server/src/server.ts: Log only non-PII diagnostic metadata (HTTP status, recipient count, attachment count) instead of emailDataText and emailObject.to.
apps/web/src/app/login/login-page.tsx: Remove the leftover console.log("email", email).
apps/web/src/server/logger/log.ts & affected services: Either configure Pino redact paths for PII/recipient fields (email, contactEmail, originalBcc, filteredBcc, originalCc, filteredCc, suppressedEmails, etc.) and/or replace raw address arrays with counts and IDs (campaignId, teamId, suppressedCount).
If you'd like this addressed and can confirm whether you prefer central Pino redact, logging counts/IDs instead of email arrays, or both, I'd be happy to open a clean PR with tests.
Activity