rules:
- id: avoid-raw
  metadata:
    owasp: 'A7: Cross-Site Scripting (XSS)'
    cwe: "CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"
    references:
    - https://api.rubyonrails.org/classes/ActionView/Helpers/OutputSafetyHelper.html#method-i-raw
    - https://www.netsparker.com/blog/web-security/preventing-xss-ruby-on-rails-web-applications/
    category: security
    technology:
    - rails
  message: >-
    'raw()' bypasses HTML escaping. If external data can reach here, this exposes your application
    to cross-site scripting (XSS) attacks. If you must do this, construct individual strings
    and mark them as safe for HTML rendering with `html_safe()`.
  languages: [ruby]
  severity: WARNING
  pattern: raw(...)
