{"id":"CVE-2026-40302","aliases":["CVE-2026-40302","GHSA-4fxq-2x3x-6xqx","GO-2026-5118"],"related":[],"kind":"vulnerability","state":"published","title":"zrok has reflected XSS in GitHub OAuth callback via unsanitized refreshInterval error rendering","summary":"zrok is software for sharing web services, files, and network resources. Prior to version 2.0.1, the 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. Version 2.0.1 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"zrok is software for sharing web services, files, and network resources. Prior to version 2.0.1, the 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. Version 2.0.1 patches the issue.","source":"cvelist"},{"lang":"en","text":"**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)","format":"markdown","source":"ghsa"},{"lang":"en","text":"zrok: Reflected XSS in GitHub OAuth callback via unsanitized refreshInterval error rendering in github.com/openziti/zrok","format":"markdown","source":"go"},{"lang":"es","text":"zrok es un software para compartir servicios web, archivos y recursos de red. Antes de la versión 2.0.1, el motor de plantillas proxyUi utiliza text/template de Go (que no realiza escape de HTML) en lugar de html/template. Los manejadores de callback de GitHub OAuth tanto en publicProxy como en dynamicProxy incrustan el parámetro de consulta refreshInterval controlado por el atacante textualmente en un mensaje de error cuando time.ParseDuration falla, y renderizan ese error sin escape en HTML. Un atacante puede entregar una URL de inicio de sesión manipulada a una víctima; después de que la víctima completa el flujo de GitHub OAuth, la página de callback ejecuta JavaScript arbitrario en el origen del servidor OAuth. La versión 2.0.1 corrige el problema.","source":"nvd"}],"published":"2026-04-16T21:08:55.000Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-116"],"affected":[{"ranges":[{"version":"< 2.0.1","status":"affected"}],"vendor":"openziti","product":"zrok","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.1.11"}],"ecosystem":"Go","package":"github.com/openziti/zrok","purl":"pkg:golang/github.com/openziti/zrok","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.1"}],"ecosystem":"Go","package":"github.com/openziti/zrok/v2","purl":"pkg:golang/github.com/openziti/zrok/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/openziti/zrok","purl":"pkg:golang/github.com/openziti/zrok","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.1"}],"ecosystem":"Go","package":"github.com/openziti/zrok/v2","purl":"pkg:golang/github.com/openziti/zrok/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.0.1"}],"vendor":"netfoundry","product":"zrok","cpe":"cpe:2.3:a:netfoundry:zrok:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/openziti/zrok/security/advisories/GHSA-4fxq-2x3x-6xqx","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/openziti/zrok/releases/tag/v2.0.1","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40302","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/openziti/zrok","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-18T03:07:00.447Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40302","url":"https://www.cve.org/CVERecord?id=CVE-2026-40302","licence":"CVE Terms of Use","modified":"2026-04-18T03:07:10.092Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4fxq-2x3x-6xqx","url":"https://github.com/advisories/GHSA-4fxq-2x3x-6xqx","licence":"CC-BY-4.0","modified":"2026-06-25T18:56:29.323Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5118","url":"https://pkg.go.dev/vuln/GO-2026-5118","licence":"CC-BY-4.0","modified":"2026-06-25T18:45:22.459Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40302","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40302","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"}],"updatedAt":"2026-11-25T22:59:18.969Z","epss":{"score":0.00213,"percentile":0.12274,"date":"2026-12-01T12:00:22.000Z"}}