Nezha Dashboard Path Traversal → JWT Secret Leak → Token Forgery — CVE-2026-53519
by tar-xz · 2026-07-05
- Severity
- Not disclosed (unauthenticated path traversal leading to full admin JWT forgery)
- CVE
- CVE-2026-53519 (GHSA-5c25-7vpj-9mqh)
- Category
- web
- Affected product
- Nezha Dashboard (monitoring/agent management panel)
- Affected versions
- Versions affected by GHSA-5c25-7vpj-9mqh (exact version range not specified in source; see advisory)
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Tags
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | Unknown |
| Author / Researcher | tar-xz |
| CVE / Advisory | CVE-2026-53519 (GHSA-5c25-7vpj-9mqh) |
| Category | web |
| Severity | Not disclosed (unauthenticated path traversal leading to full admin JWT forgery) |
| CVSS Score | Not disclosed |
| Status | PoC |
| Tags | nezha, path-traversal, jwt-forgery, unauthenticated, config-disclosure, sqlite, privilege-escalation, cwe-22, cwe-347 |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Nezha Dashboard (monitoring/agent management panel) |
| Versions Affected | Versions affected by GHSA-5c25-7vpj-9mqh (exact version range not specified in source; see advisory) |
| Language / Platform | Python 3 (standard library only: urllib, sqlite3, hmac, hashlib) |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
The Nezha Dashboard improperly normalizes its routing paths, allowing a crafted request such as /dashboard../data/config.yaml to escape the intended static-file root and read arbitrary files served by the dashboard process. The PoC uses this path traversal twice: first to fetch config.yaml and extract the jwt_secret_key, then to fetch sqlite.db and pull an administrative user ID out of the local database. With the leaked secret and a valid user ID, the script forges a valid HS256 JWT and uses it to authenticate to the dashboard’s API as that user, demonstrating full unauthenticated-to-admin privilege escalation with control over the monitoring dashboard and its connected agent nodes.
Vulnerability Details
Root Cause
Improper path normalization in the Nezha Dashboard’s request routing allows traversal sequences like /dashboard../ (and URL-encoded variants such as /dashboard%2e%2e/) to reach files outside the intended web root, exposing internal configuration and database files (CWE-22: Path Traversal). Because the leaked config.yaml contains the JWT signing secret (jwt_secret_key), and JWTs are validated only by HMAC signature (CWE-347: Improper Verification of Cryptographic Signature intent — trusting a leaked static secret), any party who can read that file can forge arbitrary valid session tokens.
Attack Vector
- Send
GET /dashboard%2e%2e/data/config.yamlto the target and extract thejwt_secret_keyvalue via regex. - Send
GET /dashboard%2e%2e/data/sqlite.dbto download the dashboard’s local SQLite database. - Query the downloaded database for the lowest
idin theuserstable (typically the first/admin account). - Construct an HS256 JWT with
user_id,ip,exp, andorig_iatclaims, signing it with the leakedjwt_secret_key. - Present the forged JWT as a
Bearertoken toGET /api/v1/profile(or other authenticated endpoints) to confirm authenticated access as the target user.
Impact
Complete unauthenticated compromise of the Nezha Dashboard: an attacker gains a valid, forged administrative session token, granting full control of the monitoring dashboard and any agent nodes it manages, without needing any credentials.
Environment / Lab Setup
Target: Nezha Dashboard instance vulnerable to GHSA-5c25-7vpj-9mqh, reachable over HTTP(S)
Attacker: Python 3 (stdlib only — no extra pip installs required)
Proof of Concept
PoC Script
See
CVE-2026-53519.pyin this folder. Trilingual documentation (README.mdcovered here; upstreamREADME.zh-TW.mdandREADME.zh-CN.mdalso included) accompanies the script.
| |
Run with only a target URL, the script automatically performs both path-traversal downloads (config.yaml, sqlite.db), extracts the JWT secret and an admin user ID, forges a token, and verifies it against /api/v1/profile, printing the forged JWT and the authenticated profile response. The jwt_secret and user_id arguments are optional overrides if those values are already known.
Detection & IOCs
GET /dashboard%2e%2e/data/config.yaml
GET /dashboard%2e%2e/data/sqlite.db
Signs of compromise:
- HTTP requests with
%2e%2eor literal../sequences appended to/dashboardpaths - Unexpected downloads of
config.yamlorsqlite.dbby non-administrative clients - API access (e.g.
/api/v1/profile) authenticated with JWTs not issued through the normal login flow, or logins from user IDs with no corresponding password-based authentication event
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade Nezha Dashboard to the version that fixes GHSA-5c25-7vpj-9mqh (proper path normalization / route sandboxing for the dashboard static handler) |
| Interim mitigation | Rotate jwt_secret_key immediately if exposure is suspected, restrict direct network access to the dashboard’s data directory, and add reverse-proxy rules to reject requests containing traversal sequences before they reach the application |
References
Notes
Mirrored from https://github.com/tar-xz/CVE-2026-53519-PoC on 2026-07-05. LICENSE was excluded per archive convention; the trilingual README variants were kept as supplementary documentation alongside this catalog-standard README.
| |