Highlights
Auth Bypass: 3 prior fixes. Scrutinize any change in this area.
lib/cancan/can_definition.rb: most-fixed (1 issue). Treat as high-risk during review.
4 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: A LocalJumpError triggered by using `return` inside an `after_filter` block could bypass the `check_authorization` enforcement, leaving endpoints completely unprotected if the block exited prematurely. Developers must use block-scoped flow control like `next` instead of `return` in controller hooks.
Auth Bypass: In development environments where classes are reloaded, standard Ruby `kind_of?` checks fail on newly instantiated classes. This causes rules to miss matches, resulting in unintended authorization bypasses unless class-name string comparisons are used as a fallback.
SQL Injection: Directly passing uncasted request parameters to ActiveRecord model finders can lead to SQL injection or unexpected scope manipulation. Resource loaders must canonicalize and cast ID parameters to string/integer types before invoking finders.