Description
While Rails provides CSRF protection by default for web requests, we should explicitly verify and document CSRF token handling for API endpoints.
Current Implementation
- Rails default CSRF protection enabled for web requests
- API endpoints may bypass CSRF for token-based auth
- Not explicitly visible in ApplicationController
Proposed Changes
- Add explicit
protect_from_forgery with: :exception to ApplicationController
- Document CSRF token handling for API endpoints
- Add tests to verify CSRF protection is active
Acceptance Criteria
References
- Rails Security Guide on CSRF
- NIST SP 800-53 SC-23
Description
While Rails provides CSRF protection by default for web requests, we should explicitly verify and document CSRF token handling for API endpoints.
Current Implementation
Proposed Changes
protect_from_forgery with: :exceptionto ApplicationControllerAcceptance Criteria
References