CVE-2021-32822 File disclosure in hbs
Attackers can trigger file disclosure in applications using the hbs library by overwriting internal configuration options via the Express render API.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2021-32822?
CVE-2021-32822 is a medium-severity path traversal vulnerability in pillarjs hbs, published on 16 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Which versions are affected by CVE-2021-32822?
2 open source packages ship an affected version, including hbs. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
hbs npm | All versions to 4.4.0 | None |
hbs npm | All versions to 4.4.0 | None |
Products include Hbs Project Hbs.
How do I fix CVE-2021-32822?
No fix has been published for CVE-2021-32822 yet. Limit exposure of the affected software until one is available.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2021-32822 being exploited?
There is no known exploitation of CVE-2021-32822 in the wild and no public exploit code.
Other vulnerabilities in pillarjs hbs
Sources
Also known as GHSA-7f5c-rpf4-86p8.