Summary
RustFS's internode RPC authentication derives its HMAC-SHA256 signing key from configuration, but silently falls back to a hard-coded default secret ("rustfsadmin") when no explicit key is set.
In deployments where operators have not configured a custom RPC secret or global S3 secret key, an attacker who knows or guesses this default can forge valid RPC requests, gaining full control over internode operations.
Affected context
This vulnerability affects RustFS clusters using the internode RPC layer for communication and relying on HMAC-SHA256 signatures for request authentication.
It becomes relevant when:
- The
RUSTFS_RPC_SECRETenvironment variable is unset, and - No global S3 secret key is configured, causing the code to fall back to
DEFAULT_SECRET_KEY = "rustfsadmin".
In such configurations, every node in the cluster implicitly trusts a public, source-embedded shared secret for RPC authentication.
Exploit preconditions
- Attack surface: RustFS internode RPC HTTP endpoints reachable over the network (typically inside a cluster, but sometimes exposed via misconfiguration).
- Required access: Network-level access to the internode RPC interface; no prior authentication is required if the default secret is used.
- Attacker knowledge: Awareness that RustFS uses a hard-coded default key and knowledge of the default value ("rustfsadmin"), which is trivially obtainable from the public source tree or documentation.
- Trigger point: Crafting and sending HTTP RPC requests signed with HMAC-SHA256 using the default shared secret.
- Why exploitation is possible: The authentication layer treats the hard-coded default as a valid shared secret, so any party using this known key can generate signatures indistinguishable from legitimate cluster nodes.
Why this happens
The core issue is the use of a hard-coded, publicly known secret as a security control when configuration is missing.
The get_shared_secret() function in crates/ecstore/src/rpc/http_auth.rs implements a fallback behavior that, instead of failing closed when no secret is configured, returns DEFAULT_SECRET_KEY = "rustfsadmin".
This pattern maps directly to CWE-798: Use of Hard-coded Credentials, and is reinforced by CWE-1392: Use of Default Cryptographic Key, because a default cryptographic key is embedded into the source and treated as a valid long-term authentication secret.
Conceptually, the authentication design assumes all nodes share a confidential key, but the implementation undermines this by using a static, widely known default, effectively collapsing the trust boundary: possession of the codebase or basic product knowledge suffices to impersonate any cluster member.
Potential impact
- An attacker could forge authenticated internode RPC requests, impersonating legitimate RustFS nodes.
- Malicious nodes could be introduced into the cluster, enabling data exfiltration or tampering.
- Stored data could be modified, deleted, or corrupted, potentially causing complete data loss or integrity violations.
- Cluster control operations (rebalancing, replication changes, metadata updates) could be manipulated to degrade availability or cause denial of service.
- Logs and monitoring data sourced from RPC interactions may be falsified, hindering incident response and forensics.
General mitigation guidance
Mitigation centers on eliminating insecure fallback behavior and ensuring secrets are explicitly configured and treated as sensitive:
- Require an explicit, non-default shared secret for the RPC layer and fail startup if no valid secret is provided.
- Avoid any hard-coded cryptographic keys or passwords; instead, load secrets from secure configuration channels (environment variables, secret managers, or dedicated configuration stores).
- Design authentication so that defaults are non-operational: the system should not accept a built-in secret for any production use.
- Encourage operators to manage separate secrets for different environments (development, staging, production) and rotate these secrets regularly.
- Apply least-privilege networking patterns—limit which hosts can reach the internode RPC endpoints via firewalls, service meshes, or private networks, so exposure is minimized even if credentials are weak.
- Provide secure-by-default deployment templates that include mandatory secret configuration and clearly warn when secrets are unset or insecure.
How teams detect issues like this
Detection can focus on both code-level patterns and deployment-time configuration:
- Static analysis and code review:
- Flag functions that return default secrets or cryptographic keys when configuration is missing.
- Search for hard-coded tokens, passwords, and keys (especially low-entropy strings referenced in authentication or HMAC code paths).
- Identify authentication logic that does not fail closed when configuration is absent.
- Configuration and policy checks:
- Implement CI/CD rules that fail builds or deployments if
RUSTFS_RPC_SECRET(or equivalent secrets) are unset in non-development environments. - Use policy-as-code tools to enforce that production Kubernetes/VM configurations reference secrets from a secure store rather than relying on defaults.
- Monitor runtime configuration for the presence of known default values (e.g., "rustfsadmin") and trigger alerts.
- Runtime monitoring:
- Analyze internode RPC logs for anomalous sources or patterns, such as new nodes appearing or unexpected RPC call sequences.
- Use network monitoring to detect unauthorized hosts attempting to communicate on the internode RPC ports, even if authentication succeeds.
- Automated security tooling:
- Integrate secret-scanning tools into repositories to detect hard-coded credentials and default keys during development.

