Praisonai-platform Critical Authentication Bypass Due to Persistent Hardcoded JWT Secret
Praisonai-platform versions up to and including 0.1.4 are vulnerable to a critical authentication bypass stemming from a hardcoded JWT signing secret ('dev-secret-change-me') and a bypassed production guard, allowing unauthenticated attackers to forge JSON Web Tokens (JWTs) and impersonate any user, leading to complete access, privilege escalation to workspace owner, and potential resource destruction.
The praisonai-platform (PyPI) package, specifically versions up to and including 0.1.4, is critically vulnerable to an authentication bypass. Despite a previous advisory (GHSA-3qg8-5g3r-79v5) claiming a patch in 0.1.4, the vulnerability persists. The platform's JSON Web Tokens (JWTs) are signed using a hardcoded secret, "dev-secret-change-me", which is publicly known from the source code. The intended production guard, designed to prevent this, is default-open because it only triggers when PLATFORM_ENV is not "dev", but PLATFORM_ENV defaults to "dev" if not explicitly set. This flaw allows any unauthenticated attacker to forge valid JWTs, impersonate any user (including workspace owners), and gain complete unauthorized access. This issue affects any default deployment of praisonai-platform 0.1.4 that does not explicitly set a strong PLATFORM_JWT_SECRET.
Attack Chain
- Reconnaissance: Attacker identifies a
praisonai-platforminstance, potentially usinguvicorn praisonai_platform.api.app:apporpython -m praisonai_platform. - Information Gathering: Attacker accesses the public source code of
praisonai-platform0.1.4 to retrieve the hardcoded JWT secret "dev-secret-change-me". - Credential Forgery: Attacker crafts a malicious JWT payload (e.g.,
{"sub": "target_user_id", "email": "victim@target", "exp": "future_timestamp"}). - JWT Signing: Attacker signs the crafted JWT payload using the publicly known
dev-secret-change-mesecret and theHS256algorithm. - Authentication Bypass: Attacker sends requests to the
praisonai-platformAPI with the forged JWT in theAuthorizationheader. The platform's_verify_tokenfunction, also using the default secret, validates the token and authenticates the attacker astarget_user_id. - Privilege Escalation: If the
target_user_idis a known workspace owner's ID (which can be discovered from member listings or logs), the attacker gains owner-level access to the workspace. - Impact: Attacker leverages owner privileges to perform actions such as deleting workspaces, evicting legitimate members, or exfiltrating data, leading to resource destruction or denial of service.
Impact
Any deployment of praisonai-platform 0.1.4 that runs without explicitly setting a strong PLATFORM_JWT_SECRET is immediately vulnerable. This includes the default startup commands like python -m praisonai_platform --host 0.0.0.0 --port 8000 which do not configure the necessary environment variables. The direct consequences include complete unauthenticated authentication bypass, allowing an attacker to mint valid session tokens for any user. With a known user ID (obtainable from member lists or logs), attackers can achieve workspace-owner takeover, leading to the read, update, and deletion of all resources within that workspace, and member management. This enables resource destruction and lock-out, such as deleting entire workspaces or evicting legitimate users, resulting in an irrecoverable denial of service. The initial vulnerability (GHSA-3qg8) was scored 9.8 Critical on CVSS.
Recommendation
- Immediately update
praisonai-platformto a version where the vulnerability is confirmed patched, or implement the suggested fix to remove the default secret and enforcePLATFORM_JWT_SECRETat startup. - Review application logs for the presence of the
RuntimeErrormessage indicating the default secret is in use in a production environment, as described in theDetect Praisonai-Platform Default Secret Guard RuntimeErrorSigma rule. - Search code repositories and configuration files for the hardcoded secret
dev-secret-change-meto ensure it's not present in active deployments. - Deploy the
Detect Praisonai-Platform Uvicorn Default StartupSigma rule to identify systems running the vulnerable application entry point. - Rotate all JWT signing keys if this secret has been used in any production environment, assuming compromise.
Detection coverage 2
Detect Praisonai-Platform Default Secret Guard RuntimeError
infoDetects the specific RuntimeError message that indicates praisonai-platform is attempting to use the hardcoded default JWT secret 'dev-secret-change-me' in a non-'dev' environment, signaling a critical misconfiguration.
Detect Praisonai-Platform Uvicorn Default Startup
lowDetects the common startup command for praisonai-platform using uvicorn, which in its default configuration (without PLATFORM_JWT_SECRET environment variable) is vulnerable to JWT forgery. This rule helps identify vulnerable instances.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
credential
| Type | Value |
|---|---|
| credential | dev-secret-change-me |