LeafKit allows XSS with untrusted user input
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
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| vapor | leaf-kit | before 1.3.0 | 1.3.0 | Patch available | CNA |
| — | github.com/vapor/leaf-kit (SwiftURL) | before 1.3.0 | 1.3.0 | Patch available | GHSA-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
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
- 2026-10-02 Threatist record created from CVE-2021-37634
- 2026-10-03 Alias added: GHSA-rv3x-xq3r-8j9h
References
More vapor Leafkit vulnerabilities
- 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
- CVE-2021-37634 · CVE Program
- CVE-2021-37634 · NVD
- FIRST EPSS
- GHSA-rv3x-xq3r-8j9h · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences