Summary
SOCFortress CoPilot prior to 0.1.57 ships with a hardcoded JWT signing secret that is used as a fallback when JWT_SECRET is not explicitly configured.
In deployments using this default, including the standard Docker Compose setup, an unauthenticated attacker can forge admin-scoped JWTs and take full control of the application and connected security tools.
Affected context
This vulnerability affects SOCFortress CoPilot instances where the JWT signing secret is not explicitly set at deployment time.
The risk is highest for environments that:
- Use the default Docker Compose or example deployment configurations
- Rely on the shipped
.env.examplefile without changing JWT_SECRET - Allow network access to the CoPilot web/API interface from untrusted or shared networks
In these contexts, all authentication and authorization decisions depend on a publicly known JWT signing key.
Exploit preconditions
- Attack surface: Public or internal SOCFortress CoPilot web/API endpoints that accept JWTs for authentication.
- Required access: Network reachability to the application; no valid user account or prior authentication required.
- Trigger point: Any request that uses a JWT for authentication or authorization, including login sessions and admin API calls.
- Why exploitation is possible: The application uses a hardcoded fallback JWT signing secret that is shipped publicly. If JWT_SECRET is unset, attackers can generate valid, correctly signed tokens (including admin-scoped tokens) using this known secret, bypassing both authentication and authorization checks.
Why this happens
The core issue is the use of a hardcoded, publicly known cryptographic secret as a fallback for JWT signing, mapped to CWE-798: Use of Hard-coded Credentials.
Instead of treating the JWT signing key as a required, per-deployment secret, the application:
- Defines a default secret value in
backend/app/auth/utils.py - Documents and ships the same value in
.env.example - Automatically uses that value whenever JWT_SECRET is not configured
Because JWTs rely on the signing key as the root of trust, anyone who knows the fallback value can create tokens that the server will accept as authentic. This effectively collapses the authentication boundary: token integrity is preserved, but the trust anchor is public, resulting in CWE-287: Improper Authentication and weak credential protection (CWE-522).
Potential impact
- An attacker may forge arbitrary JWTs that the application accepts as valid.
- An attacker could create admin-scoped tokens and gain full administrative control over SOCFortress CoPilot.
- An attacker may access, modify, or delete security configurations, alerts, playbooks, and integrations managed by CoPilot.
- An attacker could pivot into or manipulate connected security tools (e.g., SIEM, EDR, ticketing, orchestration platforms) via CoPilot's integrations.
- An attacker may exfiltrate sensitive security data, including logs, incident details, and configuration secrets stored or proxied through CoPilot.
- An attacker could disable or tamper with security monitoring, effectively blinding defenders.
General mitigation guidance
Effective mitigation centers on treating JWT signing keys as mandatory, unique, and secret per deployment, and avoiding hardcoded crypto material entirely.
Recommended defensive patterns include:
- Mandatory configuration of secrets: Enforce a startup check that fails fast if JWT_SECRET (or equivalent) is missing or uses a known default. Prefer "no default" for sensitive keys.
- Secret management practices: Store JWT signing keys in dedicated secret management systems or environment variables, never in source code, images, or example configuration files.
- Per-environment uniqueness: Generate strong, random signing keys for each environment (development, staging, production) to prevent key reuse and cross-environment attacks.
- Configuration hygiene: Avoid shipping real or realistic secrets in
.env.exampleor sample configurations; use obvious placeholders and documentation instead. - Defense in depth for auth: Combine JWT validation with additional controls such as IP allowlists, MFA for high-privilege actions, and explicit server-side authorization checks not solely derived from token claims.
- Key rotation capability: Design the system so that JWT signing keys can be rotated, with short-lived tokens to limit exposure if a key is compromised.
How teams detect issues like this
Detection focuses on both code-level signals and runtime configuration inspection:
- Static analysis and code review:
- Flag any occurrence of hardcoded secrets, keys, or passwords in source code (constants named
SECRET,TOKEN,KEY, etc.). - Check for default or fallback credential values used in authentication, encryption, or token signing logic.
- Review example configuration files (
.env.example,docker-compose.yml, Helm values) for embedded secrets that might be reused in production. - Configuration and runtime checks:
- Implement startup assertions that log errors and abort if JWT_SECRET or equivalent keys are unset or match known defaults.
- Use configuration scanners to detect deployments using placeholder or documented default secrets.
- Logging and monitoring:
- Monitor for anomalous patterns, such as new admin sessions from unusual locations or mass administrative actions.
- Track token issuance and usage patterns; unexpected spikes or access from new origins may indicate forged tokens.
- Security tooling integration:
- Incorporate secrets detection tools in CI/CD pipelines to block commits containing hardcoded secrets.
- Use policy-as-code frameworks (e.g., Open Policy Agent, custom checks) to enforce "no hardcoded secrets" and "no default credentials" rules across repositories.

