LiveActive security incident?Get immediate response
CVE Record

CVE-2021-32822: File disclosure in hbs

The npm hbs package is an Express view engine wrapper for Handlebars. Depending on usage, users of hbs may be vulnerable to a file disclosure vulnerability. There is currently no patch for this vulnerability. hbs mixes pure template data with engine configuration options through the Express render API. By overwriting internal configuration options a file disclosure vulnerability may be triggered in downstream applications. For an example PoC see the referenced GHSL-2021-020.

MediumCVSS 4Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

CVE-2021-32822 can let an attacker read files from some Node.js applications using the npm hbs package. Risk depends on how the application passes data into Express rendering. The public record says all hbs versions are affected and no patch is currently available.

Executive priority

Treat as a moderate-priority application security issue. It is not marked actively exploited, but file disclosure can expose secrets or sensitive application data where vulnerable render patterns exist. Prioritize internet-facing Node.js services using hbs.

Technical view

hbs wraps Handlebars as an Express view engine. The issue comes from hbs mixing template data with engine configuration options through Express render. If downstream application data can overwrite internal options, file disclosure may occur. CVSS is 4.0 with high attack complexity and confidentiality impact only.

Likely exposure

Exposure is most likely in Express applications using hbs where user-controlled or externally influenced data reaches render locals or options. Not every hbs installation is necessarily exploitable; the vulnerability is explicitly usage-dependent.

Exploitation context

The supplied sources do not show active exploitation, and KEV is false. The advisory reference includes a public proof-of-concept, so defenders should assume researchers can validate the bug, but not infer widespread exploitation from these sources.

Researcher notes

Focus analysis on data flow into Express render rather than package presence alone. Sources identify all hbs versions as affected but make exploitability dependent on downstream usage. No source-provided patch is available in the supplied bundle.

Mitigation direction

  • Inventory applications using the npm hbs package.
  • Review Express render paths for user-controlled data reaching locals or options.
  • Avoid passing untrusted objects directly into render inputs.
  • Check vendor and project guidance because no patch is named.
  • Consider replacing hbs where risky render patterns cannot be removed.

Validation and detection

  • Confirm whether hbs is present in production dependency manifests.
  • Map all Express render calls using hbs templates.
  • Trace request-derived data passed into render locals or options.
  • Verify safeguards prevent overwriting hbs internal configuration options.
  • Document affected routes and prioritize externally reachable paths.
Prepared
Confidence
high
Sources
3

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 · low confidence lookup

CWE-538: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. 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-32822 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
Medium
CVSS
4 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/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
2Source 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
4CVSS 3.1MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N2.21.4Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

4Medium
CVSS 3.1 vector shape for CVE-2021-32822Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

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

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
pillarjshbsallListed
Weakness

CWE details

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

CWE-538 · source CWE mapping

Insertion of Sensitive Information into Externally-Accessible File or Directory

Insertion of Sensitive Information into Externally-Accessible File or Directory represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.