CVE-2021-37634
MEDIUM 6.1CVSS 3.1LeafKit allows XSS with untrusted user input
Leafkit is a templating language with Swift-inspired syntax. Versions prior to 1.3.0 are susceptible to Cross-site Scripting (XSS) attacks. This affects anyone passing unsanitised data to Leaf's variable tags. Before this fix, Leaf would not escape any strings passed to tags as variables. If an attacker managed to find a variable that was rendered with their unsanitised data, they could inject scripts into a generated Leaf page, which could enable XSS attacks if other mitigations such as a Content Security Policy were not enabled. This has been patched in 1.3.0. As a workaround sanitize any untrusted input before passing it to Leaf and enable a CSP to block inline script and CSS data.
- Published
- 9 Aug 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-79CWE-80
- Also known as
- GHSA-rv3x-xq3r-8j9h
- Sources
- NVDJSONOSV GHSA-rv3x-xq3r-8j9hJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | 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 |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | vapor | leafkitcpe:2.3:a:vapor:leafkit:*:*:*:*:*:*:*:* |
< 1.3.0 | 1.3.0 |
| OSV | SwiftURL | github.com/vapor/leaf-kit | < 1.3.0 | 1.3.0 |
References
- https://github.com/vapor/leaf-kit-ghsa-rv3x-xq3r-8j9h/pull/1 · Broken Link
- https://github.com/vapor/leaf-kit/security/advisories/GHSA-rv3x-xq3r-8j9h · Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-37634 · ADVISORY
- https://github.com/vapor/leaf-kit · PACKAGE
- https://github.com/vapor/leaf-kit/releases/tag/1.3.0 · WEB
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 9 Aug 2021)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 9 Jun 2023)