{"id":"CVE-2026-27120","published":"2026-02-20T21:27:09Z","modified":"2026-02-24T18:41:10Z","title":"Leaf-kit html escaping does not work on characters that are part of extended grapheme cluster","vendor":"vapor","product":"leaf-kit","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.1,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00355,"percentile":0.21607,"provenance":"source"},"cwes":[{"id":"CWE-75","name":"Failure to Sanitize Special Elements into a Different Plane"},{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"},{"id":"CWE-87","name":"Improper Neutralization of Alternate XSS Syntax"}],"references":[{"url":"https://github.com/vapor/leaf-kit/security/advisories/GHSA-4hfh-fch3-5q7p","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/vapor/leaf-kit/commit/8919e39476c3a4ba05c28b71546bb9195f87ef34","tags":["x_refsource_MISC"]}],"priority":{"score":8.6,"factors":[{"name":"EPSS percentile","points":4.32},{"name":"CVSS severity","points":4.27}]},"vendorSlug":"vapor","affectedVersions":[{"vendor":"vapor","product":"leaf-kit","versions":["< 1.4.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-02-24T18:40:50.919491Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"SwiftURL","package":"github.com/vapor/leaf-kit","vulnerableRanges":["<1.4.1"],"patched":["1.4.1"],"from":["GHSA-4hfh-fch3-5q7p"],"provenance":"source"}],"summary":{"text":"The leaf-kit component of the Vapor project's leafkit templating language fails to escape HTML special characters when they are combined with additional characters into a single extended grapheme cluster, so htmlEscaped does not neutralise them. An unauthenticated remote attacker can exploit this by supplying crafted input that is rendered into an HTML attribute via a Leaf variable, which requires the victim to interact with the page (user interaction) and results in cross-site scripting.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:12:11Z"},"euvd":{"id":"EUVD-2026-7783","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-37634","published":"2021-08-09","fixed":"1.3.0","kev":false},{"cve":"CVE-2026-27120","published":"2026-02-20","fixed":"1.4.1","kev":false},{"cve":"CVE-2026-28499","published":"2026-03-18","fixed":"1.14.2","kev":false,"link":{"from":"CVE-2026-27120","to":"CVE-2026-28499","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"SwiftURL:github.com/vapor/leaf-kit","fromFixed":"1.4.1","toFixed":"1.14.2","daysApart":26},{"kind":"similar","provenance":"machine","score":0.37,"basis":"same product + CWE + description similarity"}]}}],"package":"SwiftURL:github.com/vapor/leaf-kit"}}