CVE-2026-39324
JSON

9.3critical

Rack::Session::Cookie secrets: decrypt failure fallback enables secretless session forgery and Marshal deserialization

Severity
9.3critical CVSS:4.0 by GitHub_M
Exploit likelihood
0.28% (higher than 21% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-33qg-7wpp-89cq

Description

Rack::Session is a session management implementation for Rack. From 2.0.0 to before 2.1.2, 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. This vulnerability is fixed in 2.1.2.

Affected

Product or packageVersionsReported by
rack rack-session>= 2.0.0, < 2.1.2, from 2.0.0 before 2.1.2CVE List, NVD
rack-session (RubyGems)from 2.0.0 before 2.1.2GitHub Advisory Database

All scores

GitHub_M9.3critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-287CWE-345CWE-502CWE-565

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

Rack::Session is a session management implementation for Rack. From 2.0.0 to before 2.1.2, 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. This vulnerability is fixed in 2.1.2.

GitHub Advisory Database

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 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.
NVD (es)

Rack::Session es una implementación de gestión de sesiones para Rack. Desde la versión 2.0.0 hasta antes de la 2.1.2, Rack::Session::Cookie maneja incorrectamente los fallos de descifrado cuando se configura con secrets:. Si el descifrado de la cookie falla, la implementación recurre a un decodificador predeterminado en lugar de rechazar la cookie. Esto permite a un atacante no autenticado suministrar una cookie de sesión manipulada que es aceptada como datos de sesión válidos sin conocimiento de ningún secreto configurado. Debido a que este mecanismo se utiliza para cargar el estado de la sesión, un atacante puede manipular el contenido de la sesión y potencialmente obtener acceso no autorizado. Esta vulnerabilidad se corrige en la versión 2.1.2.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-39324 changed 2026-04-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-33qg-7wpp-89cq changed 2026-09-10CC-BY-4.0
NVDCVE-2026-39324 changed 2026-10-26Public domain