Summary
FileRise used a hardcoded default encryption key for multiple cryptographic operations, including HMAC token generation, AES configuration encryption, and session handling.
When deployments run with this default key, any unauthenticated attacker who knows the constant value can forge upload tokens for arbitrary file upload and decrypt sensitive configuration secrets such as OIDC client secrets and SMTP passwords.
Affected context
This vulnerability affects FileRise instances that:
- Are deployed with the default cryptographic key left unchanged
- Use the built-in token and configuration encryption mechanisms
- Expose upload or shared-folder functionality over the network
The issue arises because a single static key (PERSISTENT_TOKENS_KEY) is hardcoded and reused across all cryptographic operations unless explicitly overridden via environment variables. Any environment where this default remains in place is at elevated risk, particularly internet-exposed deployments or multi-tenant setups.
Exploit preconditions
- Attack surface: Network-accessible FileRise HTTP/WebDAV endpoints associated with uploads, sessions, and configuration-backed features.
- Required access: No prior authentication is required; the attacker only needs network access to the FileRise instance and knowledge of the default key value.
- Trigger point: Interactions that rely on cryptographic tokens or encrypted configuration, such as upload-token verification, session validation, or reading configuration-protected resources.
- Why exploitation is possible: The cryptographic design uses a single, well-known, hardcoded key for HMAC and encryption. Because the key is not unique per deployment and is the same across installations that do not override it, attackers can reproduce the cryptographic operations, forging valid tokens and decrypting data.
Why this happens
The core issue is the use of a hardcoded, default cryptographic key for sensitive operations, mapping directly to CWE-798: Use of Hard-coded Credentials and related key-management weaknesses (CWE-1188).
Instead of generating a unique secret or requiring a securely provided key at deployment, FileRise defines a constant (default_please_change_this_key) and uses it as the PERSISTENT_TOKENS_KEY unless an environment variable overrides it.
This static key is shared across installations and reused for multiple purposes (HMAC, AES encryption, session tokens), violating the principle of key separation. Any party who knows this constant can compute valid MACs and decrypt ciphertext, effectively bypassing the intended protections.
Potential impact
- Attackers may forge upload tokens to upload arbitrary files into shared folders, leading to potential malware hosting, data staging, or defacement.
- Configuration secrets (including OIDC client secrets and SMTP credentials) can be decrypted, enabling further compromise of identity providers or mail infrastructure.
- Session tokens or persistent authentication artifacts may be forged or manipulated, allowing unauthorized access or impersonation of users.
- Overall confidentiality and integrity of the FileRise deployment can be compromised, potentially enabling lateral movement to other systems integrated with FileRise.
General mitigation guidance
Effective mitigation centers on robust key management and separation of cryptographic roles:
- Ensure that a strong, randomly generated, per-deployment secret key is provided via secure configuration (such as environment variables or secrets managers) and that no default or placeholder values are used in production.
- Use different keys for distinct cryptographic purposes (e.g., one for HMAC tokens, another for configuration encryption, another for session security) to reduce impact if a single key is exposed.
- Remove or disable hardcoded defaults in application logic so that the software fails closed when a key is not explicitly configured.
- Store secrets in dedicated secret-management systems rather than in code or version control, with appropriate rotation policies.
- Apply least-privilege principles around dependent systems (SMTP, identity providers) so that compromised credentials grant minimal capability.
How teams detect issues like this
Detection can focus on both code-level indicators and runtime configuration checks:
- Static analysis and code review:
- Flag any hardcoded constants used as cryptographic keys, HMAC secrets, or encryption passwords.
- Identify reuse of the same key material across multiple cryptographic functions or contexts.
- Look for fallback logic where a default key is used if an environment variable or configuration entry is missing.
- Configuration and runtime checks:
- Scan deployments for known default key values and other placeholder secrets in environment variables, configuration files, or container manifests.
- Implement CI/CD policies that reject builds or deployments if default or weak keys are detected.
- Operational monitoring:
- Monitor for abnormal upload activity (e.g., uncharacteristic volumes of unauthenticated uploads) that could indicate token forgery.
Automated security review tools and SAST solutions can assist in identifying hardcoded secrets and improper key reuse during development.

