Advisory Database
  • Advisories
  • Dependency Scanning
  1. swift
  2. ›
  3. github.com/vapor/leaf-kit
  4. ›
  5. CVE-2021-37634

CVE-2021-37634: LeafKit allows XSS with untrusted user input

June 9, 2023

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.

References

  • github.com/advisories/GHSA-rv3x-xq3r-8j9h
  • github.com/vapor/leaf-kit
  • github.com/vapor/leaf-kit/releases/tag/1.3.0
  • github.com/vapor/leaf-kit/security/advisories/GHSA-rv3x-xq3r-8j9h
  • nvd.nist.gov/vuln/detail/CVE-2021-37634

Detect and mitigate CVE-2021-37634 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.3.0

Fixed versions

  • 1.3.0

Solution

Upgrade to version 1.3.0 or above.

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
  • CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

Source file

swift/github.com/vapor/leaf-kit/CVE-2021-37634.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:44 +0000.