Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-37634

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-37634
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:51 UTC · Revision 1

Source evidence

CVE-2021-37634

core-osv · Original source

Published 9 Aug 2021, 20:15 UTC

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.

osv:CVE-2021-37634
Complete source record
{
  "id": "6b3571afd06ad5390b59f16f610c501dbc143dc2d189ed931123b801f6ebfad7",
  "url": "https://osv.dev/vulnerability/CVE-2021-37634",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-37634",
    "summary": "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.",
    "evidence": "osv:CVE-2021-37634",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-37634",
      "aliases": [
        "CVE-2021-37634",
        "GHSA-rv3x-xq3r-8j9h"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/vapor/leaf-kit",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "e57cde59dc5e74e5b7216d6088716e755ac436f0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:vapor:leafkit:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.3.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.2.0",
            "1.1.0",
            "1.0.0",
            "1.0.0-zeta.1",
            "1.0.0-tau.1.1",
            "1.0.0-tau.1",
            "1.0.0-rc.1.17",
            "1.0.0-rc.1.16",
            "1.0.0-rc.1.15",
            "1.0.0-rc.1.14",
            "1.0.0-rc.1.13",
            "1.0.0-rc.1.12",
            "1.0.0-rc.1.11",
            "1.0.0-rc.1.10",
            "1.0.0-rc.1.9",
            "1.0.0-rc.1.8",
            "1.0.0-rc.1.7",
            "1.0.0-rc.1.6",
            "1.0.0-rc.1.5",
            "1.0.0-rc.1.4",
            "1.0.0-rc.1.3",
            "1.0.0-rc.1.2",
            "1.0.0-rc.1.1",
            "1.0.0-rc.1",
            "1.0.0-beta.2.2",
            "1.0.0-beta.2.1",
            "1.0.0-beta.2",
            "1.0.0-alpha.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-37634.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:50.053357717Z",
      "provider": "osv",
      "references": [
        "https://github.com/vapor/leaf-kit/security/advisories/GHSA-rv3x-xq3r-8j9h",
        "https://github.com/vapor/leaf-kit-ghsa-rv3x-xq3r-8j9h/pull/1"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-37634",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 386238,
  "published_at": "2021-08-09T20:15:07.727+00:00"
}