rails-version-scoped-ruby-v1
8 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.cve.sanitize-call-cve-2013-1857
Section titled “keryn.rails.cve.sanitize-call-cve-2013-1857”warning ruby ruby, rails
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.legacy.model-without-attr-accessible
Section titled “keryn.rails.legacy.model-without-attr-accessible”warning ruby ruby, rails
A concrete Active Record model using version 3.0 or older declares neither attr_accessible nor attr_protected. Every attribute is mass-assignable by default, so Model.new(params[:model]) lets a visitor set any column (admin flags, owner ids). Declare attr_accessible with the attributes forms may set, or enable whitelist_attributes.
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: grants authority is given or left unchecked.
Fix: Add attr_accessible with the attributes forms may set (or config.active_record.whitelist_attributes = true), then move to strong parameters.
References: https://guides.rubyonrails.org/v3.2/security.html#mass-assignment
keryn.rails.legacy.model-attr-protected
Section titled “keryn.rails.legacy.model-attr-protected”warning ruby ruby, rails
An Active Record model using version 3.0 or older restricts mass assignment with attr_protected (a deny list). Attributes added later are assignable, and attr_protected could be bypassed on these versions (CVE-2013-0276). Use attr_accessible (an allow list) or upgrade Active Record and use strong parameters.
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: grants authority is given or left unchecked.
Fix: Replace attr_protected with attr_accessible, then move to strong parameters.
References: https://nvd.nist.gov/vuln/detail/cve-2013-0276
keryn.rails.cve.model-serialize-cve-2013-0277
Section titled “keryn.rails.cve.model-serialize-cve-2013-0277”warning ruby ruby, rails
A model serializes an attribute (serialize) on an Active Record version affected by CVE-2013-0277: a serialized column that a visitor can set through mass assignment is decoded as YAML, which can instantiate arbitrary objects. Upgrade Active Record (2.3.17, 3.1 or later) and keep serialized columns out of mass assignment.
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.
Fix: Upgrade Active Record (or Rails when using the full framework) 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-0277
keryn.rails.legacy.controller-without-forgery-protection
Section titled “keryn.rails.legacy.controller-without-forgery-protection”warning ruby ruby, rails
A controller that inherits from ActionController::Base never calls protect_from_forgery, on a Rails version (before 5.2) where forgery protection is off unless a controller turns it on. Every state-changing action it and its subclasses serve accepts cross-site requests. Call protect_from_forgery with: :exception.
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.
Fix: Call protect_from_forgery with: :exception in the base controller (or config.load_defaults 5.2 or later).
References: https://guides.rubyonrails.org/security.html#cross-site-request-forgery-csrf
keryn.rails.cve.nested-attributes-reject-if-cve-2015-7577
Section titled “keryn.rails.cve.nested-attributes-reject-if-cve-2015-7577”warning ruby ruby, rails
accepts_nested_attributes_for combines allow_destroy: false with a reject_if option on a Rails version affected by CVE-2015-7577: reject_if is skipped for records marked for destruction, so the destroy restriction can be bypassed. Upgrade Rails (3.2.22.1, 4.1.14.1, 4.2.5.1 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.
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-2015-7577
keryn.rails.cve.create-with-cve-2014-3514
Section titled “keryn.rails.cve.create-with-cve-2014-3514”warning ruby ruby, rails
create_with receives a value that is neither a literal hash nor permitted parameters on a Rails version affected by CVE-2014-3514: create_with bypassed strong parameters, so request attributes reach the new record unfiltered. Pass params.permit(…) or upgrade Rails (4.0.9, 4.1.5 or later).
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.
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-3514
keryn.rails.cve.dynamic-finder-mysql-cve-2012-6496
Section titled “keryn.rails.cve.dynamic-finder-mysql-cve-2012-6496”warning ruby ruby, rails, mysql
A dynamic finder on a secret-like column (password, token, code, reset, activation, api_key, guid, private) takes a request value directly, with the MySQL adapter on a Rails version before 4.2: MySQL casts strings to integers in comparisons and Rails did not type the value, so a crafted parameter can match records it should not (CVE-2012-6496 and the MySQL type-casting issue). Convert the value with to_s, or upgrade.
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-6496