CVE-2021-32818: Insecure template handling in haml-coffee
7.7
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.51177%
CWE
Published
5/17/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
haml-coffee | npm | <= 1.14.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from haml-coffee's design that merges template data with engine configuration options via Express's render API. The express
method is explicitly mentioned as the integration point for Express, making it a conduit for injecting malicious configurations. The compile
function's handling of options like customHtmlEscape
(used in RCE PoC) and escapeHtml
(used in XSS PoC) directly enables the exploits. Both functions are central to the insecure mixing of data/configuration described in the advisory.