CVE-2021-32822: GHSL-2021-020: File disclosure in hbs - CVE-2021-32822

Published May 27, 2021
·
Updated

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.

Affected Software

1 affected component
Hbs Project Hbs Node.js

Event History

May 27, 2021
Advisory Published
via GitHub Security Lab·12:00 AM
Data Sourced
via GitHub Security Lab·12:00 AM
Description
Aug 16, 2021
CVE Published
via MITRE·06:45 PM
Data Sourced
via MITRE·06:45 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications using the hbs npm package as an Express view engine may be exposed, depending on how they use the Express render API. The issue arises where template data can overwrite internal engine configuration options.

2

What does an attacker need to exploit the vulnerability?

The attacker must be able to influence template data supplied to the Express render API in a way that permits overwriting hbs internal configuration options. The provided CVSS vector indicates exploitation is network-accessible and requires no authentication or user interaction.

3

Is a patch available?

No. The available information states that there is currently no patch for this vulnerability.

4

What can be done if patching is not possible?

Avoid passing untrusted or attacker-controlled values as template data to hbs rendering calls, particularly where those values could overwrite engine configuration options. Review render API usage to keep template data separate from configuration.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203