CVE-2021-32822 File disclosure in hbs

Medium 4.0 Published Updated

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.

Weakness: CWE-94, CWE-538

Which versions are affected by CVE-2021-32822?

2 open source packages ship an affected version, including hbs. It affects 1 product.

PackageAffectedFixed in
hbs npmAll versions to 4.4.0None
hbs npmAll versions to 4.4.0None

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.

Sources

Also known as GHSA-7f5c-rpf4-86p8.

Is CVE-2021-32822 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free