# CVE-2026-27120: Leaf-kit html escaping does not work on characters that are part of extended grapheme cluster

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.26%, higher than 19% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-02-19T19:40:08.000Z
- Modified: 2026-06-17T10:26:42.180Z
- Also known as: GHSA-4hfh-fch3-5q7p
- Weaknesses: CWE-75, CWE-79, CWE-87
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- vapor leaf-kit: < 1.4.1
- github.com/vapor/leaf-kit (SwiftURL): before 1.4.1
- vapor leafkit: before 1.14.1

## Every score

- GitHub_M: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/vapor/leaf-kit/security/advisories/GHSA-4hfh-fch3-5q7p> (exploit, vendor-advisory, web)
- <https://github.com/vapor/leaf-kit/commit/8919e39476c3a4ba05c28b71546bb9195f87ef34> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-27120> (advisory)
- <https://github.com/vapor/leaf-kit> (package)

## Sources

- CVE List: [CVE-2026-27120](https://www.cve.org/CVERecord?id=CVE-2026-27120), CVE Terms of Use, modified 2026-02-24
- GitHub Advisory Database: [GHSA-4hfh-fch3-5q7p](https://github.com/advisories/GHSA-4hfh-fch3-5q7p), CC-BY-4.0, modified 2026-04-22
- NVD: [CVE-2026-27120](https://nvd.nist.gov/vuln/detail/CVE-2026-27120), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-27120 · Whole record: https://cve.day/CVE-2026-27120.json · Rebuilt by cve.day 2026-11-25T22:59:14.425Z
