Highlights
Auth Bypass: 15 prior fixes. Scrutinize any change in this area.
backend/middleware/jwt.go: most-fixed (3 issues). Treat as high-risk during review.
15 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.
Auth Bypass: Inconsistent extraction of parameters (using 'kb_id' versus 'id' depending on the path context) allowed clients to completely bypass token permission checks for knowledge bases. Ensure all route authorization filters reference a single, validated source of truth for resource identifiers.
Auth Bypass: Sensitive admin and knowledge base operation routes were registered without explicit authorization middleware, allowing direct API-based bypass. Enforcing role checks globally at the route-definition level prevents unauthenticated access to backend functions.
Cross-Site Scripting (XSS): Rendering of user-controlled Markdown (both code blocks and image attributes starting with 'on') failed to properly escape HTML and filter attributes, leading to execution of arbitrary code in users' sessions.