Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1ydjN4LXhxM3ItOGo5aM4AAzxA
LeafKit allows XSS with untrusted user input
Impact
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.
Patches
This has been patched in 1.3.0
Workarounds
Sanitise any untrusted input before passing it to Leaf and enable a CSP to block inline script and CSS data.
References
https://github.com/vapor/leaf-kit-ghsa-rv3x-xq3r-8j9h/pull/1
For more information
If you have any questions or comments about this advisory:
- Open an issue in Leaf Kit
- Email us at [email protected]
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1ydjN4LXhxM3ItOGo5aM4AAzxA
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 11 months ago
Updated: 11 months ago
Identifiers: GHSA-rv3x-xq3r-8j9h, CVE-2021-37634
References:
- https://github.com/vapor/leaf-kit/security/advisories/GHSA-rv3x-xq3r-8j9h
- https://nvd.nist.gov/vuln/detail/CVE-2021-37634
- https://github.com/vapor/leaf-kit/releases/tag/1.3.0
- https://github.com/advisories/GHSA-rv3x-xq3r-8j9h
Blast Radius: 0.0
Affected Packages
swift:github.com/vapor/leaf-kit
Dependent packages: 5Dependent repositories: 77
Downloads:
Affected Version Ranges: < 1.3.0
Fixed in: 1.3.0
All affected versions: 0.0.1, 0.0.2, 1.0.0, 1.1.0, 1.2.0
All unaffected versions: 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.10.2, 1.10.3