Error & Logging Best Practices
Sensitive data in console.log, stack traces exposed to users, React error boundaries, security logging, and PII in logs.
5 vulnerabilities
Console.log of Sensitive Data
mediumLogging passwords, tokens, full user objects, or payment data to the console sends that data to your log aggregator in plaintext.
Stack Traces Exposed to User
mediumReturning stack traces or internal error details in API responses reveals your file structure, library versions, and code paths to attackers.
No React Error Boundary
lowWithout error boundaries, a JavaScript error in any component crashes the entire React tree and shows a blank screen to the user.
Insufficient Security Logging
lowNot logging security events (failed logins, permission denials, suspicious actions) means you can't detect attacks in progress or reconstruct what happened after a breach.
PII in Logs
mediumLogging personally identifiable information (email, full name, IP address, phone number) creates privacy and compliance risks under GDPR and CCPA.