CVE-2026-39324: Rack :Session::Cookie Secrets: Decrypt Failure Fallback Vulnerability

CRITICAL
Advisory Identifier: GHSA-33qg-7wpp-89cq
Advisory Summary

CVE-2026-39324 is a CRITICAL :session::cookie secrets: decrypt failure fallback vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Rack libraries in the RubyGems ecosystem. The issue involves :session::cookie secrets: decrypt failure fallback enables secretless session forgery and marshal deserialization. Remediation is available by upgrading affected packages to version 2.1.2.

CVE-2026-39324 at a Glance

CVE Identifier CVE-2026-39324
GHSA Identifier GHSA-33qg-7wpp-89cq
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2026-39324

To remediate this vulnerability, upgrade all affected Rack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rack-session fixed: 2.1.2
Upgrade rack-session to 2.1.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rack-session

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-39324, inspect your project dependencies for Rack:

inspect dependencies for rack-session

Analyze the terminal output to locate any version of Rack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Rack, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

`Rack::Session::Cookie` incorrectly handles decryption failures when configured with `secrets:`. If cookie decryption fails, the implementation falls back to a default decoder instead of rejecting the cookie. This allows an unauthenticated attacker to supply a crafted session cookie that is accepted as valid session data without knowledge of any configured secret. Because this mechanism is used to load session state, an attacker can manipulate session contents and potentially gain unauthorized access. ## Details When `secrets:` is configured, `Rack::Session::Cookie` attempts to decrypt incoming session cookies using one of the configured encryptors. If all decrypt attempts fail, the implementation does not reject the cookie. Instead, it falls back to decoding the cookie using a default coder. This fallback path processes attacker-controlled cookie data as trusted session state. The behavior is implicit and occurs even when encrypted cookies are expected. The fallback decoder is applied automatically and does not require the application to opt into a non-encrypted session format. As a result, a client can send a specially crafted cookie value that bypasses the intended integrity protections provided by `secrets:`. This issue affects both default configurations and those using alternative serializers for encrypted payloads. ## Impact Any Rack application using `Rack::Session::Cookie` with `secrets:` may be affected. > [!NOTE] > Rails applications are typically not affected — Rails uses `ActionDispatch::Session::CookieStore`, which is a separate implementation backed by `ActiveSupport::MessageEncryptor` and does not share the vulnerable code path. An unauthenticated attacker can supply a crafted session cookie that is accepted as valid session data. This can lead to authentication bypass or privilege escalation in applications that rely on session values for identity or authorization decisions. Depending on application behavior and available runtime components, processing of untrusted session data may also expose additional risks. ## Mitigation * Update to a patched version of`rack-session` that rejects cookies when decryption fails under the `secrets:` configuration. * After updating, rotate session secrets to invalidate existing session cookies, since attacker-supplied session data may have been accepted and re-issued prior to the fix.

CVE-2026-39324 Affected Rack Versions

1 component(s)
Fixed Versions:
2.1.2
Product / Package Ecosystem Affected Versions Fixed Version
rack-session
RubyGems
≥ 2.0.0
< 2.1.2
2.1.2

References

Frequently Asked Questions

What is CVE-2026-39324?
CVE-2026-39324 is a security vulnerability in Rack involving :Session::Cookie secrets: decrypt failure fallback enables secretless session forgery and Marshal deserialization under CWE-502: Deserialization of Untrusted Data.
Which Rack versions are affected?
Affected versions include releases prior to 2.1.2 across affected packages: rack-session.
What version fixes CVE-2026-39324?
Upgrading to 2.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack-session affected?
Yes, rack-session is affected in releases prior to 2.1.2. Upgrade your dependency to 2.1.2 or later.
What CWE is associated with CVE-2026-39324?
CVE-2026-39324 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check RubyGems dependencies for CVE-2026-39324?
Run the dependency tree command: 'inspect dependencies for rack-session'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-33qg-7wpp-89cq",
  "modified" : "2026-05-13T16:21:11Z",
  "published" : "2026-04-08T00:15:08Z",
  "aliases" : [ "CVE-2026-39324" ],
  "summary" : "Rack::Session::Cookie secrets: decrypt failure fallback enables secretless session forgery and Marshal deserialization",
  "details" : "`Rack::Session::Cookie` incorrectly handles decryption failures when configured with `secrets:`. If cookie decryption fails, the implementation falls back to a default decoder instead of rejecting the cookie. This allows an unauthenticated attacker to supply a crafted session cookie that is accepted as valid session data without knowledge of any configured secret.\n\nBecause this mechanism is used to load session state, an attacker can manipulate session contents and potentially gain unauthorized access.\n\n## Details\n\nWhen `secrets:` is configured, `Rack::Session::Cookie` attempts to decrypt incoming session cookies using one of the configured encryptors. If all decrypt attempts fail, the implementation does not reject the cookie. Instead, it falls back to decoding the cookie using a default coder.\n\nThis fallback path processes attacker-controlled cookie data as trusted session state. The behavior is implicit and occurs even when encrypted cookies are expected.\n\nThe fallback decoder is applied automatically and does not require the application to opt into a non-encrypted session format. As a result, a client can send a specially crafted cookie value that bypasses the intended integrity protections provided by `secrets:`.\n\nThis issue affects both default configurations and those using alternative serializers for encrypted payloads.\n\n## Impact\n\nAny Rack application using `Rack::Session::Cookie` with `secrets:` may be affected.\n\n> [!NOTE]\n> Rails applications are typically not affected — Rails uses `ActionDispatch::Session::CookieStore`, which is a separate implementation backed by `ActiveSupport::MessageEncryptor` and does not share the vulnerable code path.\n\nAn unauthenticated attacker can supply a crafted session cookie that is accepted as valid session data. This can lead to authentication bypass or privilege escalation in applications that rely on session values for identity or authorization decisions.\n\nDepending on application behavior and available runtime components, processing of untrusted session data may also expose additional risks.\n\n## Mitigation\n\n* Update to a patched version of`rack-session` that rejects cookies when decryption fails under the `secrets:` configuration.\n  * After updating, rotate session secrets to invalidate existing session cookies, since attacker-supplied session data may have been accepted and re-issued prior to the fix.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack-session"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack-session/security/advisories/GHSA-33qg-7wpp-89cq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39324"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rack/rack-session"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack-session/CVE-2026-39324.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287", "CWE-345", "CWE-502", "CWE-565" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-08T00:15:08Z",
    "nvd_published_at" : "2026-04-07T18:16:43Z"
  }
}