CVE-2021-32822
JavaScript vulnerability analysis and mitigation

Overview

The npm hbs package, an Express view engine wrapper for Handlebars, was identified with a file disclosure vulnerability (CVE-2021-32822). The vulnerability was discovered in version v4.1.1 and reported on January 25, 2021, with public disclosure on May 27, 2021. This security issue affects applications using the hbs template engine that pass user-controlled data directly through the Express render API (GitHub Advisory).

Technical details

The vulnerability stems from hbs mixing pure template data with engine configuration options through the Express render API. The Express render API was originally designed to only pass template data, but when template engine configuration options are passed through it directly, it can lead to security issues. This occurs particularly when applications pass user-controlled objects (like req.query) directly into the render engine. The vulnerability has been assigned CWE-538 and CWE-200 classifications, relating to file information disclosure (NVD Report).

Impact

The primary impact of this vulnerability is file disclosure, where an attacker could potentially access sensitive files on the system. When exploited, the vulnerability allows attackers to retrieve contents of arbitrary files by manipulating the template engine configuration options (GitHub Advisory).

Mitigation and workarounds

The vulnerability was reported to the maintainer on January 25, 2021, and acknowledged on January 28, 2021. Applications should avoid passing user-controlled objects directly to the render function and ensure proper validation of input data. Additionally, developers should review their template engine configuration handling to ensure it aligns with Express's intended design (GitHub Advisory).

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-67731HIGH8.7
  • JavaScriptJavaScript
  • servify-express
NoYesDec 12, 2025
CVE-2025-67718HIGH8.7
  • JavaScriptJavaScript
  • formio
NoYesDec 11, 2025
CVE-2025-65513HIGH7.5
  • JavaScriptJavaScript
  • mcp-fetch-server
NoNoDec 09, 2025
CVE-2025-67716MEDIUM5.7
  • JavaScriptJavaScript
  • @auth0/nextjs-auth0
NoYesDec 11, 2025
CVE-2025-67490MEDIUM5.4
  • JavaScriptJavaScript
  • @auth0/nextjs-auth0
NoYesDec 10, 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