Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-28499

CVE-2026-28499: Vapor LeafKit XSS Vulnerability

CVE-2026-28499 is an XSS flaw in Vapor LeafKit that allows unescaped rendering of untrusted input through collections. This article covers the technical details, affected versions, impact, and mitigation.

Published: March 20, 2026

CVE-2026-28499 Overview

CVE-2026-28499 is a Cross-Site Scripting (XSS) vulnerability in LeafKit, a templating language with Swift-inspired syntax used in the Vapor web framework ecosystem. Prior to version 1.14.2, HTML escaping doesn't work correctly when a template prints a collection (Array / Dictionary) via the #(value) syntax. This flaw allows potentially untrusted input to be rendered unescaped in web pages, creating an XSS attack vector.

Critical Impact

Attackers can inject malicious scripts into web pages rendered by LeafKit templates when collections containing untrusted data are displayed. This can lead to session hijacking, credential theft, defacement, or malware distribution to end users.

Affected Products

  • Vapor LeafKit versions prior to 1.14.2
  • Web applications using LeafKit templating with collection rendering
  • Vapor-based Swift web applications using vulnerable LeafKit versions

Discovery Timeline

  • 2026-03-18 - CVE CVE-2026-28499 published to NVD
  • 2026-03-18 - Last updated in NVD database

Technical Details for CVE-2026-28499

Vulnerability Analysis

This vulnerability exists in the HTML escaping logic within LeafKit's LeafData and LeafDataStorage components. When rendering collections such as Arrays or Dictionaries through the #(value) template syntax, the HTML escaping function fails to properly sanitize the content before output.

The root issue lies in how the htmlEscaped() function handled data conversion. The original implementation attempted to access the string property directly, which doesn't properly handle collection types. Collections would bypass the escaping logic entirely, allowing any HTML or JavaScript content within collection elements to be rendered directly into the page output without sanitization.

This vulnerability is exploitable over the network without authentication requirements. An attacker who can inject content into a collection that gets rendered by a LeafKit template can execute arbitrary JavaScript in the context of victims' browsers.

Root Cause

The vulnerability stems from improper input validation in the htmlEscaped() function within LeafData.swift. The function's guard statement checked self.string directly instead of first converting the data to a string type. When processing collections (Arrays or Dictionaries), this direct access would fail to produce a string representation, causing the function to return the data unescaped.

The fix modifies the guard statement to use self.convert(to: .string, .ambiguous).string, ensuring proper type conversion occurs before the HTML escaping check, allowing collection contents to be properly escaped.

Attack Vector

An attacker can exploit this vulnerability by injecting malicious JavaScript or HTML content into data that will be stored in an Array or Dictionary and subsequently rendered in a LeafKit template. Common attack scenarios include:

  1. User-supplied input stored in collections (e.g., lists of comments, tags, or user data)
  2. Data from external APIs that gets rendered without proper escaping
  3. Database content that includes malicious scripts in collection fields

The following patch shows the security fix applied in version 1.14.2:

text
 
     /// Return a HTML-escaped version of this data if it can be converted to a string.
     func htmlEscaped() -> LeafData {
-        guard let string = self.string else {
+        guard let string = self.convert(to: .string, .ambiguous).string else {
             return self
         }
 

Source: GitHub Commit Details

The serialization logic was also updated to ensure consistent handling:

text
     
     /// Final serialization to a shared buffer
     func serialize(buffer: inout ByteBuffer) throws {
-        switch self {
-        case .bool, .int, .double, .string, .optional, .array, .dictionary:
-            try buffer.writeString(self.serialize(), encoding: LeafConfiguration.encoding)
-        case .data(let d):
-            buffer.writeData(d)
-        }
+        try buffer.writeString(self.serialize(), encoding: LeafConfiguration.encoding)
     }
     
     // MARK: - Equatable Conformance

Source: GitHub Commit Details

Detection Methods for CVE-2026-28499

Indicators of Compromise

  • Unusual JavaScript execution patterns in rendered pages containing collection data
  • Web application logs showing script injection attempts in array or dictionary fields
  • Browser console errors related to Content Security Policy violations if CSP is implemented
  • User reports of unexpected behavior or redirects when viewing pages with list/collection content

Detection Strategies

  • Audit LeafKit templates for usage of #(value) syntax with collection types (Arrays/Dictionaries)
  • Review application dependencies for LeafKit versions below 1.14.2
  • Implement Web Application Firewall (WAF) rules to detect XSS payloads in input fields
  • Monitor Content Security Policy (CSP) violation reports for injection attempts

Monitoring Recommendations

  • Enable verbose logging for user input that gets stored in collection data structures
  • Implement real-time alerting for XSS-related patterns in web request logs
  • Deploy browser-based XSS detection mechanisms such as CSP reporting
  • Monitor for anomalous JavaScript execution in user sessions

How to Mitigate CVE-2026-28499

Immediate Actions Required

  • Upgrade LeafKit to version 1.14.2 or later immediately
  • Audit all templates that render collection data using #(value) syntax
  • Implement Content Security Policy headers to limit script execution as defense-in-depth
  • Review and sanitize any user-controlled data stored in Arrays or Dictionaries

Patch Information

The vulnerability is fixed in LeafKit version 1.14.2. The patch modifies the htmlEscaped() function to properly convert collection types to strings before applying HTML escaping, ensuring all content is properly sanitized before rendering.

To update, modify your Package.swift dependencies:

swift
.package(url: "https://github.com/vapor/leaf-kit.git", from: "1.14.2")

For detailed information, see the GitHub Security Advisory GHSA-6jj5-j4j8-8473 and the GitHub Release Version 1.14.2.

Workarounds

  • Manually escape collection contents before passing to templates using custom sanitization functions
  • Avoid rendering untrusted data within collections directly in templates
  • Implement server-side input validation to strip HTML/script content from user inputs before storage
  • Deploy strict Content Security Policy headers to prevent inline script execution as a mitigating control
bash
# Example: Update Package.swift and rebuild
swift package update
swift build --configuration release

# Verify installed version
swift package show-dependencies | grep leaf-kit

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechVapor Leafkit

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Release Version 1.14.2
  • Vendor Resources
  • GitHub Commit Details

  • GitHub Security Advisory GHSA-6jj5-j4j8-8473
  • Latest CVEs
  • CVE-2025-52793: Esselink.nu Settings CSRF Vulnerability

  • CVE-2025-52772: Virtual Moderator CSRF Vulnerability

  • CVE-2025-48279: WC MyParcel Belgium XSS Vulnerability

  • CVE-2025-39381: KiotViet Sync CSRF 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