The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40302

CVE-2026-40302: Netfoundry Zrok XSS Vulnerability

CVE-2026-40302 is a cross-site scripting flaw in Netfoundry Zrok affecting OAuth callback handlers. Attackers exploit unescaped HTML rendering to execute malicious JavaScript. This article covers technical details, affected versions, impact, and mitigation steps.

Published: April 23, 2026

CVE-2026-40302 Overview

CVE-2026-40302 is a Cross-Site Scripting (XSS) vulnerability in zrok, software used for sharing web services, files, and network resources. The vulnerability exists in versions prior to 2.0.1 due to the proxyUi template engine using Go's text/template package instead of the safer html/template package. This design flaw allows attacker-controlled input to be rendered unescaped into HTML output, enabling arbitrary JavaScript execution.

Critical Impact

An attacker can execute arbitrary JavaScript in the context of the OAuth server's origin by delivering a crafted login URL to victims, potentially leading to session hijacking, credential theft, or other malicious actions after the victim completes the GitHub OAuth flow.

Affected Products

  • Netfoundry zrok versions prior to 2.0.1

Discovery Timeline

  • 2026-04-17 - CVE CVE-2026-40302 published to NVD
  • 2026-04-23 - Last updated in NVD database

Technical Details for CVE-2026-40302

Vulnerability Analysis

This vulnerability stems from a fundamental template security misconfiguration in zrok's proxy component. The GitHub OAuth callback handlers in both publicProxy and dynamicProxy embed the attacker-controlled refreshInterval query parameter directly into an error message when time.ParseDuration fails to parse the input. Because the application uses Go's text/template package—which does not perform HTML escaping—instead of the security-aware html/template package, the error message containing the malicious payload is rendered unescaped into the HTML response.

The attack requires user interaction: a victim must click on a crafted login URL and complete the GitHub OAuth authentication flow. Upon callback completion, the injected JavaScript executes within the OAuth server's origin context, giving the attacker access to sensitive information or the ability to perform actions on behalf of the authenticated user.

Root Cause

The root cause is the use of Go's text/template package for rendering HTML content in the proxyUi template engine. Unlike html/template, which automatically escapes dangerous characters to prevent XSS attacks, text/template outputs content verbatim without any sanitization. When user-controlled input (the refreshInterval query parameter) is embedded into error messages and rendered through this template, it creates a reflected XSS vulnerability.

Attack Vector

The attack is network-based and requires user interaction. An attacker crafts a malicious login URL containing JavaScript payload in the refreshInterval query parameter. When a victim clicks this URL and authenticates via GitHub OAuth, the callback handler attempts to parse the refreshInterval value using time.ParseDuration. The parsing fails due to the malicious input, and the error message—containing the attacker's JavaScript—is rendered unescaped into the HTML response. The browser then executes the injected script in the OAuth server's security context.

The vulnerability mechanism works as follows: the attacker embeds malicious JavaScript within the refreshInterval query parameter. When the OAuth callback processes this parameter and encounters a parsing error, it includes the raw parameter value in an error message. This error message is rendered through the vulnerable text/template engine without HTML encoding, allowing the JavaScript to execute when the browser renders the page.

For detailed technical information, see the GitHub Security Advisory GHSA-4fxq-2x3x-6xqx.

Detection Methods for CVE-2026-40302

Indicators of Compromise

  • Unusual OAuth callback URLs containing script tags or JavaScript event handlers in the refreshInterval parameter
  • Web server logs showing malformed refreshInterval values with HTML/JavaScript content
  • Reports of unexpected JavaScript behavior on OAuth callback pages

Detection Strategies

  • Monitor web application logs for OAuth callback requests with suspicious refreshInterval parameter values containing <script>, javascript:, or HTML event handlers
  • Implement Content Security Policy (CSP) headers to detect and block inline script execution attempts
  • Review application error logs for time.ParseDuration failures with unusual input patterns

Monitoring Recommendations

  • Enable detailed logging for OAuth callback handlers and monitor for anomalous parameter values
  • Deploy web application firewall (WAF) rules to detect and block XSS payloads in query parameters
  • Monitor for user reports of unexpected pop-ups or behavior after OAuth authentication flows

How to Mitigate CVE-2026-40302

Immediate Actions Required

  • Upgrade zrok to version 2.0.1 or later immediately
  • Audit OAuth callback URLs shared within your organization for potential malicious modifications
  • Implement Content Security Policy (CSP) headers as a defense-in-depth measure while patching is underway
  • Review access logs for signs of exploitation attempts targeting the OAuth callback endpoints

Patch Information

NetFoundry has released version 2.0.1 of zrok which addresses this vulnerability by switching from text/template to html/template for HTML rendering, ensuring proper escaping of user-controlled input. The patch is available via the GitHub zrok v2.0.1 Release.

Workarounds

  • Deploy a reverse proxy or WAF in front of zrok instances to filter XSS payloads in query parameters
  • Implement strict Content Security Policy headers to prevent inline script execution
  • If GitHub OAuth is not required, consider disabling or restricting access to OAuth callback endpoints until patching is possible
bash
# Example: Update zrok to patched version
# Download and install zrok v2.0.1 or later
curl -L https://github.com/openziti/zrok/releases/download/v2.0.1/zrok_2.0.1_linux_amd64.tar.gz -o zrok.tar.gz
tar -xzf zrok.tar.gz
sudo mv zrok /usr/local/bin/
zrok version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechNetfoundry Zrok

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub zrok v2.0.1 Release
  • Vendor Resources
  • GitHub Security Advisory GHSA-4fxq-2x3x-6xqx
  • Related CVEs
  • CVE-2026-40304: Netfoundry Zrok Auth Bypass Vulnerability

  • CVE-2026-40303: Netfoundry Zrok DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English