Highlights
CSRF: 7 prior fixes. Scrutinize any change in this area.
app.js: most-fixed (8 issues). Treat as high-risk during review.
13 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns
The bug types that recur here, drawn from past fixes, not open vulnerabilities.
NoSQL Injection: Unsafe dynamic query evaluation via $where in MongoDB callbacks allows attackers to inject logical operations and bypass authentication criteria entirely during external OAuth resolution. This was fixed by replacing dynamic conditions with static Mongoose property queries.
Cross-Site Request Forgery (CSRF): The application repeatedly failed to protect state-changing endpoints because variable naming mismatches (using 'token' instead of '_csrf') caused templates to render undefined or incorrect tokens, disabling validation. Certain routes (such as file uploads) also bypassed the global CSRF middleware.
Auth Bypass: A default empty-string value for the resetPasswordToken schema field allowed unauthenticated attackers to bypass password-reset controls because an empty token parameter successfully matched the default database record value.