Description
Remove debugger statements and temporary request logging before deployment.
Potential impact
Logs or console output may expose personal or authentication data. A debugger statement can also pause processing when an active debugger is attached.
Remediation
Use structured logs for the events and fields you still need. Redact sensitive values and limit log access and retention.
Examples
Before
javascript
app.get("/profile", (req, res) => {
console.log("profile request", req.body);
res.end();
});
After
javascript
app.get("/profile", (req, res) => {
auditLogger.info({ userId: req.session.user.id }, "profile viewed");
res.end();
});
The revised handler assumes an authenticated session and an auditLogger. It records a profile-view event and userId. That identifier may itself be personal data.