CVE-2021-32818
JavaScript vulnerability analysis and mitigation

Overview

The CVE-2021-32818 vulnerability affects haml-coffee version 1.14.1 and earlier. This vulnerability was discovered and reported on May 14, 2021, and involves remote code execution (RCE) and reflected cross-site scripting (XSS) risks in the haml-coffee template engine when used with Express. The vulnerability stems from the template engine's configuration options being passed through the Express render API (GitHub Security Lab).

Technical details

The vulnerability exists because haml-coffee supports overriding HTML helper functions through its configuration options. When used with Express's render API, the engine mixes pure template data with engine configuration options, which can lead to security issues if user-controlled request objects are passed to the template engine. Specifically, control over parameters like customHtmlEscape and escapeHtml can trigger RCE or XSS vulnerabilities in downstream applications (GitHub Security Lab).

Impact

The vulnerability has two main impact vectors: 1) Remote Code Execution (RCE) through the customHtmlEscape parameter, allowing attackers to execute arbitrary code on the server, and 2) Reflected Cross-Site Scripting (XSS) through the escapeHtml parameter, which can be used to bypass HTML sanitization and execute malicious scripts in users' browsers (GitHub Security Lab).

Mitigation and workarounds

The issue affects haml-coffee version 1.14.1, which was the latest version at the time of disclosure. Applications should avoid passing user-controlled objects directly to the template engine's render function and implement proper validation of all user inputs before they reach the template engine (GitHub Security Lab).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66456CRITICAL9.1
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-66457HIGH7.5
  • JavaScriptJavaScript
  • elysia
NoYesDec 09, 2025
CVE-2025-65849MEDIUM6.9
  • JavaScriptJavaScript
  • altcha
NoNoDec 08, 2025
CVE-2025-66202MEDIUM6.5
  • JavaScriptJavaScript
  • astro
NoYesDec 09, 2025
CVE-2025-14284MEDIUM5.1
  • JavaScriptJavaScript
  • @tiptap/extension-link
NoYesDec 09, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management