CVE-2026-40302: zrok Cross-Site Scripting Vulnerability
MODERATECVE-2026-40302 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting zrok libraries in the Go ecosystem. The issue involves reflected xss in github oauth callback via unsanitized refreshinterval error rendering. Remediation is available by upgrading affected packages to version 2.0.1.
CVE-2026-40302 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2026-40302
To remediate this vulnerability, upgrade all affected zrok dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/openziti/zrok to Latest secure release
Upgrade github.com/openziti/zrok/v2 to 2.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/openziti/zrok
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-40302, inspect your project dependencies for zrok:
inspect dependencies for github.com/openziti/zrok
Analyze the terminal output to locate any version of zrok in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In zrok, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-40302 Affected zrok Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/openziti/zrok
|
Go |
≤ 1.1.11
|
|
|
github.com/openziti/zrok/v2
|
Go |
< 2.0.1
|
2.0.1
|
References
Frequently Asked Questions
What is CVE-2026-40302?
Which zrok versions are affected?
What version fixes CVE-2026-40302?
Is github.com/openziti/zrok affected?
Is github.com/openziti/zrok/v2 affected?
What is the CVSS score of CVE-2026-40302?
What CWE is associated with CVE-2026-40302?
How can I check Go dependencies for CVE-2026-40302?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4fxq-2x3x-6xqx",
"modified" : "2026-04-24T20:48:45Z",
"published" : "2026-04-16T21:08:55Z",
"aliases" : [ "CVE-2026-40302" ],
"summary" : "zrok: Reflected XSS in GitHub OAuth callback via unsanitized refreshInterval error rendering",
"details" : "**Summary**\nThe proxyUi template engine uses Go's text/template (which performs no HTML escaping) instead of html/template. The GitHub OAuth callback handlers in both publicProxy and dynamicProxy embed the attacker-controlled refreshInterval query parameter verbatim into an error message when time.ParseDuration fails, and render that error unescaped into HTML. An attacker can deliver a crafted login URL to a victim; after the victim completes the GitHub OAuth flow, the callback page executes arbitrary JavaScript in the OAuth server's origin.\n\n- Attack Vector: Network — the attack is delivered as a crafted URL over the internet.\n- Attack Complexity: Low — no race conditions or special environment prerequisites.\n- Privileges Required: None — the attacker needs no account on the zrok instance.\n- User Interaction: Required — the victim must click the crafted link and complete the GitHub OAuth flow.\n- Scope: Changed — the injected script executes in the OAuth server's origin, not the victim's share origin.\n- Confidentiality Impact: Low — the script runs in the OAuth server origin after a failed flow; no session cookie is set at this point, limiting what can be exfiltrated to what is visible in the DOM and what can be requested from the OAuth server.\n- Integrity Impact: Low — the script can initiate new OAuth flows or submit forms on behalf of the victim in the OAuth server origin.\n- Availability Impact: None.\n\n**Affected Components**\n\n- endpoints/proxyUi/template.go — init() / WriteTemplate (lines 8, 18, 99) — text/template used for HTML rendering\n- endpoints/proxyUi/template.html — line 119 — {{ .Error }} in HTML without escaping\n- endpoints/publicProxy/providerGithub.go — login callback closure (lines 93, 128, 130)\n- endpoints/dynamicProxy/providerGithub.go — loginHandler() (lines 110, 146, 148)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/openziti/zrok"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "1.1.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/openziti/zrok/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/openziti/zrok/security/advisories/GHSA-4fxq-2x3x-6xqx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40302"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/openziti/zrok"
}, {
"type" : "WEB",
"url" : "https://github.com/openziti/zrok/releases/tag/v2.0.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-16T21:08:55Z",
"nvd_published_at" : "2026-04-17T21:16:34Z"
}
}