CVE-2026-39324

CVE-2026-39324 is a critical-severity improper authentication vulnerability in rack-session (rubygems), affecting versions >= 2.0.0, < 2.1.2. It is fixed in 2.1.2.

Summary

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.

Mitigation

  • Update to a patched version ofrack-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.

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.

The application does not adequately verify the identity of a user, device, or process before granting access. Typical impact: unauthorized access to functions or data reserved for authenticated parties.

Affected versions

rack-session (>= 2.0.0, < 2.1.2)

Security releases

rack-session → 2.1.2 (rubygems)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade rack-session to 2.1.2 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-39324? CVE-2026-39324 is a critical-severity improper authentication vulnerability in rack-session (rubygems), affecting versions >= 2.0.0, < 2.1.2. It is fixed in 2.1.2. The application does not adequately verify the identity of a user, device, or process before granting access.
  2. Which versions of rack-session are affected by CVE-2026-39324? rack-session (rubygems) versions >= 2.0.0, < 2.1.2 is affected.
  3. Is there a fix for CVE-2026-39324? Yes. CVE-2026-39324 is fixed in 2.1.2. Upgrade to this version or later.
  4. Is CVE-2026-39324 exploitable, and should I be worried? Whether CVE-2026-39324 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2026-39324 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2026-39324? Upgrade rack-session to 2.1.2 or later.

Other vulnerabilities in rack-session

CVE-2026-39324

Stop the waste.
Protect your environment with Kodem.