Vulnerability Description
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.
CVSS Score
HIGH
Affected Products
| Vendor | Product | Versions |
|---|---|---|
| Vapor | Leafkit | < 1.3.0 |
Related Weaknesses (CWE)
References
- https://github.com/vapor/leaf-kit-ghsa-rv3x-xq3r-8j9h/pull/1Broken Link
- https://github.com/vapor/leaf-kit/security/advisories/GHSA-rv3x-xq3r-8j9hThird Party Advisory
- https://github.com/vapor/leaf-kit-ghsa-rv3x-xq3r-8j9h/pull/1Broken Link
- https://github.com/vapor/leaf-kit/security/advisories/GHSA-rv3x-xq3r-8j9hThird Party Advisory
FAQ
What is CVE-2021-37634?
CVE-2021-37634 is a vulnerability with a CVSS score of 7.4 (HIGH). 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 varia...
How severe is CVE-2021-37634?
CVE-2021-37634 has been rated HIGH with a CVSS base score of 7.4/10. Review the CVSS metrics above for detailed severity breakdown.
Is there a patch for CVE-2021-37634?
Check the references section above for vendor advisories and patch information. Affected products include: Vapor Leafkit.