CSRF Protection Disabled
Rails CSRF protection is skipped/weakened (skip_before_action :verify_authenticity_token, skip_forgery_protection, or protect_from_forgery except:), exposing state-changing actions to CSRF (CWE-352).
Standards mapping
- OWASP Top 10
- A01:2021 - Broken Access Control
- OWASP ASVS
- V4.2.2 (L1)
Vulnerable vs. safe
skip_before_action :verify_authenticity_tokenprotect_from_forgery with: :exceptionWhy it matters & how to fix it
Rails CSRF protection is skipped/weakened (skip_before_action :verify_authenticity_token, skip_forgery_protection, or protect_from_forgery except:), exposing state-changing actions to CSRF (CWE-352). Keep protect_from_forgery active for all HTML form actions; for APIs use token/JWT auth rather than disabling the check.
References
Rule ID integsec-ruby-csrf-protection-disabled - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Other Security ChecksChild Process Shell True
- JavaScript / TypeScript - Other Security ChecksOpen Redirect Tainted Input
- Python - Other Security ChecksDjango Mark Safe
- Python - Other Security ChecksFlask Debug Enabled
- Python - Other Security ChecksFlask Render Template String
- Python - Other Security ChecksInsecure Tempfile Mktemp