CVE-2026-126081 — rails
One of 9 rails vulnerabilities published together by NVD: our article covers all of them.
RubyVulnerabilitiesAnalysis
Rails Action Pack CVE-2026-12608: each_key with a block bypasses mass-assignment protection
CVE-2026-12608 is a high-severity (CVSS 7.5) flaw in Rails Action Pack where ActionController::Parameters#each_key returns an unprotected internal hash, which mass assignment accepts. Applications that pass that return value into mass assignment can be affected, and fixed versions are 8.1.4.1 and 8.0.5.2. ### What the flaw is Action Pack is the Rails component that handles web requests. According to the NVD record, calling ActionController::Parameters#each_key with a block returns the internal hash that stores request parameters, not the Parameters object. That hash has no permitted? method, so Active Model mass assignment methods such as new, assign_attributes and update accept it without raising ActiveModel::ForbiddenAttributesError. The protection that normally blocks unpermitted attributes is therefore skipped. ### What's affected The NVD entry says an application is affected only if it passes the return value of each_key, called with a block, into mass assignment. Rails itself does not make that call. The record describes this as an incomplete fix of CVE-2020-8164, which made each, each_pair and each_value return the Parameters instance but left each_key unchanged. The sources list fixed versions 8.1.4.1 and 8.0.5.2 and do not give a fuller list of affected version ranges. ### How serious is it NVD rates the issue HIGH, with a CVSS score of 7.5. The source describes a remote, unauthenticated attacker setting attributes the application does not intend to permit, such as an authorization flag. The real impact depends on which model attributes the application exposes through this code path. ### Exploitation status The sources do not say whether this flaw is being exploited in the wild, and they contain no reports of active exploitation. ### What to do Upgrade to 8.1.4.1 or 8.0.5.2, depending on your release line. Search your codebase for each_key calls that take a block and check whether their results reach create, update or assign_attributes. Where that pattern exists, replace it with explicit permit-based parameter handling, and make sure sensitive attributes such as role or permission flags are never mass-assignable.
Summary
Action Pack is a framework for handling and responding to web requests. Prior to 8.1.4.1 and 8.0.5.2, ActionController::Parameters#each_key delegates to the internal ActiveSupport::HashWithIndifferentAccess that holds the request parameters, so when called with a block it returns that hash instead of the Parameters instance. The hash does not respond to permitted?, so Active Model mass assignment (new, assign_attributes, update) accepts it without raising ActiveModel::ForbiddenAttributesError. An application that passes the return value of each_key to mass assignment could allow a remote, unauthenticated attacker to set attributes that the application does not permit, such as an authorization flag. This is an incomplete fix of CVE-2020-8164, which made each, each_pair and each_value return the Parameters instance but left each_key delegated. An application is affected if it passes the return value of ActionController::Parameters#each_key, called with a block, to mass assignment. Rails itself makes no such call. This issue is fixed in versions 8.1.4.1 and 8.0.5.2.
Severity breakdown
High · 7.5
An attacker without an account can exploit this over the network, without any user action.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Login needed
- no
- User action needed
- no
- Scope
- stays within the vulnerable component
- Impact
- high on integrity, none on confidentiality and availability
Weakness
- CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| actionpack (RubyGems) | ≥ 8.1.0.beta1, < 8.1.4.1 | 8.1.4.1 |
| < 8.0.5.2 | 8.0.5.2 | |
| rails | >= 8.1, < 8.1.4.1, < 8.0.5.2 | — |
References by type
Vendor advisories
Patches and fixed releases
- github.com/rails/rails/commit/2fc8838300133931e19eed3ea6cee76a7e83f19c
- github.com/rails/rails/commit/8ba746e0a786458c281060823f2ccc5c5f6312ac
- github.com/rails/rails/releases/tag/v8.0.5.2
- github.com/rails/rails/releases/tag/v8.1.4.1
Other references
Affected
- rails
What to do
- Check whether you run an affected product or version and apply the vendor's update or mitigation.
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-126081?
CVE-2026-12608 is a high-severity (CVSS 7.5) flaw in Rails Action Pack where ActionController::Parameters#eachkey returns an unprotected internal hash, which mass assignment accepts. Applications that pass that return value into mass assignment can be affected, and fixed versions are 8.1.4.1 and 8.0.5.2. What the flaw is Action Pack is the Rails component that handles web requests. Weakness type: Improperly Controlled Modification of Dynamically-Determined Object Attributes (CWE-915).
How severe is CVE-2026-126081?
CVE-2026-126081 has a CVSS 3.1 base score of 7.5 (high), from the CNA (github.com). An attacker without an account can exploit this over the network, without any user action.
Is CVE-2026-126081 being exploited?
Not as far as is known: CVE-2026-126081 is not in CISA's Known Exploited Vulnerabilities catalog as of November 28, 2026. EPSS estimates a 0.6% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-126081?
actionpack (RubyGems) ≥ 8.1.0.beta1, < 8.1.4.1 (fixed in 8.1.4.1); actionpack (RubyGems) < 8.0.5.2 (fixed in 8.0.5.2); rails >= 8.1, < 8.1.4.1, < 8.0.5.2.
How do I fix CVE-2026-126081?
Update to a fixed release: actionpack (RubyGems) 8.1.4.1; actionpack (RubyGems) 8.0.5.2.
Timeline & sources
References
Related vulnerabilities & news
- MongoDB Ruby Driver Vulnerability Enables Unauthenticated Data Manipulation
- MongoDB Ruby Driver Logic Flaw Enables Unauthorized Data Access
- MongoDB Ruby Driver Type Confusion Vulnerability in Extended JSON Parsing
- MongoDB Ruby Driver Vulnerability Allows Cleartext Storage of Sensitive Data
- Socket Offers Free Patches Covering All Critical RubyGems CVEs