LiveActive security incident?Get immediate response
CVE Record

CVE-2021-32818: Remote code execution and Reflected cross site scripting in haml-coffee

haml-coffee is a JavaScript templating solution. haml-coffee mixes pure template data with engine configuration options through the Express render API. More specifically, haml-coffee supports overriding a series of HTML helper functions through its configuration options. A vulnerable application that passes user controlled request objects to the haml-coffee template engine may introduce RCE vulnerabilities. Additionally control over the escapeHtml parameter through template configuration pollution ensures that haml-coffee would not sanitize template inputs that may result in reflected Cross Site Scripting attacks against downstream applications. There is currently no fix for these issues as of the publication of this CVE. The latest version of haml-coffee is currently 1.14.1. For complete details refer to the referenced GHSL-2021-025.

HighCVSS 7.7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2021-32818 affects haml-coffee, a JavaScript templating package. If an application lets user-controlled request data influence haml-coffee render options, attackers may reach remote code execution. The same configuration pollution can disable HTML escaping and cause reflected XSS. The bundle states no fix was available at publication.

Executive priority

Treat as high priority where haml-coffee is used in externally reachable web applications. Business urgency depends on whether user-controlled request data reaches template rendering. If that pattern exists, prioritize remediation or replacement planning because sources do not name a fixed version.

Technical view

haml-coffee mixes template data and engine configuration through the Express render API. User-controlled objects passed into rendering can override HTML helper functions, creating RCE risk. Control over escapeHtml can disable sanitization and expose reflected XSS in downstream applications. Affected versions are listed as <= 1.14.1.

Likely exposure

Exposure is most likely in Node.js applications using haml-coffee with Express rendering where request-derived objects are passed into templates or render configuration. Projects merely having the package installed are lower risk unless vulnerable render patterns are present.

Exploitation context

The source bundle does not show CISA KEV listing or active exploitation evidence. CVSS indicates network attack vector, high complexity, low privileges, required user interaction, changed scope, and high confidentiality and integrity impact.

Researcher notes

The key condition is configuration pollution through Express render integration, not just generic template input. Validate data-flow into render options, helper override capability, and escapeHtml control. Keep analysis source-grounded; no cited source confirms active exploitation.

Mitigation direction

  • Inventory haml-coffee usage and affected versions in dependency manifests and lockfiles.
  • Do not pass user-controlled request objects into haml-coffee render options.
  • Use strict allowlists for render locals and template configuration fields.
  • Prevent user influence over escapeHtml or HTML helper configuration.
  • Check vendor advisory and package guidance because no fix is named in the sources.

Validation and detection

  • Confirm whether haml-coffee <= 1.14.1 is present in production dependencies.
  • Review Express render calls for request-derived objects or merged configuration.
  • Verify render configuration is built from trusted, explicit fields only.
  • Check XSS regression coverage for reflected template input escaping.
  • Document any compensating controls or migration decision for vulnerability management.
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
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-32818 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.7 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/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.7CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N1.35.8Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

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

Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/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

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
netzpirathaml-coffee<= 1.14.1Listed
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.