CVE-2026-27120
MEDIUM 6.1CVSS 3.1Leaf-kit html escaping does not work on characters that are part of extended grapheme cluster
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.
- Published
- 20 Feb 2026
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-75CWE-79CWE-87
- Also known as
- GHSA-4hfh-fch3-5q7p
- Sources
- NVDJSONOSV GHSA-4hfh-fch3-5q7pJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | vapor | leafkitcpe:2.3:a:vapor:leafkit:*:*:*:*:*:*:*:* |
< 1.14.1 | 1.14.1 |
| OSV | SwiftURL | github.com/vapor/leaf-kit | < 1.4.1 | 1.4.1 |
References
- https://github.com/vapor/leaf-kit/commit/8919e39476c3a4ba05c28b71546bb9195f87ef34 · Patch, WEB
- https://github.com/vapor/leaf-kit/security/advisories/GHSA-4hfh-fch3-5q7p · Exploit, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-27120 · ADVISORY
- https://github.com/vapor/leaf-kit · PACKAGE
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 20 Feb 2026)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 19 Feb 2026)