Summary
OpenProject's official Docker image previously shipped with a hard-coded Rails SECRET_KEY_BASE and used cookies_serializer = :marshal, creating a deterministic Ruby Marshal deserialization path.
Any logged-in user able to control cookie data for the /my/two_factor_devices reader could exploit this behavior, turning a logic flaw in cookie handling into a critical remote code execution risk in affected deployments.
Affected context
The vulnerability manifests in OpenProject instances deployed from the official Docker image where:
- The default
SECRET_KEY_BASE=OVERWRITE_MEvalue is left unchanged - Rails cookies are serialized using
:marshal - Application code reads and deserializes cookie content via the
/my/two_factor_devicesendpoint
In such configurations, authenticated users can influence cookie values that will be deterministically deserialized on the server, increasing risk whenever cookie integrity depends on a shared, static secret.
Exploit preconditions
- Attack surface: Web application over HTTP(S), specifically cookie handling associated with
/my/two_factor_devices. - Required access: Authenticated user access to the OpenProject instance and the ability to manipulate browser cookies or intercept/modify requests.
- Trigger point: Server-side processing of the
two_factor_devicescookie, where Ruby's Marshal-based deserialization is invoked using the staticSECRET_KEY_BASE. - Why exploitation is possible: A hard-coded, shared secret key base combined with Marshal serialization permits crafted cookie values to be trusted and deserialized as complex Ruby objects, aligning with unsafe deserialization conditions described by CWE-502 and compounded by use of static secrets (CWE-798) and relying on default configurations (CWE-1188, CWE-1392).
Why this happens
At its core, the bug results from using Ruby's Marshal-based cookie serialization together with a universal, hard-coded Rails master key in the Docker image.
Marshal is a generic object serialization mechanism that reconstitutes Ruby objects during deserialization, and when its inputs are derived from data protected only by a predictable or shared secret, an attacker can shape those inputs to cause unintended behavior.
The pattern maps to CWE-502: Unsafe Deserialization, because untrusted or weakly trusted data is deserialized into executable object graphs, and to CWE-798: Use of Hard-coded Credentials, CWE-1188: Insecure Default Initialization of Resource, and CWE-1392: Use of Default Cryptographic Key as the deployment ships with a static secret that undermines cookie integrity and confidentiality.
Potential impact
- May allow execution of arbitrary Ruby code within the OpenProject application context.
- Could enable full compromise of the application process and its data.
- May allow privilege escalation by forging or manipulating serialized session or authentication-related objects.
- Can facilitate lateral movement if the compromised application has access to other internal services or credentials.
- Could lead to persistent backdoors or data tampering in project management workflows.
General mitigation guidance
Effective mitigation focuses on reducing trust in serialized data and eliminating static secrets from deployment artifacts.
Pattern-based guidance includes:
- Avoid general-purpose object serialization formats such as Marshal for cookies and other user-controlled data; prefer safer, data-only encodings (e.g., JSON with strict schema validation).
- Ensure cryptographic secrets like
SECRET_KEY_BASEare unique per deployment, generated securely, and injected at runtime via environment variables or secret management systems instead of being baked into images. - Treat cookie and session data as untrusted input, validating structure and contents before using them in security-sensitive logic.
- Apply least privilege to the application process, so that compromise via unsafe deserialization yields limited access to the underlying system and data.
- Configure deployments so that default values in images are overridden by secure, environment-specific settings as part of standard provisioning practices.
How teams detect issues like this
Detection can rely on a combination of code-level analysis and deployment configuration review:
- Static analysis rules that flag use of unsafe serializers (e.g.,
:marshal) for cookies or session data and the presence of hard-coded cryptographic secrets or default keys in application code or Dockerfiles. - Manual or automated inspection of Docker images and environment configuration to identify shared or static values for
SECRET_KEY_BASEand other critical secrets. - Code review practices that treat any deserialization of user-influenced data as a high-risk pattern, prompting scrutiny of serialization formats, trust boundaries, and validation steps.
- Security policies and CI checks that enforce the use of secure cookie serializers, prohibit default cryptographic keys, and verify that production deployments source secrets from dedicated secret management services.
- Runtime monitoring for anomalous cookie patterns, unexpected object types during deserialization, or unusual control flows triggered by cookie processing.

