rails-version-scoped-v1
15 rules · Keryn Software Licence · rules 0.8.0 · all packs
How to read a rule
- Severity
- How bad the finding is if it is real:
errorfails a default gate,warningandinfodo not. - Confidence
- P0 exploitable as written; P1 dangerous in context; P2 a heuristic or a posture check: confirm by reading the code.
- False-positive risk
- low: an exact API or flag, so hits are almost always real; medium: the pattern is legitimate in many programs, so check each hit; high: it finds a lead to confirm, so expect benign hits.
- Edge
- The relationship the finding sits on. reaches: content or traffic gets to a thing; calls: one thing invokes another; reads: one thing reads from another; writes: one thing writes to another; sends: data leaves for another party; grants: authority is given or left unchecked; depends_on: something relies on a component it does not verify; trusts: one party believes another without evidence. The boundary it crosses, when there is one: user->prompt (untrusted input reaching a prompt); model->code (model output reaching code, a shell, a query or a page); secret->outside (a secret leaving the trusted side); supply-chain (code, models or prompts pulled in from outside).
- Taxonomy chips
- References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.
keryn.rails.legacy.erb-output-unescaped-rails2
Section titled “keryn.rails.legacy.erb-output-unescaped-rails2”warning generic ruby, rails, erb
An ERB template in a Rails 2 application (without the rails_xss plugin) prints a request value, an instance variable or a record attribute with <%= %>. Rails 2 does not escape <%= %> output, so any markup in the value is rendered and script in it runs in the visitor’s browser. Wrap the value in h(), or upgrade to Rails 3 or later (or install rails_xss), where output is escaped by default.
Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Escape the value with h() (or upgrade to Rails 3+, which escapes <%= %> output); render markup only through sanitize with an explicit tag list.
References: https://guides.rubyonrails.org/security.html#cross-site-scripting-xss · https://api.rubyonrails.org/v2.3/classes/ERB/Util.html
keryn.rails.legacy.haml-output-unescaped-rails2
Section titled “keryn.rails.legacy.haml-output-unescaped-rails2”warning generic ruby, rails, haml
A Haml template in a Rails 2 application (without the rails_xss plugin) prints a request value, an instance variable or a record attribute with =. Haml under Rails 2 does not escape that output by default, so markup in the value runs as script. Use &= or h(), turn on Haml’s escape_html option, or upgrade Rails.
Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Escape with &= or h(), or enable Haml escape_html; upgrading Rails turns escaping on by default.
References: https://guides.rubyonrails.org/security.html#cross-site-scripting-xss
keryn.rails.legacy.link-to-text-unescaped-rails2
Section titled “keryn.rails.legacy.link-to-text-unescaped-rails2”warning generic ruby, rails, erb, haml
link_to in a Rails 2 application (without rails_xss) takes its link text from a request value or a record attribute. Rails 2 does not escape the link text, so markup in it is rendered and script runs. Wrap the text in h().
Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Wrap the link text in h(), or upgrade to Rails 3+, where link_to escapes its text.
References: https://guides.rubyonrails.org/security.html#cross-site-scripting-xss
keryn.rails.legacy.content-tag-content-unescaped-rails2
Section titled “keryn.rails.legacy.content-tag-content-unescaped-rails2”warning generic ruby, rails, erb, haml
content_tag in a Rails 2 application (without rails_xss) wraps a request value or a record attribute as the element content. Rails 2 does not escape content_tag content, so markup in the value is rendered. Wrap the content in h().
Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Wrap the content in h(), or upgrade to Rails 3+, where content_tag escapes its content.
References: https://guides.rubyonrails.org/security.html#cross-site-scripting-xss
keryn.rails.cve.content-tag-attribute-value-cve-2016-6316
Section titled “keryn.rails.cve.content-tag-attribute-value-cve-2016-6316”warning generic ruby, rails, erb, haml
content_tag builds an attribute value from a request value on a Rails version affected by CVE-2016-6316: the tag helpers did not escape double quotes in attribute values, so the value can close the attribute and add an event handler. Upgrade Rails (3.2.22.4, 4.2.7.1, 5.0.0.1 or later).
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2016-6316
keryn.rails.cve.select-options-string-cve-2012-1099
Section titled “keryn.rails.cve.select-options-string-cve-2012-1099”warning generic ruby, rails, erb, haml
The select helper receives its options as a string built with interpolation from a request value or a record on a Rails version affected by CVE-2012-1099: the string is inserted as markup, unescaped. Build the options with options_for_select (which escapes) or upgrade Rails (3.0.12, 3.1.4, 3.2.2 or later).
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2012-1099
keryn.rails.cve.select-tag-prompt-cve-2012-3463
Section titled “keryn.rails.cve.select-tag-prompt-cve-2012-3463”warning generic ruby, rails, erb, haml
select_tag takes its prompt option from a request value on a Rails version affected by CVE-2012-3463: the prompt is inserted without escaping. Escape it with h() or upgrade Rails (3.0.17, 3.1.8, 3.2.8 or later).
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2012-3463
keryn.rails.cve.number-helper-format-cve-2014-0081
Section titled “keryn.rails.cve.number-helper-format-cve-2014-0081”warning generic ruby, rails, erb, haml
A number helper (number_to_currency, number_to_percentage, number_to_human) takes a formatting option (unit, format, separator) from a request value or a record on a Rails version affected by CVE-2014-0081: the options are not escaped. Use fixed options or upgrade Rails (3.2.17, 4.0.3 or later).
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2014-0081
keryn.rails.cve.simple-format-cve-2013-6416
Section titled “keryn.rails.cve.simple-format-cve-2013-6416”warning generic ruby, rails, erb, haml
simple_format receives a request value or a record attribute on Rails 4.0.0 or 4.0.1, affected by CVE-2013-6416: the wrapper tag’s html_options are not escaped. Upgrade to Rails 4.0.2 or later.
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2013-6416
keryn.rails.cve.mail-to-javascript-encode-cve-2011-0446
Section titled “keryn.rails.cve.mail-to-javascript-encode-cve-2011-0446”warning generic ruby, rails, erb, haml
mail_to with :encode => :javascript on a Rails version affected by CVE-2011-0446 does not escape the name and address it encodes. Upgrade Rails (2.3.11, 3.0.4 or later).
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2011-0446
keryn.rails.cve.sanitize-in-view-cve-2013-1857
Section titled “keryn.rails.cve.sanitize-in-view-cve-2013-1857”warning generic ruby, rails, erb, haml
sanitize or sanitize_css is called on a Rails version affected by CVE-2013-1857 / CVE-2013-1855: the sanitizers let some javascript: URLs and CSS expressions through, so their output is not safe to render. Upgrade Rails (2.3.18, 3.1.12, 3.2.13 or later).
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2013-1857 · https://nvd.nist.gov/vuln/detail/cve-2013-1855
keryn.rails.cve.sanitizer-select-style-cve-2022-32209
Section titled “keryn.rails.cve.sanitizer-select-style-cve-2022-32209”warning generic ruby, rails, erb, haml
A sanitizer allows both the select and style tags with rails-html-sanitizer before 1.4.3 (CVE-2022-32209): that combination lets script through the sanitizer. Remove one of the two tags or upgrade rails-html-sanitizer.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2022-32209
keryn.rails.cve.raw-sanitized-request-old-sanitizer
Section titled “keryn.rails.cve.raw-sanitized-request-old-sanitizer”warning generic ruby, rails, erb, haml
A view prints sanitize(request value) without escaping (raw, html_safe or <%== %>) with rails-html-sanitizer before 1.0.4, whose sanitizer let some markup through (CVE-2015-7578, CVE-2015-7580, CVE-2018-3741). The sanitized value is trusted as HTML, so a crafted parameter still runs script. Upgrade rails-html-sanitizer.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2018-3741
keryn.rails.deps.i18n-xss-cve-2013-4491
Section titled “keryn.rails.deps.i18n-xss-cve-2013-4491”warning generic ruby, rails, bundler
The i18n gem is locked at a version affected by CVE-2013-4491 (XSS in the translation-missing message) and the Rails version uses it unescaped. Upgrade i18n (0.5.1 for Rails 3.0/3.1, 0.6.6 for Rails 3.2/4.0) or Rails.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2013-4491
keryn.rails.deps.pg-sqli-cve-2014-0080
Section titled “keryn.rails.deps.pg-sqli-cve-2014-0080”warning generic ruby, rails, bundler
The PostgreSQL adapter (pg) is used with Rails 4.0.0 to 4.0.2, affected by CVE-2014-0080: PostgreSQL array columns were quoted incorrectly, allowing SQL injection through array values. Upgrade to Rails 4.0.3 or later.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Upgrade Rails (or the named gem) to the fixed release in the message; until then avoid passing request values or record attributes to this call.
References: https://nvd.nist.gov/vuln/detail/cve-2014-0080