Leaf-kit html escaping does not work on characters that are part of extended grapheme cluster
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · 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. Prior to 1.4.1, htmlEscaped in leaf-kit will only escape html special characters if the extended grapheme clusters match, which allows bypassing escaping by using an extended grapheme cluster containing both the special html character and some additional characters. In the case of html attributes, this can lead to XSS if there is a leaf variable in the attribute that is user controlled. This vulnerability is fixed in 1.4.1.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| vapor | leaf-kit | before 1.4.1 | 1.4.1 | Patch available | CNA |
| — | github.com/vapor/leaf-kit (SwiftURL) | before 1.4.1 | 1.4.1 | Patch available | GHSA-4hfh-fch3-5q7p |
- leaf-kit Vendorvapor Affected before 1.4.1 Fixed in 1.4.1 Patch available CNA
- github.com/vapor/leaf-kit (SwiftURL) Vendor— Affected before 1.4.1 Fixed in 1.4.1 Patch available GHSA-4hfh-fch3-5q7p
Remediation
- Fix · CNA leaf-kit (vapor) Fixed in 1.4.1
- Fix · GHSA-4hfh-fch3-5q7p github.com/vapor/leaf-kit (SwiftURL) Fixed in 1.4.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-27120
- 2026-10-03 Alias added: GHSA-4hfh-fch3-5q7p
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-2021-15509 LeafKit allows XSS with untrusted user input CVSS 3.1HIGH 7.4
Sources
- CVE-2026-27120 · CVE Program
- CVE-2026-27120 · NVD
- FIRST EPSS
- GHSA-4hfh-fch3-5q7p · 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