LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37634: LeafKit 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.

HighCVSS 7.4Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2021-37634 is an XSS issue in Vapor LeafKit before 1.3.0. If an application renders attacker-controlled data through Leaf variable tags without sanitization, malicious script could run in a user’s browser. The vendor states this is patched in 1.3.0.

Executive priority

Treat this as a high-priority dependency update for Swift/Vapor applications using LeafKit. The business risk is user browser compromise through affected pages, but urgency should be scoped to services actually using vulnerable LeafKit rendering paths.

Technical view

LeafKit before 1.3.0 did not escape strings passed to variable tags. The CVSS 3.1 vector is network-accessible, low complexity, no privileges required, user interaction required, and scope-changing, with high confidentiality impact and no integrity or availability impact recorded.

Likely exposure

Exposure is limited to applications using vapor leaf-kit versions earlier than 1.3.0 that pass unsanitized user input into Leaf variable tags. Risk is higher where generated pages lack a Content Security Policy that blocks inline script and CSS data.

Exploitation context

The provided sources do not report active exploitation, and the CVE is not marked as CISA KEV. Exploitation depends on an attacker-controlled value reaching a rendered Leaf variable and a victim interacting with the affected page.

Researcher notes

Key evidence is the GitHub advisory: affected versions are below 1.3.0, patched in 1.3.0, with sanitization and CSP as workarounds. Evidence does not identify specific downstream applications, exploit campaigns, or broader affected products.

Mitigation direction

  • Upgrade vapor leaf-kit to version 1.3.0 or later.
  • Sanitize untrusted input before passing it to Leaf templates.
  • Enable a Content Security Policy blocking inline script and CSS data.
  • Review vendor advisory and project guidance before deploying changes.

Validation and detection

  • Inventory applications using vapor leaf-kit and record installed versions.
  • Confirm no deployed service uses leaf-kit earlier than 1.3.0.
  • Review Leaf templates for variables populated from user-controlled data.
  • Verify input sanitization exists before rendering untrusted values.
  • Check production pages enforce an appropriate Content Security Policy.
Prepared
Confidence
high
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-79: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-37634 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.4 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.4CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N2.84Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.4High
CVSS 3.1 vector shape for CVE-2021-37634Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
vaporleaf-kit< 1.3.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-79 · source CWE mapping

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.