# rails-version-scoped-v1

> rails-version-scoped-v1: 15 Keryn rules for generic (15 warning).

Source: https://keryn.dev/rules/rails-version-scoped-v1/

15 rules · Keryn Software Licence · rules 0.8.0 · [all packs](https://keryn.dev/rules/)

**How to read a rule**

- **Severity**: How bad the finding is if it is real: `error` fails a default gate, `warning` and `info` do 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

`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 &lt;%= %&gt;. Rails 2 does not escape &lt;%= %&gt; 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**Fix:** Escape the value with h() (or upgrade to Rails 3+, which escapes &lt;%= %&gt; output); render markup only through sanitize with an explicit tag list.

**References:** [https://guides.rubyonrails.org/security.html#cross-site-scripting-xss](https://guides.rubyonrails.org/security.html#cross-site-scripting-xss) · [https://api.rubyonrails.org/v2.3/classes/ERB/Util.html](https://api.rubyonrails.org/v2.3/classes/ERB/Util.html)

## 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 &amp;= 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**Fix:** Escape with &amp;= 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](https://guides.rubyonrails.org/security.html#cross-site-scripting-xss)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://guides.rubyonrails.org/security.html#cross-site-scripting-xss)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://guides.rubyonrails.org/security.html#cross-site-scripting-xss)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2016-6316)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2012-1099)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2012-3463)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2014-0081)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2013-6416)

## keryn.rails.cve.mail-to-javascript-encode-cve-2011-0446

`warning` generic ruby, rails, erb, haml

mail\_to with :encode =&gt; :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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2011-0446)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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-1857) · [https://nvd.nist.gov/vuln/detail/cve-2013-1855](https://nvd.nist.gov/vuln/detail/cve-2013-1855)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2022-32209)

## 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 &lt;%== %&gt;) 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM05](https://keryn.dev/taxonomies/owasp-llm/#llm05-improper-output-handling)

**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](https://nvd.nist.gov/vuln/detail/cve-2018-3741)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-79](https://keryn.dev/taxonomies/cwe/#cwe-79-cross-site-scripting) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain)

**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](https://nvd.nist.gov/vuln/detail/cve-2013-4491)

## 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-89](https://keryn.dev/taxonomies/cwe/#cwe-89-sql-injection) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain)

**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](https://nvd.nist.gov/vuln/detail/cve-2014-0080)
