Read the docs
TI-2021-15509 Aliases CVE-2021-37634GHSA-rv3x-xq3r-8j9h

LeafKit allows XSS with untrusted user input

Priority LOW 34CWE-79Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Cross-site scripting
Confidentiality · integrity · availability
High · None · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.

Summary

Leafkit is a templating language with Swift-inspired syntax. Versions prior to 1.3.0 are susceptible to Cross-site Scripting (XSS) attacks. This affects anyone passing unsanitised data to Leaf's variable tags. Before this fix, Leaf would not escape any strings passed to tags as variables. If an attacker managed to find a variable that was rendered with their unsanitised data, they could inject scripts into a generated Leaf page, which could enable XSS attacks if other mitigations such as a Content Security Policy were not enabled. This has been patched in 1.3.0. As a workaround sanitize any untrusted input before passing it to Leaf and enable a CSP to block inline script and CSS data.

Why it matters now

EPSS 0.0071 53rd percentileScored 2026-11-07
Fix Fixed leaf-kit (vapor): 1.3.0github.com/vapor/leaf-kit (SwiftURL): 1.3.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
vaporleaf-kitbefore 1.3.01.3.0Patch availableCNA
—github.com/vapor/leaf-kit (SwiftURL)before 1.3.01.3.0Patch availableGHSA-rv3x-xq3r-8j9h
  • leaf-kit Vendorvapor Affected before 1.3.0 Fixed in 1.3.0 Patch available CNA
  • github.com/vapor/leaf-kit (SwiftURL) Vendor— Affected before 1.3.0 Fixed in 1.3.0 Patch available GHSA-rv3x-xq3r-8j9h

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:vapor:leafkit:*:*:*:*:*:*:*:*before 1.3.0Vulnerablevapor
  • cpe:2.3:a:vapor:leafkit:*:*:*:*:*:*:*:* Versions before 1.3.0 Vulnerable ·vapor

Remediation

  • Fix · CNA leaf-kit (vapor) Fixed in 1.3.0
  • Fix · GHSA-rv3x-xq3r-8j9h github.com/vapor/leaf-kit (SwiftURL) Fixed in 1.3.0 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2021-37634
  2. 2026-10-03 Alias added: GHSA-rv3x-xq3r-8j9h

References

  • TI-2026-22762 LeafKit's HTML escaping may be skipped for Collection values, enabling XSS CVSS 4.0MEDIUM 6.9
  • TI-2026-21572 Leaf-kit html escaping does not work on characters that are part of extended grapheme cluster CVSS 3.1MEDIUM 6.1

Sources